/* ========================================
   Hero Video Background & Scroll Animation
   ======================================== */

/* Ensure hero section is visible */
.hero {
    position: relative !important;
    min-height: 100vh !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/* Ensure hero video background is visible */
.hero-video-bg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important; /* Changed from -1 to 0 */
    overflow: hidden !important;
    background: linear-gradient(135deg, #0066cc 0%, #004c99 100%) !important; /* Fallback */
}

/* Hero video styling - FULL PAGE WIDTH */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    /* Full page width and height */
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    transform: none;
    z-index: 0;
    object-fit: cover; /* Cover entire screen */
    display: block !important;
    /* Slow motion effect */
    animation: slowMotionZoom 30s ease-in-out infinite alternate;
}

/* Slow motion zoom animation - MINIMAL zoom */
@keyframes slowMotionZoom {
    0% {
        transform: scale(1.0);
    }
    100% {
        transform: scale(1.05);
    }
}

/* Video overlay for better text readability */
.video-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(
        135deg,
        rgba(30, 64, 175, 0.3) 0%,
        rgba(15, 23, 42, 0.25) 100%
    ) !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* Hero content should be above video and overlay */
.hero .container {
    position: relative !important;
    z-index: 10 !important;
}

/* Hide equation initially - DISABLED FOR TESTING */
.hero-equation {
    opacity: 1 !important; /* Changed from 0 to 1 - now visible */
    transform: translateY(0) !important; /* Changed from 30px to 0 */
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    color: white !important;
    display: block !important;
    visibility: visible !important;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 2px 10px rgba(0, 0, 0, 0.6) !important;
}

/* Show equation on scroll */
.hero-equation.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animate each part of the equation separately */
.hero-equation.visible {
    animation: equationReveal 1.5s ease-out forwards;
}

@keyframes equationReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        letter-spacing: -2px;
    }
    50% {
        opacity: 0.5;
        transform: translateY(10px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        letter-spacing: normal;
    }
}

/* Make subtitle and buttons initially visible too - FOR TESTING */
.hero-subtitle,
.hero-cta {
    opacity: 1 !important; /* Changed from 0 to 1 */
    transform: translateY(0) !important; /* Changed from 20px to 0 */
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: block !important;
    visibility: visible !important;
}

.hero-subtitle {
    color: white !important;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

.hero-cta {
    display: flex !important;
}

/* Ensure buttons are visible with stronger shadows */
.hero .btn {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.hero .btn:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Reveal subtitle after equation */
.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

/* Reveal buttons after subtitle */
.hero-cta.visible {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

/* Scroll indicator pulse */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20 !important;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) translateY(10px);
        opacity: 0.6;
    }
}

.scroll-indicator i {
    font-size: 2rem;
    color: white !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: block !important;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .hero {
        min-height: 100vh !important;
        height: 100vh !important;
    }
    
    .hero-video {
        /* On mobile, full page width */
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        min-width: 100%;
        min-height: 100%;
        object-fit: cover; /* Cover full screen */
        transform: none;
    }
    
    .hero-equation {
        font-size: 1.3rem !important;
        line-height: 1.3;
        padding: 0 1rem;
    }
    
    @keyframes slowMotionZoom {
        0% {
            transform: scale(1.0);
        }
        100% {
            transform: scale(1.03);
        }
    }
    
    /* Reduce overlay opacity more on mobile for better video visibility */
    .video-overlay {
        background: linear-gradient(
            135deg,
            rgba(30, 64, 175, 0.25) 0%,
            rgba(15, 23, 42, 0.2) 100%
        ) !important;
    }
    
    /* Enhance text shadows on mobile */
    .hero-equation {
        text-shadow: 0 3px 15px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.7) !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8), 0 1px 6px rgba(0, 0, 0, 0.6) !important;
    }
    
    /* Stack buttons vertically on mobile */
    .hero-cta {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 0 1rem;
    }
    
    .hero .btn {
        width: 100% !important;
        max-width: 300px;
        margin: 0 auto !important;
    }
}

/* Ensure video plays smoothly */
.hero-video {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Small mobile devices (iPhone SE, etc.) */
@media (max-width: 480px) {
    .hero {
        min-height: 100vh !important;
        height: 100vh !important;
    }
    
    .hero-video {
        /* Small screens - full page width */
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        min-width: 100%;
        min-height: 100%;
        object-fit: cover;
        transform: none;
    }
    
    .hero-equation {
        font-size: 1.1rem !important;
        line-height: 1.25;
        padding: 0 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
        padding: 0 0.75rem;
    }
    
    .hero-cta {
        padding: 0 0.75rem;
    }
    
    .hero .btn {
        font-size: 0.9rem !important;
        padding: 0.75rem 1.5rem !important;
    }
    
    /* Minimal zoom on very small screens */
    @keyframes slowMotionZoom {
        0% {
            transform: scale(1.0);
        }
        100% {
            transform: scale(1.02);
        }
    }
}

/* Dark theme adjustments */
body.dark-theme .video-overlay {
    background: linear-gradient(
        135deg,
        rgba(30, 64, 175, 0.4) 0%,
        rgba(15, 23, 42, 0.35) 100%
    );
}

/* Light theme adjustments */
body.light-theme .video-overlay {
    background: linear-gradient(
        135deg,
        rgba(30, 64, 175, 0.25) 0%,
        rgba(59, 130, 246, 0.2) 100%
    );
}

/* Performance optimization */
.hero-video-bg {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Pause video when not in viewport (performance) */
.hero-video.paused {
    animation-play-state: paused;
}
