/* =========================================
   ESTILOS ESPECÍFICOS: TEAM & TRAYECTORIA
   ========================================= */

/* --- HERO EQUIPO --- */
.team-hero {
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: url('https://images.unsplash.com/photo-1505322022379-7c3353ee6291?auto=format&fit=crop&w=1500&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-text) 100%);*/
    color: white;
    padding: 0 10%;
    margin-top: 80px; 
}

.team-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.team-hero h1 span {
    color: var(--accent-color); /* Verde Lima */
}

/* --- TRAYECTORIA (TIMELINE) --- */
.trajectory-section {
    padding: var(--section-spacing) 10%;
    background-color: var(--bg-light);
    overflow: hidden;
}

.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 4rem auto 0;
}

/* Línea central */
.timeline-container::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--secondary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item.left { left: 0; text-align: right; }
.timeline-item.right { left: 50%; text-align: left; }

/* Puntos de la línea */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-light);
    border: 4px solid var(--primary-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item.right::after { left: -10px; }

.timeline-content {
    padding: 20px 30px;
    background-color: white;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-top: 3px solid var(--primary-color);
}

.timeline-content h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

/* --- TEAM GRID --- */
.team-section {
    padding: var(--section-spacing) 5%;
    background-color: var(--bg-off-white);
}

.team-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Open Sans', sans-serif;
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    max-width: 1300px;
    margin: 0 auto;
}

/* TARJETA DE EQUIPO */
.team-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.card-image-wrapper {
    height: 320px;
    overflow: hidden;
    position: relative;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.team-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.member-role {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}

.member-name {
    font-size: 1.4rem;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.member-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-view-profile {
    padding: 10px 20px;
    background-color: var(--bg-off-white);
    color: var(--dark-text);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: center;
}

.btn-view-profile:hover {
    background-color: var(--accent-color);
    color: var(--dark-text);
}

/* --- MODAL CV --- */
.cv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(49, 27, 80, 0.9); /* Dark text color con opacidad */
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.cv-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cv-modal-content {
    background: white;
    width: 100%;
    max-width: 900px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--dark-text);
    cursor: pointer;
    z-index: 10;
}

.modal-body {
    display: flex;
    overflow-y: auto; /* Scroll si es necesario */
}

/* Estructura interna del modal */
.modal-left {
    width: 40%;
    background-color: var(--bg-off-white);
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.modal-right {
    width: 60%;
    padding: 3rem 2rem;
}

.modal-tags span {
    display: inline-block;
    background-color: rgba(0, 155, 193, 0.1);
    color: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

.modal-bio {
    margin: 1.5rem 0;
    line-height: 1.8;
    color: #555;
    text-align: justify;
}

.btn-download-cv {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    transition: background 0.3s;
    margin-top: 1rem;
}

.btn-download-cv:hover {
    background-color: var(--dark-text);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .team-hero h1 { font-size: 2.5rem; }
    
    /* Timeline Vertical en móvil */
    .timeline-container::after { left: 31px; }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item.left, .timeline-item.right { left: 0; text-align: left; }
    
    .timeline-item::after { left: 21px; } /* Punto alineado a la izquierda */
    .timeline-item.right::after { left: 21px; }

    /* Modal Responsive */
    .modal-body { flex-direction: column; }
    .modal-left, .modal-right { width: 100%; padding: 2rem; }
    .modal-photo { width: 150px; height: 150px; }
}