/* Estilos para la página de Ayuda - Chat de IA */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
}

.chat-section {
    padding: 40px 20px;
    min-height: calc(100vh - 120px);
    background: #ffffff;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.chat-header {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

.chat-logo {
    width: 180px;
    height: auto;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease;
}

.chat-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #0052CC;
    font-weight: 700;
    letter-spacing: 1px;
}

.chat-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 650px;
    animation: fadeInUp 0.6s ease;
    border: 3px solid #9ca3af;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #fafafa;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: #ffffff;
    color: white;
    margin-right: 15px;
    padding: 0;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.bot-message .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: #6b7280;
    color: white;
    margin-left: 15px;
}

.message-content {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 20px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.bot-message .message-content {
    background: #0052CC;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 82, 204, 0.2);
    border-bottom-left-radius: 4px;
}

.user-message .message-content {
    background: #d1d5db;
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.message-content p {
    margin: 0;
    word-wrap: break-word;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    background: #0052CC;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 82, 204, 0.2);
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    margin: 0 3px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

.chat-input-container {
    padding: 25px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

#userInput {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: border-color 0.3s ease;
}

#userInput:focus {
    outline: none;
    border-color: #0052CC;
}

.send-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: #0052CC;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* Scrollbar personalizado */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #0052CC;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #003d99;
}

/* Animaciones */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-logo {
        width: 140px;
        margin-bottom: 15px;
    }

    .chat-header h1 {
        font-size: 1.5rem;
    }

    .chat-container {
        height: calc(100vh - 250px);
        border-radius: 15px;
    }

    .chat-messages {
        padding: 20px 15px;
    }

    .message-content {
        max-width: 80%;
        padding: 12px 16px;
    }

    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .chat-input-container {
        padding: 15px;
    }

    #userInput {
        padding: 12px;
        font-size: 0.95rem;
    }

    .send-button {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* Estilos para enlaces y botones en mensajes de la IA */
.message-content a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.message-content a:hover {
    opacity: 0.8;
}

.user-message .message-content a {
    color: #0052CC;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 8px 8px 0 0;
    padding: 12px 24px;
    background: #ffffff;
    color: #0052CC !important;
    border: 2px solid #ffffff;
    border-radius: 30px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-button:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-button:active {
    transform: scale(0.98);
}

.action-button i {
    margin-right: 8px;
    font-size: 1rem;
    color: #0052CC;
}

.message-content .button-container {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 480px) {
    .chat-section {
        padding: 20px 10px;
    }

    .chat-logo {
        width: 120px;
        margin-bottom: 12px;
    }

    .chat-header h1 {
        font-size: 1.2rem;
        letter-spacing: 0.5px;
    }

    .message-content {
        max-width: 85%;
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    .chat-container {
        height: calc(100vh - 220px);
    }

    .action-button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* Sección de Preguntas Frecuentes */
.faq-section {
    padding: 60px 20px;
    background: #ffffff;
}

.faq-title {
    text-align: center;
    font-size: 2.5rem;
    color: #0052CC;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.faq-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 50px;
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #0052CC;
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.1);
}

.faq-item.active {
    border-color: #0052CC;
    background: #ffffff;
}

.faq-question {
    width: 100%;
    padding: 20px 25px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
}

.faq-question:hover {
    color: #0052CC;
}

.faq-question-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.faq-question-icon {
    width: 40px;
    height: 40px;
    background: #0052CC;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.faq-question-icon i {
    color: white;
    font-size: 1.1rem;
}

.faq-question-text {
    flex: 1;
}

.faq-arrow {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.faq-arrow i {
    font-size: 1.2rem;
    color: #6b7280;
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
}

.faq-item.active .faq-arrow i {
    color: #0052CC;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 25px 25px 80px;
}

.faq-answer-content {
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.7;
}

.faq-answer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 10px 20px;
    background: #0052CC;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.faq-answer-link:hover {
    background: #003d99;
    transform: translateX(5px);
}

.faq-answer-link i {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .faq-section {
        padding: 40px 15px;
    }

    .faq-title {
        font-size: 1.8rem;
    }

    .faq-subtitle {
        font-size: 1rem;
        margin-bottom: 35px;
    }

    .faq-question {
        padding: 18px 20px;
        font-size: 1rem;
    }

    .faq-question-content {
        gap: 12px;
    }

    .faq-question-icon {
        width: 35px;
        height: 35px;
    }

    .faq-question-icon i {
        font-size: 1rem;
    }

    .faq-item.active .faq-answer {
        padding: 0 20px 20px 67px;
    }

    .faq-answer-content {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .faq-title {
        font-size: 1.5rem;
    }

    .faq-question {
        padding: 15px;
        font-size: 0.95rem;
    }

    .faq-question-content {
        gap: 10px;
    }

    .faq-question-icon {
        width: 32px;
        height: 32px;
    }

    .faq-question-icon i {
        font-size: 0.9rem;
    }

    .faq-arrow {
        width: 25px;
        height: 25px;
    }

    .faq-arrow i {
        font-size: 1rem;
    }

    .faq-item.active .faq-answer {
        padding: 0 15px 15px 57px;
    }

    .faq-answer-content {
        font-size: 0.9rem;
    }

    .faq-answer-link {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}
