/* ======================================
   TESTIMONIOS.CSS - ESTILOS ESPECÍFICOS DE LA PÁGINA
   ====================================== */

/* ======================================
   BACKGROUND IMAGES - ESPECÍFICO DE TESTIMONIOS
   ====================================== */

/* Fondo principal con montañas para las primeras secciones */
.first-background {
    background-image: url('/media/images/testimonios/thomas-griesbeck-Y2aNc1X7xLg-unsplash.jpg');
    background-repeat: repeat !important;
    background-size: auto !important;
    background-attachment: fixed;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
}

/* Hero section background - ESPECÍFICO DE TESTIMONIOS */
.hero {
    background-image: url('/media/images/testimonios/ben-lowe-sqdY_rJg8wg-unsplash.jpg');
}

/* CTA section background - ESPECÍFICO DE TESTIMONIOS */
.cta {
    background: linear-gradient(rgba(var(--black-rgb), 0.6), rgba(var(--black-rgb), 0.6)),
        url('/media/images/cta/joshua-sortino-CTVGEm6V8qI-unsplash.jpg') center/cover;
}

/* ======================================
   LAYOUT ESPECÍFICO DE TESTIMONIOS
   ====================================== */

/* Secciones con efecto glassmorphism */

/* SISTEMA BASE UNIFICADO GLASSMORPHISM */
.testimonios-glass-section {
    background: rgba(var(--white-rgb), 0.4);
    backdrop-filter: blur(var(--blur-strong));
    border: 1px solid rgba(var(--white-rgb), 0.6);
    margin-left: var(--section-margin-horizontal);
    margin-right: var(--section-margin-horizontal);
    margin-bottom: var(--section-margin-bottom);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    position: relative;
    z-index: 2;
    transition: var(--transition-standard);
}

.testimonios-glass-section:hover {
    background: rgba(var(--white-rgb), 0.5);
    transform: var(--hover-lift-medium);
    box-shadow: var(--shadow-heavy);
}

.testimonios-glass-section--first {
    margin-top: var(--section-margin-bottom);
}

/* ======================================
   CONTROLES DE TESTIMONIOS
   ====================================== */

.testimonios-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--margin-bottom-large);
    padding: var(--card-padding);
    background: rgba(var(--white-rgb), 0.8);
    border-radius: var(--border-radius-standard);
    box-shadow: var(--shadow-light);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: var(--border-radius-badge);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-standard);
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: var(--hover-lift-button);
    box-shadow: var(--shadow-light);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--primary);
    border-radius: var(--border-radius-badge);
    background: var(--white);
    color: var(--primary-dark);
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    min-width: 200px;
    transition: var(--transition-standard);
}

.sort-select:hover,
.sort-select:focus {
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-light);
    outline: none;
}

/* ======================================
   ESTADOS DE CARGA Y ERROR
   ====================================== */

.testimonios-loading,
.testimonios-error {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(var(--white-rgb), 0.9);
    border-radius: var(--border-radius-standard);
    box-shadow: var(--shadow-light);
    margin: 2rem 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes goldGlow {
    0% {
        box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.4);
    }

    100% {
        box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.7);
    }
}

.error-message {
    max-width: 400px;
    margin: 0 auto;
}

.error-message h3 {
    color: var(--accent-red);
    margin-bottom: var(--margin-bottom-small);
}

.error-message p {
    color: var(--black);
    margin-bottom: var(--margin-bottom-standard);
}

/* ======================================
   CARDS DE TESTIMONIOS
   ====================================== */

.testimonial-card {
    background: var(--white);
    border-radius: var(--border-radius-large);
    padding: var(--card-padding);
    box-shadow: var(--shadow-light);
    transition: var(--transition-standard);
    position: relative;
    overflow: hidden;

    /* Layout horizontal por defecto (desktop) */
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: start;
    min-height: auto;
}

.testimonial-card:hover {
    transform: var(--hover-lift-medium);
    box-shadow: var(--shadow-heavy);
}

