/* ===================================
   About Us - Timeline Component
   Modern vertical timeline for company history
   ================================ */

/* ===================================
   Timeline Container
   ================================ */

.timeline-container {
    position: relative;
    padding: 40px 0;
    margin: 0 auto;
    max-width: 1000px;
    overflow: visible;
    isolation: isolate; /* Crear un nuevo contexto de apilamiento */
}

/* ===================================
   Timeline Vertical Line
   ================================ */

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #183544 0%, #e1c126 100%);
    transform: translateX(-50%);
    z-index: 0; /* Detrás de todo lo demás */
}

/* ===================================
   Timeline Item
   ================================ */

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    display: flex;
    align-items: flex-start;
    opacity: 0;
    animation: fadeInTimeline 0.6s ease-out forwards;
}

/* Stagger animation delays - contar desde el segundo hijo porque timeline-line es el primero */
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.4s; }
.timeline-item:nth-child(4) { animation-delay: 0.6s; }

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

/* ===================================
   Timeline Content Alternating Layout
   Ajustar nth-child porque timeline-line es el primer hijo
   ================================ */

.timeline-item:nth-child(even) {
    flex-direction: row;
}

.timeline-item:nth-child(odd):not(:first-child) {
    flex-direction: row-reverse;
}

/* ===================================
   Timeline Content Box
   ================================ */

.timeline-content {
    width: 45%;
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(24, 53, 68, 0.1);
    border: 2px solid #e7ecf1;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1; /* Asegurar que esté por encima de la línea */
}

.timeline-content:hover {
    box-shadow: 0 8px 24px rgba(24, 53, 68, 0.16);
    border-color: #e1c126;
    transform: translateY(-3px);
}

/* ===================================
   Timeline Year/Date Badge
   ================================ */

.timeline-year {
    width: 10%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    color: #183544;
    font-family: Montserrat, sans-serif;
    text-align: center;
    z-index: 2;
}

/* ===================================
   Timeline Icon (Center Dot)
   ================================ */

.timeline-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #183544 0%, #2a5166 100%);
    border: 5px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(24, 53, 68, 0.25);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-icon i {
    color: white;
    font-size: 28px;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-icon {
    background: linear-gradient(135deg, #e1c126 0%, #f0d04f 100%);
    transform: scale(1.15) rotate(360deg);
}

.timeline-item:hover .timeline-icon i {
    color: #183544;
}

/* ===================================
   Timeline Content Typography
   ================================ */

.timeline-content h4 {
    color: #183544;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: Montserrat, sans-serif;
}

.timeline-content .timeline-subtitle {
    color: #e1c126;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: block;
}

.timeline-content p {
    color: #54565a;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0;
}

/* Arrow pointing to center line - ajustado para timeline-line como primer hijo */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 30px;
    width: 0;
    height: 0;
    border-style: solid;
}

.timeline-item:nth-child(even) .timeline-content::before {
    right: -15px;
    border-width: 15px 0 15px 15px;
    border-color: transparent transparent transparent #e7ecf1;
}

.timeline-item:nth-child(odd):not(:first-child) .timeline-content::before {
    left: -15px;
    border-width: 15px 15px 15px 0;
    border-color: transparent #e7ecf1 transparent transparent;
}

/* ===================================
   Responsive Design
   ================================ */

@media (max-width: 992px) {
    .timeline-line {
        left: 40px;
    }
    
    .timeline-item {
        flex-direction: row !important;
        padding-left: 0;
    }
    
    .timeline-item:nth-child(even) {
        flex-direction: row !important;
    }
    
    .timeline-year {
        width: 80px;
        font-size: 1.1rem;
        text-align: left;
        padding-right: 10px;
    }
    
    .timeline-content {
        width: calc(100% - 150px);
        margin-left: 0;
    }
    
    .timeline-icon {
        position: absolute;
        left: 5px;
        width: 60px;
        height: 60px;
    }
    
    .timeline-icon i {
        font-size: 24px;
    }
    
    .timeline-content::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .timeline-container {
        padding: 20px 0;
    }
    
    .timeline-line {
        left: 30px;
    }
    
    .timeline-item {
        margin-bottom: 40px;
    }
    
    .timeline-year {
        width: 60px;
        font-size: 1rem;
    }
    
    .timeline-icon {
        left: 0;
        width: 50px;
        height: 50px;
    }
    
    .timeline-icon i {
        font-size: 20px;
    }
    
    .timeline-content {
        width: calc(100% - 90px);
        padding: 20px;
        margin-left: 10px;
    }
    
    .timeline-content h4 {
        font-size: 1.2rem;
    }
    
    .timeline-content p {
        font-size: 0.9rem;
    }
}

/* ===================================
   Timeline Section Header
   ================================ */

.timeline-section-header {
    text-align: center;
    margin-bottom: 50px;
}

.timeline-section-header h2 {
    font-size: 2.2rem;
    color: #183544;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: Montserrat, sans-serif;
}

.timeline-section-header .section-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #183544 0%, #e1c126 100%);
    margin: 0 auto;
    border-radius: 2px;
}
