/* ==========================================================================
   PhimX - Netflix Premium Dark Theme Stylesheet
   ========================================================================== */

:root {
    --netflix-red: #E50914;
    --netflix-red-hover: #F40612;
    --netflix-black: #080809;
    --netflix-dark: #0f0f11;
    --netflix-card: #121214;
    --netflix-card-hover: #1c1c20;
    --netflix-gray: #808080;
    --netflix-light-gray: #b3b3b3;
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--netflix-black);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
}

/* GPU Hardware Acceleration for Fixed Navigation Bars Only */
#mobile-bottom-dock, 
.mobile-filter-bar {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@media (min-width: 1024px) {
    body {
        padding-bottom: 0 !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #141414;
}
::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--netflix-red);
}

/* Glass Navbar */
.netflix-nav {
    transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    background-color: rgba(8, 8, 10, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.netflix-nav.scrolled {
    background-color: rgba(10, 10, 12, 0.98) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown Hover Safety Bridge - prevents menu disappearing on mouse move */
.group > div[class*="absolute"]::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    z-index: 1;
}

/* Hero Billboard Gradients */
.hero-gradient-overlay {
    background: linear-gradient(77deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.7) 45%, transparent 85%);
}
.hero-vignette-bottom {
    background: linear-gradient(180deg, rgba(20,20,20,0) 0%, rgba(20,20,20,0.7) 60%, #141414 100%);
}

/* Netflix Movie Card Hover Effect */
.movie-card {
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease, z-index 0.3s ease;
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: var(--netflix-card);
}
.movie-card:hover {
    transform: scale(1.05) translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.8), 0 0 15px 2px rgba(229, 9, 20, 0.3);
    z-index: 20;
}

.movie-card .card-overlay {
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 80%, #000000 100%);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}
.movie-card:hover .card-overlay {
    opacity: 1;
}

/* Card Action Buttons (Always 1:1 Perfect Circles) */
.card-action-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 9999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}
@media (min-width: 640px) {
    .card-action-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
    }
}

/* Swiper custom navigation buttons */
.swiper-button-prev,
.swiper-button-next {
    color: #ffffff !important;
    width: 44px !important;
    height: 100% !important;
    top: 0 !important;
    margin-top: 0 !important;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    opacity: 0;
}
.swiper-container-row:hover .swiper-button-prev,
.swiper-container-row:hover .swiper-button-next {
    opacity: 1;
}
.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: rgba(229, 9, 20, 0.8) !important;
    color: #ffffff !important;
}
.swiper-button-prev {
    left: 0 !important;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}
.swiper-button-next {
    right: 0 !important;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}
.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 20px !important;
    font-weight: bold;
}

/* Pulse Glow */
.glow-red {
    box-shadow: 0 0 25px rgba(229, 9, 20, 0.5);
}

/* Badge Styling */
.badge-quality {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Text line clamps */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Shimmer animation for skeletons */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #1e1e1e 25%, #2a2a2a 50%, #1e1e1e 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Toast container */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast-msg {
    pointer-events: auto;
    background: rgba(24, 24, 24, 0.95);
    border-left: 4px solid var(--netflix-red);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.toast-msg.show {
    transform: translateY(0);
    opacity: 1;
}

/* Lights off theater mode */
#theater-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 45;
    display: none;
    transition: opacity 0.3s ease;
}
body.theater-active #theater-backdrop {
    display: block;
}
body.theater-active .theater-player-container {
    position: relative;
    z-index: 50;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}

/* Netflix Top 10 Styled Numbers (Desktop & Mobile) */
.top10-slide {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 10px;
}
.top10-rank {
    font-size: clamp(5.5rem, 12vw, 9.5rem);
    font-weight: 900;
    line-height: 0.8;
    color: #0b0b0e;
    -webkit-text-stroke: 4px #5c5c64;
    text-shadow: 2px 4px 15px rgba(0,0,0,0.9);
    position: relative;
    z-index: 10;
    margin-right: -24px;
    font-family: Impact, "Arial Black", sans-serif;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: -4px;
}
.top10-slide:hover .top10-rank {
    -webkit-text-stroke: 4px var(--netflix-red);
    color: #140304;
    transform: scale(1.06);
    text-shadow: 0 0 25px rgba(229, 9, 20, 0.6);
}
.top10-card-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 5;
}

/* Mobile Responsiveness for Netflix Top 10 3D Numbers */
@media (max-width: 640px) {
    .top10-slide {
        padding-left: 4px;
    }
    .top10-rank {
        font-size: clamp(4.2rem, 18vw, 5.8rem);
        margin-right: -16px;
        -webkit-text-stroke: 2.5px #6b6b75;
        letter-spacing: -2px;
    }
}

/* ==========================================================================
   Mobile Enterprise Navigation & Drawer Styles
   ========================================================================== */

/* Cinematic Mobile Hero Spotlight Vignette */
.hero-mobile-vignette {
    background: linear-gradient(180deg, rgba(8,8,9,0.3) 0%, rgba(8,8,9,0.1) 25%, rgba(8,8,9,0.65) 60%, rgba(8,8,9,0.95) 85%, #080809 100%),
                radial-gradient(ellipse at center bottom, rgba(229,9,20,0.12) 0%, transparent 60%);
}

/* Mobile Quick Filter Chips Bar */
.mobile-filter-bar {
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.mobile-filter-bar::-webkit-scrollbar {
    display: none;
}

.mobile-filter-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    color: #e5e5e5;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}
.mobile-filter-chip:active {
    transform: scale(0.93);
    background: rgba(229, 9, 20, 0.2);
    border-color: rgba(229, 9, 20, 0.5);
    color: #ffffff;
}
.mobile-filter-chip.active-chip {
    background: #ffffff;
    color: #000000;
    font-weight: 700;
    border-color: #ffffff;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.3);
}

/* Slide-over Mobile Drawer */
#mobile-drawer {
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}
body.drawer-open {
    overflow: hidden !important;
    touch-action: none;
}
body.drawer-open #mobile-drawer-backdrop {
    opacity: 1 !important;
    pointer-events: auto !important;
}
body.drawer-open #mobile-drawer {
    transform: translateX(0) !important;
}

/* Mobile Floating Frosted Glass Bottom Dock */
#mobile-bottom-dock {
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.bottom-tab-item {
    user-select: none;
    touch-action: manipulation;
    position: relative;
}
.bottom-tab-item.active-tab {
    color: #ffffff !important;
}
.bottom-tab-item.active-tab i {
    color: var(--netflix-red) !important;
    filter: drop-shadow(0 0 8px rgba(229, 9, 20, 0.8));
    transform: translateY(-1px);
}

/* Utility: Hide Scrollbar but maintain touch momentum */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Touch active scale helpers */
.active-scale:active {
    transform: scale(0.95);
}

/* Custom glow animations */
@keyframes redPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}
.ambient-glow-red {
    animation: redPulse 4s infinite ease-in-out;
}

/* Infinite Scroll Smooth Card Entrance */
@keyframes cardGlideIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.card-glide-in {
    animation: cardGlideIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}




