/* --- Hoe werkt de scan - Refined Timeline + Animations --- */

.page-content {
    padding: 80px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    margin-bottom: 100px;
    position: relative;
}

.hero h1 {
    font-size: 3rem;
    color: #1a2b4e;
    margin-bottom: 25px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.35rem;
    color: #4a5568;
    max-width: 700px;
    margin: 0 auto;
    font-weight: 300;
    line-height: 1.6;
}

/* Timeline Container */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Vertical Line - Continuous and subtle */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 29px;
    /* Centered with 60px bubble (30 - 1px) */
    width: 2px;
    background: linear-gradient(to bottom, #d6bcfa00, #cbd5e0, #cbd5e0, #d6bcfa00);
    /* Fade in/out at ends */
    z-index: 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 120px;
    /* Increased gap for better scroll play */
    padding-left: 100px;
    /* Space for the bubble */

    /* Scroll Reveal */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* Number Bubble - Cleaner, Larger */
.step-number {
    position: absolute;
    left: 0;
    top: 0;
    /* Align with top of title */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    /* White background to hide line behind */
    border: 3px solid #cbd5e0;
    /* Default inactive border */
    color: #cbd5e0;
    /* Default inactive number color */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    z-index: 1;
    transition: all 0.3s ease;
}

/* Active State (Applied by JS via .active class on parent) */
.timeline-item.active .step-number {
    /* When active, the marker covers it, so this changes for fallback/support */
    border-color: transparent;
    color: #fff;
    background: transparent;
    z-index: 3;
    /* Bring text above marker */
}

/* Traveling Marker */
.timeline-marker {
    position: absolute;
    left: 0;
    /* Align with .step-number left */
    top: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #667eea;
    /* Active Theme Color */
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    /* Glow */
    z-index: 2;
    /* Between number text (3) and line (0) */
    pointer-events: none;
    /* Let clicks pass through */
    /* Separate transitions: Top takes long (travel), Transform takes short (pop) */
    transition: top 1.2s cubic-bezier(0.45, 0, 0.55, 1),
        transform 0.3s ease-out;
}

/* Squished marker for traveling on line */
.timeline-marker.traveling {
    transform: scale(0.2);
    /* Shrink faster/smaller */
    box-shadow: none;

    /* CRITICAL: Must repeat TOP transition so it isn't overwritten! 
       Only change the TRANSFORM transition to be fast (shrink) */
    transition: top 1.2s cubic-bezier(0.45, 0, 0.55, 1),
        transform 0.2s ease-in;
}

/* Ensure active item sits ABOVE the marker so the number is visible.
   We must set z-index on the PARENT to escape the stacking context relative to the marker */
.timeline-item.active {
    z-index: 5;
    /* Higher than marker's 2 */
}

.timeline-item.active .step-number {
    /* When active, the marker covers it, so this changes for fallback/support */
    border-color: transparent;
    color: #fff;
    background: transparent;
    /* Wait for marker to arrive before removing background */
    transition-delay: 1.0s;
}

/* Content - No Box */
.step-content {
    background: transparent;
    padding: 0;
}

.step-content h2 {
    font-size: 1.75rem;
    color: #2d3748;
    margin-bottom: 12px;
    margin-top: 10px;
    /* Optical alignment with bubble */
    font-weight: 700;
}

.step-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4a5568;
    margin-bottom: 0;
}

/* Chart Container */
.chart-container-wrapper {
    margin-top: 30px;
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    /* Nice floaty shadow */
    border: 1px solid rgba(0, 0, 0, 0.03);
    max-width: 600px;
    /* Don't let chart get too massive */
}

.chart-legend-custom {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #718096;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline {
        padding-top: 20px;
    }

    .timeline-item {
        padding-left: 70px;
        margin-bottom: 60px;
    }

    .step-number {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
        border-width: 2px;
    }

    .timeline-marker {
        width: 42px;
        height: 42px;
    }

    .step-content h2 {
        font-size: 1.4rem;
        margin-top: 5px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }
}