/* ========================================
   Cinematic Horizontal Scrolling Experience
   ======================================== */

/* Prevent body scroll overflow during engagement */
body.engagement-active {
    overflow: hidden;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Custom font classes for display font */
.font-display {
    font-family: 'Bebas Neue', 'Arial Black', sans-serif;
}

/* Main horizontal scroll container - NO SCROLLING */
.horizontal-scroll-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden; /* Disable all scrolling */
    z-index: 10;
    background: linear-gradient(135deg, rgba(11, 20, 38, 0.98) 0%, rgba(11, 20, 38, 0.95) 100%);
}

/* Content wrapper - flex row of sections */
.horizontal-content {
    display: flex;
    height: 100vh;
    width: 900vw; /* 9 sections × 100vw each - includes 3 API Broker slides */
    will-change: transform;
}

/* Individual sections - exactly one viewport each */
.section-viewport {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Progress indicator fixed at bottom */
.progress-indicator {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    width: 80%;
    max-width: 600px;
}

.progress-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #69BE28 0%, #7FD534 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 8px rgba(105, 190, 40, 0.4);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0.4rem 0.2rem;
    text-align: center;
    flex: 1;
}

.progress-label.active {
    color: #69BE28;
    font-weight: 600;
}

/* API Broker Dot Navigation */
.api-broker-dots {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: none; /* Hidden by default, shown via JS for API sections */
    flex-direction: row;
    gap: 1rem;
    padding: 1rem;
    background: rgba(11, 20, 38, 0.9);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.api-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.api-dot:hover {
    background: rgba(105, 190, 40, 0.5);
    border-color: #69BE28;
    transform: scale(1.2);
}

.api-dot.active {
    background: #69BE28;
    border-color: #69BE28;
    box-shadow: 0 0 10px rgba(105, 190, 40, 0.6);
}

.api-dot-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.api-dot:hover .api-dot-label {
    opacity: 1;
}

/* Exit button */
.exit-button {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(11, 20, 38, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    z-index: 50;
}

.exit-button:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
    color: #dc3545;
    transform: scale(1.1);
}

/* Navigation Instructions - Top Right */
.navigation-instructions {
    position: fixed;
    top: 2rem;
    right: 6rem;
    background: rgba(11, 20, 38, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    backdrop-filter: blur(10px);
    z-index: 50;
    text-align: center;
    min-width: 120px;
}

.navigation-instructions strong {
    color: rgba(255, 255, 255, 0.9);
}

/* Viewport-aware animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Staggered animation delays */
.animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* Entrance animations for different element types */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Section background animations - Green radial highlight */
.section-viewport::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(105, 190, 40, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 2; /* Above video overlay */
}

.section-viewport.active::before {
    opacity: 1;
}


/* Navigation hint indicator */
.scroll-hint {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(11, 20, 38, 0.9);
    padding: 0.75rem 1.25rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    backdrop-filter: blur(10px);
    animation: bounce 2s infinite;
    transition: opacity 0.3s ease;
}

.scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-hint-icon {
    font-size: 1.5rem;
    color: #69BE28;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Mobile responsive optimizations */
@media (max-width: 768px) {
    .horizontal-scroll-container {
        /* Enable vertical scrolling fallback on mobile if needed */
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .horizontal-content {
        flex-direction: column;
        width: 100vw;
        height: 900vh; /* 9 sections × 100vh each */
    }
    
    .section-viewport {
        width: 100vw;
        height: 100vh;
        scroll-snap-align: start;
    }
    
    .progress-indicator {
        bottom: 1rem;
        width: 85%;
    }
    
    .progress-labels {
        display: none; /* Hide labels on mobile to save space */
    }
    
    .exit-button {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .scroll-hint {
        bottom: 4rem;
        font-size: 0.75rem;
        padding: 0.6rem 1rem;
    }
    
    .navigation-instructions {
        top: 1rem;
        right: 4rem;
        padding: 0.5rem 0.75rem;
        min-width: 100px;
        font-size: 0.7rem;
    }
}

/* Responsive viewport utilities for smaller screens */
@media (max-height: 900px) {
    .section-viewport {
        padding: 2vh 3vw; /* Reduced padding */
    }
    
    .viewport-content {
        max-height: 96vh; /* More usable space */
    }
}

@media (max-height: 768px) {
    .progress-indicator {
        bottom: 0.5rem; /* Move progress bar closer to bottom */
    }
    
    .api-broker-dots {
        bottom: 3.5rem; /* Adjust dots position */
    }
    
    .exit-button {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

/* Performance optimizations */
.horizontal-content {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.section-viewport {
    backface-visibility: hidden;
    contain: layout style paint;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .horizontal-scroll-container {
        scroll-behavior: auto;
    }
    
    .animate-on-scroll,
    .fade-in-up,
    .slide-in-left,
    .scale-in {
        transition: none;
        opacity: 1;
        transform: none;
    }
    
    .scroll-hint {
        animation: none;
    }
}