/* Base Styles & Utilities */
:root {
    --primary: #e50914;
    --dark: #0f0f0f;
    --darker: #000000;
}

html {
    scroll-behavior: auto; /* Changed for Lenis */
}

body {
    background-color: var(--darker);
    overflow-x: hidden;
    overscroll-behavior: none;
}

/* Image Optimization */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    transform: translateZ(0); /* GPU acceleration */
    backface-visibility: hidden;
}

.img-fade-in {
    filter: blur(20px);
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.19, 1, 0.22, 1), filter 1.5s cubic-bezier(0.19, 1, 0.22, 1), transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: opacity, filter, transform;
    transform: scale(1.05);
}
.img-fade-in.loaded {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--darker);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin: 4px 0;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(229, 9, 20, 0.6);
    border-radius: 8px;
    box-shadow: inset 0 0 6px rgba(229, 9, 20, 0.8);
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(229, 9, 20, 1);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.9);
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
    will-change: transform;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(229,9,20,0.4); }
    50% { box-shadow: 0 0 30px rgba(229,9,20,0.8); }
}

.animate-pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* Swiper Overrides (Poster Sizes) */
.trending-swiper .swiper-slide {
    width: 150px; /* Mobile default */
}

@media (min-width: 640px) {
    .trending-swiper .swiper-slide { width: 200px; } /* Tablet */
}

@media (min-width: 1024px) {
    .trending-swiper .swiper-slide { width: 240px; } /* Desktop */
}

.trending-swiper .swiper-slide:hover {
    z-index: 10;
}

/* Glassmorphism Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Movie Card Poster Aspect Ratio */
.movie-poster-container {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    transition: box-shadow 0.6s cubic-bezier(0.19, 1, 0.22, 1), border-color 0.6s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    perspective: 1500px;
    transform-style: preserve-3d;
    will-change: transform, box-shadow;
    transform: translateZ(0); /* For GSAP */
}

.movie-poster-container:hover {
    box-shadow: 0 30px 60px rgba(229,9,20,0.4), 0 0 40px rgba(229,9,20,0.2);
    border-color: rgba(229,9,20,0.5);
}

.movie-poster-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1), filter 0.8s;
    will-change: transform;
}

.swiper-slide:hover .movie-poster-container img {
    transform: scale(1.15) translateZ(30px);
}

/* Dynamic Reflection Overlay */
.movie-poster-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.3) 25%, transparent 30%);
    background-size: 200% 200%;
    background-position: 100% 100%;
    opacity: 0;
    transition: opacity 0.5s, background-position 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 20;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.movie-poster-container:hover::after {
    opacity: 1;
    background-position: 0% 0%;
}

/* Overlays */
.card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1), transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    transform: translateY(20px);
    will-change: opacity, transform;
}

.swiper-slide:hover .card-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* Navbar Scrolled State */
.nav-scrolled {
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

/* Featured Banner */
.featured-banner {
    height: 300px;
    will-change: transform, background-position;
}

@media (min-width: 640px) {
    .featured-banner { height: 400px; }
}

@media (min-width: 1024px) {
    .featured-banner { height: 600px; }
}

.featured-gradient {
    background: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0.7) 40%, transparent 100%);
}

.featured-bottom-gradient {
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 30%, transparent 100%);
}

/* Category Hover */
.category-card {
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform, box-shadow;
}
.category-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(229,9,20,0.3);
    border-color: var(--primary);
}

/* Loader Text Glitch/Shine */
.loader-text {
    background: linear-gradient(90deg, #444 0%, #fff 50%, #444 100%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    animation: shine 2s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Cinematic Transitions */
.reveal-text {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

.magnetic-btn {
    display: inline-block;
    will-change: transform;
}

#modal-backdrop {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ═══════════════════════════════════════════════════════ */
/* PREMIUM FOOTER — About 24UA & Cinematic Enhancements  */
/* ═══════════════════════════════════════════════════════ */

/* Ambient Glow Breathing Animation */
@keyframes footer-ambient-breathe {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.footer-ambient-glow {
    animation: footer-ambient-breathe 8s ease-in-out infinite;
    will-change: opacity, transform;
}

/* About Card Glassmorphism */
.footer-about-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.025) 0%, rgba(229,9,20,0.015) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
    will-change: box-shadow;
}

.footer-about-card:hover {
    border-color: rgba(229,9,20,0.15);
    box-shadow: 0 0 40px rgba(229,9,20,0.06), inset 0 0 30px rgba(229,9,20,0.02);
}

/* About Text Subtle Reveal */
.footer-about-text {
    opacity: 0;
    transform: translateY(15px);
    animation: footer-text-reveal 1s ease-out 0.3s forwards;
}

@keyframes footer-text-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer Link Animated Underline */
.footer-link {
    position: relative;
    display: inline-block;
    padding-bottom: 2px;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #e50914, rgba(229,9,20,0.3));
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.footer-link:hover::after {
    width: 100%;
}

/* Glowing Separator Pulse */
@keyframes separator-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.footer-glow-separator {
    animation: separator-glow 4s ease-in-out infinite;
}

/* Footer Fade-Up Reveal (for GSAP/IntersectionObserver) */
.footer-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1), transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.footer-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Social Icon Magnetic Hover */
.footer-social-icon {
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* App Download Buttons */
.footer-app-btn {
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.footer-app-btn:hover {
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 15px rgba(229,9,20,0.1);
    transform: translateX(3px);
}

/* Floating Gradient for About Section */
@keyframes footer-gradient-float {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Mobile Responsive Footer */
@media (max-width: 767px) {
    #site-footer .grid > div {
        text-align: center;
    }
    
    #site-footer .grid > div .flex {
        justify-content: center;
    }
    
    #site-footer .grid > div ul li {
        text-align: center;
    }

    #site-footer .grid > div:first-child .flex:first-child {
        justify-content: center;
    }
    
    .footer-about-card .flex-col.md\\:flex-row {
        align-items: center;
        text-align: center;
    }
    
    .footer-about-card .flex-wrap {
        justify-content: center;
    }
    
    .footer-app-btn {
        margin: 0 auto;
    }
    
    #site-footer .flex.items-start {
        justify-content: center;
    }
}

.scanner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
