/* =================================
   EXPERIENCE SECTION: VERTICAL TREE TIMELINE (SPECTACULAR DESIGN)
   ================================= */

/* 1. RESETEAR CONTENEDOR */
#experiencia .services-track-container {
    width: 100%;
    overflow: visible !important;
    padding: 2rem 1rem;
    display: flex;
    position: relative;
    z-index: 10;
}

#experiencia .carousel-btn { display: none !important; }

/* 2. TRACK PRINCIPAL */
.experience-track {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    gap: 3rem;
    overflow: visible !important;
}

/* LÍNEA CENTRAL (Eje Principal) */
.experience-track::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(-50%);
    z-index: 0;
    border-radius: 4px;
}

/* Línea de Progreso (Decorativa) */
.experience-track::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: linear-gradient(to bottom, 
        var(--accent) 0%, 
        #ff00ff 50%, 
        var(--accent) 100%
    );
    transform: translateX(-50%);
    z-index: 0;
    opacity: 0.3;
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.3);
    border-radius: 4px;
}

/* 3. TARJETAS (Las Ramas) */
.timeline-card {
    position: relative;
    width: 45%;
    /* Fondo adaptativo al tema (Glassy) */
    background: linear-gradient(145deg, var(--bg-card), rgba(255, 255, 255, 0.02));
    border: 2px solid var(--border); /* Borde Base 2px */
    border-radius: 1.5rem;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    z-index: 1;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    
    /* Estado inicial para animación */
    opacity: 0; 
    transform: translateY(50px);
}

/* CLASE VISIBLE (Restaurada) */
.timeline-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ALTERNANCIA (Izquierda / Derecha) */
.timeline-card:nth-child(odd) {
    align-self: flex-start;
    text-align: right;
    margin-right: 55%;
}

.timeline-card:nth-child(even) {
    align-self: flex-end;
    text-align: left;
    margin-left: 55%;
}

/* Ajuste interno impares */
.timeline-card:nth-child(odd) .exp-header { align-items: flex-end; }
.timeline-card:nth-child(odd) .exp-date { align-self: flex-end; }
.timeline-card:nth-child(odd) .exp-details li {
    padding-left: 0; padding-right: 1.5rem; text-align: right;
}
.timeline-card:nth-child(odd) .exp-details li::before { left: auto; right: 0; }

/* 4. CONECTORES Y PUNTOS (Restaurados) */

/* PUNTOS CENTRALES */
.timeline-card::before {
    content: '';
    position: absolute;
    top: 3rem;
    width: 20px;
    height: 20px;
    background: var(--bg-main);
    border: 3px solid var(--accent);
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 0 0 5px rgba(0, 102, 255, 0.1);
    transition: all 0.4s ease;
}

/* RAMAS */
.timeline-card::after {
    content: '';
    position: absolute;
    top: 3.5rem;
    height: 2px;
    background: var(--accent);
    opacity: 0.3;
    transition: all 0.4s ease;
    z-index: 0;
}

/* Posicionamiento Desktop */
/* Impares (Izquierda) -> Conecta a la Derecha */
.timeline-card:nth-child(odd)::before {
    right: -11.1%;
    right: calc(-11.1% - 13px);
}
.timeline-card:nth-child(odd)::after {
    right: 0;
    width: 11.1%;
    background: linear-gradient(to left, var(--accent), transparent);
}

/* Pares (Derecha) -> Conecta a la Izquierda */
.timeline-card:nth-child(even)::before {
    left: -11.1%;
    left: calc(-11.1% - 13px);
}
.timeline-card:nth-child(even)::after {
    left: 0;
    width: 11.1%;
    background: linear-gradient(to right, var(--accent), transparent);
}

/* HOVER EFFECTS (ESPECTACULAR - MÁS LUZ) */
.timeline-card:hover {
    transform: translateY(-10px) scale(1.03);
    border: 3px solid var(--accent);
    
    /* EXPLOSIÓN DE LUZ */
    box-shadow: 
        0 0 30px rgba(0, 102, 255, 0.6),
        0 0 60px rgba(255, 0, 255, 0.4),
        inset 0 0 20px rgba(0, 102, 255, 0.2);
        
    /* Fondo Hover también adaptativo */
    background: linear-gradient(145deg, var(--bg-card), rgba(255, 255, 255, 0.1));
    z-index: 10;
}

/* Rama se ilumina */
.timeline-card:hover::after {
    opacity: 1;
    height: 4px;
    box-shadow: 0 0 15px var(--accent);
    background: var(--accent);
}

/* Punto central explota */
.timeline-card:hover::before {
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent), 0 0 40px var(--accent);
    transform: scale(1.2);
}

/* ESTILOS INTERNOS */
.exp-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exp-date {
    align-self: flex-start;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: linear-gradient(135deg, #ff00ff, #ff0080);
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    box-shadow: 0 4px 15px rgba(255, 0, 255, 0.3);
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.exp-role {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.exp-company {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.exp-details {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.exp-details li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.exp-details li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 1.2rem;
}

/* =================================
   RESPONSIVE: TABLET Y MÓVIL (< 1024px)
   ================================= */
@media (max-width: 1024px) {
    /* EJE A LA IZQUIERDA (Más pegado al borde para dar espacio) */
    .experience-track::before,
    .experience-track::after {
        left: 1rem; /* Reducido de 2rem a 1rem */
        transform: none;
    }

    .timeline-card {
        /* Ancho optimizado: 100% - espacio izquierda - padding derecha */
        width: calc(100% - 3.5rem); 
        margin: 0 0 0 3.5rem !important; /* Margen reducido de 5rem a 3.5rem */
        text-align: left !important;
        align-self: flex-start !important;
        padding: 1.2rem; /* Padding interno un poco más compacto en móvil */
    }

    /* Resetear alternancia */
    .timeline-card:nth-child(odd) .exp-header { align-items: flex-start; }
    .timeline-card:nth-child(odd) .exp-date { align-self: flex-start; }
    .timeline-card:nth-child(odd) .exp-details li {
        padding-left: 1.2rem; padding-right: 0; text-align: left;
    }
    .timeline-card:nth-child(odd) .exp-details li::before { left: 0; right: auto; }

    /* Ajustar Puntos (Alineados al nuevo eje) */
    .timeline-card::before {
        left: -2.9rem !important; /* Ajustado para eje en 1rem */
        right: auto !important;
        top: 2rem; /* Un poco más arriba */
    }

    /* Ajustar Ramas (Más cortas) */
    .timeline-card::after {
        left: -2.5rem !important;
        right: auto !important;
        width: 2.5rem !important;
        background: linear-gradient(to right, var(--accent), transparent) !important;
    }
}