/* Card especial para máximos nacionales */
.testimonial-card.featured {
    background: linear-gradient(135deg, var(--black), var(--gray-900));
    color: var(--accent);
    border: 2px solid var(--accent);
    box-shadow: var(--shadow-accent);
}

.testimonial-card.featured:hover {
    transform: var(--hover-lift-medium);
    box-shadow: var(--shadow-accent-strong);
}

.testimonial-card.featured .student-name {
    color: var(--accent);
    text-shadow: 0 2px 4px rgba(var(--black-rgb), 0.5);
}

.testimonial-card.featured .student-info,
.testimonial-card.featured .student-university {
    color: var(--gray-200);
}

.testimonial-card.featured .testimonial-text {
    color: var(--gray-200);
}

.testimonial-card.featured .metadata-year {
    color: var(--accent);
    font-weight: 600;
    background: rgba(var(--accent-rgb), 0.15);
}

.testimonial-card.featured .metadata-year .material-symbols-rounded {
    color: var(--accent);
}

.testimonial-card.featured .student-photo {
    border: 3px solid var(--accent);
    box-shadow: 0 4px 16px rgba(var(--accent-dark-rgb), 0.3);
}

/* Badge superior */
.testimonial-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-medium);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    /* Asegurar que esté por encima */
}

/* Margen para badges en desktop */
.testimonial-card:has(.testimonial-badge) .testimonial-content {
    margin-top: 3.5rem;
}

.testimonial-card.has-badge .testimonial-content {
    margin-top: 3.5rem;
}

.testimonial-spacer {
    display: none;
}

.badge-featured {
    background: linear-gradient(135deg, var(--accent), var(--accent-orange));
    color: var(--black);
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: goldGlow 2s ease-in-out infinite alternate;
}

.badge-featured .trophy-icon {
    color: var(--black);
    font-size: 1.4rem;
    font-weight: 700;
}

.badge-reciente {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
}

/* Header del testimonio */
.testimonial-header {
    margin-bottom: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: auto;
}

.student-photo {
    width: 160px;
    height: 160px;
    border-radius: var(--border-radius-circle);
    object-fit: cover;
    margin: 0 auto 1.5rem auto;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    font-family: var(--font-body);
    background: var(--primary);
    /* Fallback */
}

/* Avatares con iniciales - gradientes aleatorios usando colores light */
.student-photo.avatar-1 {
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
}

.student-photo.avatar-2 {
    background: linear-gradient(135deg, var(--accent-light), var(--accent-green-light));
}

.student-photo.avatar-3 {
    background: linear-gradient(135deg, var(--accent-green-light), var(--primary-light));
}

.student-photo.avatar-4 {
    background: linear-gradient(135deg, var(--accent-orange-light), var(--accent-light));
}

.student-photo.avatar-5 {
    background: linear-gradient(135deg, var(--primary-light), var(--accent-orange-light));
}

.student-photo.avatar-6 {
    background: linear-gradient(135deg, var(--accent-red-light), var(--accent-light));
}

.student-photo.avatar-7 {
    background: linear-gradient(135deg, var(--accent-green-light), var(--accent-red-light));
}

.student-photo.avatar-8 {
    background: linear-gradient(135deg, var(--accent-light), var(--primary-light));
}

/* Cuando hay imagen, resetear los estilos de avatar */
.student-photo img {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-circle);
    object-fit: cover;
}

