/* How It Works - Modern Vertical Timeline */

.how-it-works-section {
    position: relative;
    background: linear-gradient(180deg, #0a0e1a 0%, #1a2a4a 50%, #0d1525 100%);
    padding: 100px 0 120px;
    overflow: hidden;
}

/* Background decoration */
.how-it-works-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(51, 109, 255, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 80%, rgba(51, 109, 255, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.how-it-works-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    z-index: 2;
}

/* Header */
.how-it-works-header {
    text-align: center;
    margin-bottom: 80px;
}

.how-it-works-subtitle {
    color: #336DFF;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.how-it-works-title {
    color: #ffffff;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease 0.1s;
}

.how-it-works-title span {
    color: #336DFF;
}

/* Animated state */
.how-it-works-section.in-view .how-it-works-subtitle,
.how-it-works-section.in-view .how-it-works-title {
    opacity: 1;
    transform: translateY(0);
}

/* Main Layout - Video + Timeline */
.how-it-works-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

/* Video Side */
.how-it-works-video {
    position: sticky;
    top: 120px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    background: #000;
}

.how-it-works-video video {
    width: 100%;
    height: auto;
    display: block;
}

.how-it-works-video iframe {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
    border: none;
}

/* Timeline Side */
.timeline-container {
    position: relative;
    padding-left: 60px;
}

/* Vertical Line */
.timeline-line {
    position: absolute;
    left: 20px;
    top: 40px;
    bottom: 40px;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-line-progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, #336DFF 0%, #1a4fd6 100%);
    transition: height 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Timeline Step */
.timeline-step {
    position: relative;
    padding-bottom: 60px;
    opacity: 0.3;
    transform: translateX(20px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-step:last-child {
    padding-bottom: 0;
}

.timeline-step.active {
    opacity: 1;
    transform: translateX(0);
}

/* Step Marker */
.timeline-marker {
    position: absolute;
    left: -60px;
    top: 0;
    width: 40px;
    height: 40px;
    background: rgba(51, 109, 255, 0.15);
    border: 2px solid rgba(51, 109, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
}

.timeline-step.active .timeline-marker {
    background: #336DFF;
    border-color: #336DFF;
    box-shadow: 0 0 30px rgba(51, 109, 255, 0.5);
}

.timeline-marker-number {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    font-weight: 700;
    transition: all 0.5s ease;
}

.timeline-step.active .timeline-marker-number {
    color: #ffffff;
}

/* Step Content */
.timeline-content {
    padding-top: 4px;
}

.timeline-label {
    display: inline-block;
    background: rgba(51, 109, 255, 0.1);
    color: #336DFF;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
    transition: all 0.5s ease;
}

.timeline-step.active .timeline-label {
    background: rgba(51, 109, 255, 0.2);
}

.timeline-step-title {
    color: #ffffff;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
    transition: all 0.5s ease;
}

.timeline-step.active .timeline-step-title {
    color: #ffffff;
}

.timeline-step-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    line-height: 1.7;
    margin: 0;
    max-width: 400px;
    transition: all 0.5s ease;
}

.timeline-step.active .timeline-step-text {
    color: rgba(255, 255, 255, 0.85);
}

/* Step Icon */
.timeline-icon {
    position: absolute;
    right: 0;
    top: 0;
    width: 64px;
    height: 64px;
    background: rgba(51, 109, 255, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.5s ease;
}

.timeline-step.active .timeline-icon {
    opacity: 1;
    background: rgba(51, 109, 255, 0.15);
}

.timeline-icon svg {
    width: 28px;
    height: 28px;
    color: #336DFF;
}

/* CTA Button */
.how-it-works-cta {
    text-align: center;
    margin-top: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.how-it-works-section.in-view .how-it-works-cta {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.8s;
}

.how-it-works-cta .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #336DFF;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 18px 40px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.how-it-works-cta .btn-primary:hover {
    background: #1a4fd6;
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(51, 109, 255, 0.4);
}

.how-it-works-cta .btn-primary svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.how-it-works-cta .btn-primary:hover svg {
    transform: translateX(4px);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .how-it-works-content {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .how-it-works-video {
        position: relative;
        top: 0;
        max-width: 600px;
        margin: 0 auto;
    }

    .timeline-container {
        max-width: 600px;
        margin: 0 auto;
    }

    .timeline-icon {
        display: none;
    }
}

@media (max-width: 768px) {
    .how-it-works-section {
        padding: 70px 0 80px;
    }

    .how-it-works-header {
        margin-bottom: 50px;
    }

    .how-it-works-title {
        font-size: 28px;
    }

    .how-it-works-video {
        border-radius: 16px;
    }

    .timeline-container {
        padding-left: 50px;
    }

    .timeline-line {
        left: 16px;
    }

    .timeline-marker {
        left: -50px;
        width: 32px;
        height: 32px;
    }

    .timeline-marker-number {
        font-size: 14px;
    }

    .timeline-step {
        padding-bottom: 40px;
    }

    .timeline-step-title {
        font-size: 22px;
    }

    .timeline-step-text {
        font-size: 15px;
    }

    .how-it-works-cta {
        margin-top: 50px;
    }

    .how-it-works-cta .btn-primary {
        padding: 16px 32px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .how-it-works-section {
        padding: 60px 0 70px;
    }

    .timeline-container {
        padding-left: 44px;
    }

    .timeline-line {
        left: 12px;
    }

    .timeline-marker {
        left: -44px;
        width: 28px;
        height: 28px;
    }

    .timeline-marker-number {
        font-size: 12px;
    }

    .timeline-step-title {
        font-size: 20px;
    }

    .timeline-label {
        font-size: 10px;
        padding: 5px 12px;
    }
}

/* ============================================
   MOBILE FIX: Always show timeline steps
   Don't wait for JS animation on mobile
   ============================================ */
@media (max-width: 768px) {
    .how-it-works-section {
        padding: 60px 20px !important;
    }

    /* Center the container */
    .how-it-works-container {
        padding: 0 16px !important;
        max-width: 100% !important;
    }

    /* Center header */
    .how-it-works-header {
        text-align: center !important;
        margin-bottom: 40px !important;
    }

    /* Hide video on mobile - just show timeline */
    .how-it-works-video {
        display: none !important;
    }

    /* Center timeline container */
    .how-it-works-content {
        display: block !important;
        max-width: 400px !important;
        margin: 0 auto !important;
    }

    .timeline-container {
        padding-left: 50px !important;
        margin: 0 auto !important;
        max-width: 100% !important;
    }

    /* Make all steps fully visible immediately - no animation dependency */
    .timeline-step {
        opacity: 1 !important;
        transform: translateX(0) !important;
        padding-bottom: 32px !important;
    }

    /* Always show markers as active on mobile */
    .timeline-marker {
        background: #336DFF !important;
        border-color: #336DFF !important;
        box-shadow: 0 0 20px rgba(51, 109, 255, 0.4) !important;
    }

    .timeline-marker-number {
        color: #ffffff !important;
    }

    /* Make step content fully visible */
    .timeline-label {
        background: rgba(51, 109, 255, 0.15) !important;
        color: #336DFF !important;
    }

    /* BLUE TEXT for mobile visibility */
    .timeline-step-title,
    .timeline-content h3,
    .timeline-step h3,
    h3.timeline-step-title {
        color: #336DFF !important;
        font-size: 20px !important;
        margin-bottom: 8px !important;
    }

    .timeline-step-text,
    .timeline-content p,
    .timeline-step p,
    p.timeline-step-text {
        color: #1a2a4a !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
        max-width: 100% !important;
    }

    /* Fill progress line fully on mobile */
    .timeline-line-progress {
        height: 100% !important;
    }

    /* Timeline line positioning */
    .timeline-line {
        left: 16px !important;
    }

    /* Ensure header animations don't block content */
    .how-it-works-subtitle {
        opacity: 1 !important;
        transform: translateY(0) !important;
        color: #336DFF !important;
        font-size: 12px !important;
    }

    /* BLUE TEXT for mobile visibility */
    .how-it-works-title {
        opacity: 1 !important;
        transform: translateY(0) !important;
        color: #336DFF !important;
        font-size: 26px !important;
        line-height: 1.3 !important;
    }

    .how-it-works-title span {
        color: #336DFF !important;
    }

    /* CTA button always visible */
    .how-it-works-cta {
        opacity: 1 !important;
        transform: translateY(0) !important;
        margin-top: 40px !important;
    }

    .how-it-works-cta .btn-primary {
        padding: 14px 28px !important;
        font-size: 14px !important;
    }
}
