/* =========================================
   VARIABLES Y ESTILOS GLOBALES
   ========================================= */
:root {
    --color-primary: #0B1726; /* Azul/Gris oscuro */
    --color-accent: #31cadc;  /* Cian */
    --color-text: #444;       /* Gris oscuro */
    --color-text-muted: #6c757d; /* Gris sutil */
    --color-background-light: #f8f9fa; /* Fondo general */
    --border-radius-card: 8px;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.1);
    
    /* Variables locales para Timeline */
    --tl-accent: #31cadc;
    --tl-primary: #0B1726;
    --tl-gray: #e9ecef;
    --tl-text: #555;
}

body {
    background-color: var(--color-background-light);
    font-family: Arial, sans-serif;
    color: var(--color-text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.container-narrow {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.section-padding {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5em;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 40px;
}

/* =========================================
   1. SECCIÓN HERO (MENSAJE PRINCIPAL)
   ========================================= */
.team-hero {
    background-image: linear-gradient(rgba(11, 23, 38, 0.8), rgba(11, 23, 38, 0.8)),
        url('../img/banner.jpg');
    background-color: var(--color-primary);
    background-size: cover;
    background-position: center 25%;
    background-repeat: no-repeat;
    padding: 60px 0;
    text-align: center;
}

.team-message {
    font-size: 2.2em;
    font-weight: 700;
    color: white;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.3;
}

/* =========================================
   2. SECCIÓN PARTICIPANTES (FLIP CARDS COMPACTAS)
   ========================================= */
.team-participants-section {
    padding: 20px 0 60px 0;
}

/* Grid Flexible y Centrado */
.participants-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

/* --- CONTENEDOR PRINCIPAL (ESCENA 3D) --- */
.participant-card {
    width: 320px;
    height: 440px; /* Altura ajustada para modo compacto */
    background-color: transparent;
    perspective: 1000px;
    margin-bottom: 20px;
    padding-bottom: 0;
    box-shadow: none;
    border-radius: 0;
}

/* --- CONTENEDOR INTERNO QUE GIRA --- */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    box-shadow: var(--shadow-light);
    border-radius: var(--border-radius-card);
}

.participant-card:hover .card-inner {
    transform: rotateY(180deg);
}

/* --- CARAS DE LA CARTA (FRENTE Y ATRÁS) --- */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--border-radius-card);
    overflow: hidden;
    background-color: white;
}

/* --- ESTILOS DEL FRENTE --- */
.card-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
}

.participant-img-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 3px solid #fff;
}

.participant-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.participant-info {
    padding: 20px;
    width: 100%;
}

