:root 
{
    --primary-dark: #0a192f;
    --gradient-main: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    --light-gray: #f8f9fa;
    --text-main: #1f2937;
    --text-muted: #666666;
    --line-color: #e5e7eb;
}

.ai-timeline-container {
    font-family: 'Inter', sans-serif;
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
    position: relative;
}

/* The Vertical Line: Animates via scaleY */
.ai-timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%) scaleY(0); /* Starts hidden */
    transform-origin: top;
    width: 2px;
    top: 50px; 
    bottom: 50px;
    background-color: var(--line-color);
    z-index: 1;
    transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* State when container is scrolled into view */
.ai-timeline-container.is-visible::before {
    transform: translateX(-50%) scaleY(1);
}

.timeline-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 30px 0;
    z-index: 2;
    cursor: pointer;
    opacity: 0; /* Hidden initially for staggered load */
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Staggered load animation class */
.timeline-row.reveal {
    opacity: 1;
    transform: translateY(0);
}

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

.timeline-side { width: 45%; display: flex; align-items: center; }

.timeline-row:nth-child(odd) .timeline-label-side { justify-content: flex-end; text-align: right; padding-right: 40px; }
.timeline-row:nth-child(even) .timeline-label-side { justify-content: flex-start; text-align: left; padding-left: 40px; }
.timeline-row:nth-child(odd) .timeline-content-side { padding-left: 40px; }
.timeline-row:nth-child(even) .timeline-content-side { padding-right: 40px; }

.timeline-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    transition: all 0.3s ease;
    margin: 0;
    line-height: 1.3;
}

.timeline-row:hover .timeline-label {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-center { width: 60px; display: flex; justify-content: center; flex-shrink: 0; }

.timeline-number {
    width: 50px;
    height: 50px;
    background: #fff;
    border: 2px solid var(--line-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-muted);
    transition: all 0.3s ease;
    box-shadow: 0 0 0 6px #fff; 
}

.timeline-box {
    background: var(--light-gray);
    padding: 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    transition: all 0.4s ease;
    width: 100%;
}

/* Hover Effects */
.timeline-row:hover .timeline-number {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
    transform: scale(1.1);
}

.timeline-row:hover .timeline-box {
    background: var(--gradient-main);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-timeline-container::before { left: 45px; transform: translateX(0) scaleY(0); }
    .ai-timeline-container.is-visible::before { transform: scaleY(1); }
    .timeline-row, .timeline-row:nth-child(even) {
        flex-direction: column !important;
        align-items: flex-start;
        padding-left: 80px;
        padding-bottom: 40px;
    }
    .timeline-side { width: 100%; padding: 0 !important; text-align: left !important; justify-content: flex-start !important; }
    .timeline-center { position: absolute; left: -5px; top: 30px; }
    .timeline-label { margin-bottom: 10px; }
}