/* /templates/eduai/css/sections/faq.css - VERSIÓN MEJORADA */

:root {
    /* Colores base */
    --primary-color-faq: var(--primary-color, #3a86ff); 
    --primary-rgb-faq: var(--primary-rgb, 58, 134, 255); 
    --secondary-color-faq: var(--secondary, #06d6a0);
    --success-color-faq: #10b981;
    --text-dark-faq: var(--text-dark, #1a1a2e);         
    --text-gray-faq: var(--text-gray, #5a6472);
    --text-light-faq: #8b92a5;
    --light-bg-faq: var(--light-gray-bg, #f7f9fc);
    --white-color-faq: var(--white-color, #ffffff);    
    --border-color-faq: var(--border-color, #e0e6ed);
    
    /* Sombras y transiciones mejoradas */
    --card-shadow-faq: 0 4px 20px rgba(0,0,0,0.04);
    --card-shadow-hover-faq: 0 8px 30px rgba(var(--primary-rgb-faq), 0.12);
    --card-shadow-active-faq: 0 12px 40px rgba(var(--primary-rgb-faq), 0.15);
    --transition-main-faq: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth-faq: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Estilos para la sección FAQ */
.faq-section.section { 
    background: linear-gradient(135deg, var(--light-bg-faq) 0%, #ffffff 100%);
    padding-top: 80px;
    padding-bottom: 100px;
    position: relative; 
    overflow: hidden;
}

/* Patrón de fondo sutil */
.faq-section.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 25% 25%, rgba(var(--primary-rgb-faq), 0.03) 0%, transparent 50%),
                      radial-gradient(circle at 75% 75%, rgba(var(--secondary-color-faq), 0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* Título de la sección FAQ mejorado */
#faq .section-title,
.faq-section .section-title {
    margin-bottom: 60px; 
    position: relative; 
    z-index: 1;
}

#faq .section-title h2,
.faq-section .section-title h2 {
    color: var(--text-dark-faq);
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 16px;
    position: relative;
}

/* Línea decorativa bajo el título */
#faq .section-title h2::after,
.faq-section .section-title h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color-faq), var(--secondary-color-faq));
    border-radius: 2px;
}

#faq .section-title p,
.faq-section .section-title p {
    font-size: 1.1rem; 
    color: var(--text-gray-faq);
    max-width: 680px; 
    margin: 0 auto;
    line-height: 1.6;
}

#faq .section-title p .text-primary,
.faq-section .section-title p .text-primary {
    color: var(--primary-color-faq);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

#faq .section-title p .text-primary:hover,
.faq-section .section-title p .text-primary:hover {
    border-bottom-color: var(--primary-color-faq);
}

/* Contenedor principal del FAQ */
.faq-container {
    max-width: 800px;
    margin: 0 auto; 
    position: relative;
    z-index: 1;
}

.faq-item {
    background-color: var(--white-color-faq);
    border-radius: 18px;
    margin-bottom: 24px; 
    box-shadow: var(--card-shadow-faq);
    border: 2px solid transparent;
    transition: var(--transition-smooth-faq);
    overflow: hidden; 
    position: relative;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(90deg, var(--primary-color-faq), var(--secondary-color-faq));
    transition: height 0.3s ease;
    z-index: 1;
}

.faq-item:hover {
    box-shadow: var(--card-shadow-hover-faq);
    border-color: rgba(var(--primary-rgb-faq), 0.2);
    transform: translateY(-2px);
}

.faq-item.active,
.faq-item:hover::before {
    height: 4px;
}

.faq-item.active {
    box-shadow: var(--card-shadow-active-faq);
    border-color: var(--primary-color-faq);
    transform: translateY(-3px);
}

.faq-question { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 28px 32px; 
    background-color: transparent; 
    border: none;
    text-align: left;
    font-weight: 600; 
    font-size: 1.15rem; 
    color: var(--text-dark-faq);
    cursor: pointer;
    transition: var(--transition-main-faq);
    position: relative; 
    z-index: 2;
}

.faq-question:hover {
    color: var(--primary-color-faq);
}

.faq-question span { 
    flex-grow: 1;
    padding-right: 24px; 
    line-height: 1.5;
}

.faq-icon { 
    font-size: 1.1rem;
    color: var(--text-gray-faq);
    background-color: rgba(var(--primary-rgb-faq), 0.08);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth-faq); 
    flex-shrink: 0; 
}

.faq-question:hover .faq-icon {
    color: var(--primary-color-faq);
    background-color: rgba(var(--primary-rgb-faq), 0.15);
    transform: scale(1.05);
}

/* Estilo cuando la pregunta está activa */
.faq-question[aria-expanded="true"] {
    color: var(--primary-color-faq);
    background-color: rgba(var(--primary-rgb-faq), 0.02);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg) scale(1.05);
    color: var(--white-color-faq);
    background-color: var(--primary-color-faq);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb-faq), 0.3);
}

/* Contenedor de respuesta mejorado */
.faq-answer { 
    padding: 0px 32px 0px 32px; 
    max-height: 0; 
    overflow: hidden; 
    transition: var(--transition-smooth-faq);
    position: relative;
}

.faq-answer[aria-hidden="false"] { 
    max-height: 800px; 
    padding-top: 8px;  
    padding-bottom: 32px; 
}

/* Contenido de la respuesta */
.answer-content {
    font-size: 0.98rem;
    color: var(--text-gray-faq);
    line-height: 1.7;
}

.answer-content strong {
    color: var(--text-dark-faq);
    font-weight: 600;
}

.answer-content em {
    color: var(--text-light-faq);
    font-style: italic;
    font-size: 0.95rem;
}

/* Estilos para listas en las respuestas */
.answer-content ul {
    margin: 16px 0;
    padding-left: 0;
    list-style: none;
}

.answer-content li {
    margin: 8px 0;
    padding-left: 24px;
    position: relative;
}

.answer-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--success-color-faq);
    font-weight: bold;
    font-size: 1.1rem;
}

/* Estilos para bullets con emojis */
.answer-content li:has(strong):first-child::before {
    content: '';
}

/* Enlaces dentro de las respuestas */
.answer-content a {
    color: var(--primary-color-faq);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.answer-content a:hover {
    border-bottom-color: var(--primary-color-faq);
}

/* Responsive mejorado */
@media (max-width: 992px) {
    .faq-container {
        max-width: 720px;
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .faq-section.section {
        padding-top: 60px;
        padding-bottom: 80px;
    }

    #faq .section-title h2,
    .faq-section .section-title h2 {
        font-size: 2.2rem;
    }
    
    #faq .section-title p,
    .faq-section .section-title p {
        font-size: 1rem;
        padding: 0 20px;
    }

    .faq-question {
        padding: 24px 26px;
        font-size: 1.05rem;
    }
    
    .faq-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .faq-answer {
        padding-left: 26px;
        padding-right: 26px;
    }
    
    .faq-answer[aria-hidden="false"] {
        padding-bottom: 26px;
    }

    .answer-content {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .faq-container {
        padding: 0 16px;
    }

    .faq-item {
        margin-bottom: 20px;
        border-radius: 16px;
    }
    
    .faq-question {
        font-size: 1rem;
        padding: 22px 24px;
    }
    
    .faq-question span {
        padding-right: 16px; 
    }
    
    .faq-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .faq-answer {
        padding-left: 24px;
        padding-right: 24px;
    }
    
    .faq-answer[aria-hidden="false"] {
        padding-bottom: 24px;
    }

    .answer-content {
        font-size: 0.9rem;
        line-height: 1.65;
    }
}

/* Animación de entrada para elementos */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    animation: fadeInUp 0.6s ease-out;
}

/* Mejora para el scroll cuando se hace clic en enlaces internos */
html {
    scroll-behavior: smooth;
}