.student-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.student-info {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.student-university {
    font-size: 1rem;
    color: var(--black);
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

/* Metadatos en el header para layout horizontal */
.header-metadata {
    width: 100%;
    margin-top: 0;
}

.header-metadata .metadata-scores {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: var(--margin-bottom-small);
}

.header-metadata .metadata-year {
    align-self: center;
    font-size: 1.1rem;
    font-weight: 600;
    background: rgba(var(--primary-rgb), 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-medium);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.metadata-year .material-symbols-rounded {
    font-size: 1.2rem;
    line-height: 1;
}

/* Contenido del testimonio */
.testimonial-content {
    margin-bottom: 0;
    width: 100%;
    display: flex;
    align-items: stretch;
    height: auto;
}

.testimonial-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--black);
    text-align: left;
    position: relative;
    padding: var(--card-padding-medium);
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: var(--border-radius-standard);
    border-left: 4px solid var(--primary);
    height: auto;
    width: 100%;
    display: block;
    min-height: auto;
    align-self: stretch;
}

/* Franja dorada para máximos nacionales */
.testimonial-card.featured .testimonial-text {
    border-left: 4px solid var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.testimonial-text::before {
    content: '"';
    font-family: var(--font-title);
    font-size: 3rem;
    color: var(--primary);
    position: absolute;
    top: -0.5rem;
    left: 0.5rem;
    opacity: 0.3;
    line-height: 1;
}

/* Metadatos del testimonio - ocultos por defecto en desktop */
.testimonial-metadata {
    display: none;
}

.metadata-scores {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(var(--accent-rgb), 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius-standard);
    font-size: 0.9rem;
    font-weight: 600;
}

.score-icon {
    color: var(--primary);
    font-size: 1rem;
}

/* Estilos especiales para scores en cards de máximos nacionales */
.testimonial-card.featured .score-item {
    background: rgba(var(--accent-rgb), 0.2);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    color: var(--accent);
}

.testimonial-card.featured .score-icon {
    color: var(--accent);
}

.metadata-year {
    color: var(--black);
    font-size: 0.9rem;
    opacity: 0.7;
    font-weight: 500;
}

/* ======================================
   RESPONSIVE - TESTIMONIAL CARDS
   ====================================== */

/* Tablet - 82rem (1312px) */
@media (max-width: 82rem) {
    .testimonial-card {
        /* Mantener layout horizontal en tablet */
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
    }

    .student-photo {
        width: 140px;
        height: 140px;
        font-size: 2.5rem;
    }

    .badge-featured {
        font-size: 0.9rem;
    }

    .badge-featured .trophy-icon {
        font-size: 1.2rem;
    }
}

/* Mobile - 53rem (848px) */
@media (max-width: 53rem) {
    /* LAYOUT VERTICAL en mobile */
    .testimonial-card {
        grid-template-columns: 1fr !important;
        gap: 0;
        padding: 1.5rem;
    }

    /* Header ocupa todo el ancho */
    .testimonial-header {
        margin-bottom: 1.5rem;
        width: 100%;
    }

    .student-photo {
        width: 120px;
        height: 120px;
        margin-bottom: 1rem;
        font-size: 2rem;
    }

    .student-name {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .student-info {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .student-university {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    /* Metadatos en el header */
    .header-metadata {
        margin-top: 0.5rem;
    }

    .header-metadata .metadata-scores {
        gap: 0.5rem;
    }

    .score-item {
        font-size: 0.85rem;
        padding: 0.35rem 0.7rem;
    }

    .header-metadata .metadata-year {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
        margin-top: 0.5rem;
    }

    /* Contenido debajo de todo */
    .testimonial-content {
        width: 100%;
        margin-top: 0;
    }

    /* Badge ajustado para mobile */
    .testimonial-badge {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }

    .badge-featured {
        font-size: 0.75rem;
        gap: 0.3rem;
    }

    .badge-featured .trophy-icon {
        font-size: 1rem;
    }

    /* Remover margen extra para badges en mobile */
    .testimonial-card.has-badge .testimonial-content,
    .testimonial-card:has(.testimonial-badge) .testimonial-content {
        margin-top: 0;
    }

    /* Texto del testimonio */
    .testimonial-text {
        font-size: 0.95rem;
        padding: 1rem;
    }

    .testimonial-text::before {
        font-size: 2.5rem;
        top: -0.3rem;
        left: 0.3rem;
    }
}