.participant-name {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.participant-role {
    font-size: 0.95em;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin-bottom: 20px;
    min-height: 3em;
}

.read-more-btn {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
    display: inline-block;
}

/* --- ESTILOS DE ATRÁS (MODO COMPACTO) --- */
.card-back {
    background-color: var(--color-primary);
    color: white;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Alineación arriba */
    padding: 20px 15px; /* Padding reducido */
}

.card-back-content {
    text-align: left;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* Scroll si es necesario */
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

/* Scrollbar Webkit */
.card-back-content::-webkit-scrollbar {
    width: 4px;
}
.card-back-content::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.card-back h4 {
    font-size: 1rem; /* Título más pequeño */
    margin-bottom: 2px;
    color: var(--color-accent);
    line-height: 1.2;
    font-weight: 700;
}

.role-subtitle {
    font-size: 0.75rem; /* Subtítulo compacto */
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 5px;
}

.bio-text {
    font-size: 0.8rem; /* Texto biografía compacto */
    line-height: 1.35;
    margin-bottom: 10px;
    opacity: 0.95;
    color: #f0f0f0;
}

/* =========================================
   3. MENSAJE CIENCIA
   ========================================= */
.science-message {
    background-color: var(--color-primary);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.science-message h2 {
    font-size: 2rem;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.4;
}

/* =========================================
   4. TIMELINE "PREMIUM"
   ========================================= */
.history-timeline-section {
    position: relative;
    padding: 60px 0;
    background-color: #fff;
}

.timeline-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 1000px;
    margin: 60px auto 0;
    padding: 0 20px;
}

/* Línea conectora horizontal */
.timeline-container::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 40px;
    right: 40px;
    height: 4px;
    background: var(--tl-gray);
    z-index: 0;
    border-radius: 4px;
}

.timeline-item {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}

.timeline-icon-circle {
    width: 60px;
    height: 60px;
    background-color: #fff;
    border: 3px solid var(--tl-accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--tl-primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.timeline-icon-circle:hover {
    background-color: var(--tl-accent);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(49, 202, 220, 0.2);
}

.timeline-year {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--tl-primary);
    margin-bottom: 5px;
    opacity: 0.9;
}

.timeline-description {
    font-size: 1rem;
    color: var(--tl-text);
    font-weight: 500;
    padding: 0 10px;
}

/* Popup Timeline */
.timeline-image-popup {
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 260px;
    background: #fff;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--tl-gray);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
}

.timeline-image-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.timeline-image-popup img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.timeline-icon-circle:hover .timeline-image-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* =========================================
   5. PROPÓSITO, VISIÓN Y MISIÓN (PVM)
   ========================================= */
.pvm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.pvm-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-top: 5px solid var(--color-primary);
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pvm-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.pvm-icon-wrapper {
    width: 70px;
    height: 70px;
    background-color: #edf2f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    transition: background-color 0.3s ease;
}

.pvm-card:hover .pvm-icon-wrapper {
    background-color: var(--color-primary);
}

.pvm-icon-wrapper i {
    font-size: 1.8rem;
    color: var(--color-primary);
    transition: color 0.3s ease;
}

.pvm-card:hover .pvm-icon-wrapper i {
    color: white;
}

.pvm-card h3 {
    color: var(--color-primary);
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 700;
}

.pvm-card p {
    color: var(--color-text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* =========================================
   6. VALORES
   ========================================= */
.values-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

.value-item {
    background: var(--color-background-light);
    padding: 30px 20px;
    border-radius: 15px;
    font-weight: bold;
    color: var(--color-text);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 160px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.value-item i {
    font-size: 2rem;
    color: var(--color-primary);
}

/* =========================================
   7. PARTNERS (CONFIANZA)
   ========================================= */
.partners-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.partners-grid img {
    flex: 0 1 200px;
    height: 100px;
    object-fit: contain;
    filter: none;
    transition: transform 0.3s ease;
}

.partners-grid img:hover {
    transform: scale(1.1);
}

/* =========================================
   8. IMPACTO, CULTURA Y SOSTENIBILIDAD
   ========================================= */
.impact-section {
    background-color: var(--color-primary);
    color: white;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
    margin-top: 40px;
}

.impact-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-accent);
    display: block;
}

.culture-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.culture-images img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

/* Sostenibilidad Grid */
.sustain-grid {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.sustain-card {
    flex: 1;
    max-width: 350px;
    min-width: 280px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.sustain-icon {
    font-size: 4.5rem;
    color: var(--color-primary);
    margin-bottom: 25px;
}

.sustain-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 15px;
}

/* =========================================
   9. CTA & CAROUSEL
   ========================================= */
.cta-section {
    background: var(--color-background-light);
}

.carousel-placeholder {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}

.carousel-placeholder img {
    scroll-snap-align: center;
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.btn-outline {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

/* =========================================
   10. RESPONSIVE GENERAL
   ========================================= */
@media (max-width: 992px) {
    .team-message {
        font-size: 1.8em;
    }
}

@media (max-width: 768px) {
    /* Responsive Participants */
    .participant-card {
        width: 100%;
        max-width: 350px;
    }

    .team-hero {
        padding: 50px 0;
    }

    .section-title {
        font-size: 2em;
    }

    /* Responsive Timeline */
    .timeline-container {
        flex-direction: column;
        padding-left: 50px;
    }
    .timeline-container::before {
        top: 0;
        bottom: 0;
        left: 28px;
        right: auto;
        width: 4px;
        height: 100%;
    }
    .timeline-item {
        display: flex;
        align-items: center;
        text-align: left;
        margin-bottom: 40px;
    }
    .timeline-icon-circle {
        margin: 0 20px 0 0;
        position: relative;
        left: -50px;
    }
    .timeline-content {
        position: relative;
        left: -40px;
    }
    .timeline-image-popup {
        display: none;
    }

    /* Responsive General */
    .culture-images {
        grid-template-columns: 1fr;
    }
    .sustain-grid {
        gap: 40px;
        flex-direction: column;
        align-items: center;
    }
}