/* ==========================================================================
   CineStream Theme - Bespoke Cinematic Dark UI & Native App Experience
   Clean, ultra-modern, optimized for Mobile Web App (PWA style) & Desktop
   Zero compilation required - Pure modern CSS
   ========================================================================== */

:root {
    --bg-primary: #070709;
    --bg-secondary: #0f0f14;
    --bg-card: #15151c;
    --accent-red: #e11d48;
    --accent-rose: #f43f5e;
    --accent-glow: rgba(225, 29, 72, 0.35);
    --accent-indigo: #6366f1;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.16);
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-primary);
    color: #e4e4e7;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #070709;
}
::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

/* Horizontal scroll container with hidden scrollbar for sliders */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Native App Horizontal Snap Rail */
.app-snap-rail {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-padding: 0 1rem;
    overscroll-behavior-x: contain;
}
.app-snap-card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Glassmorphism navbar & overlays */
.glass-header {
    background: rgba(7, 7, 9, 0.82);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
}

.glass-dropdown {
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid var(--border-highlight);
}

/* Native App Bottom Tab Bar */
.mobile-app-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(10, 10, 14, 0.88);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.7);
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    padding-top: 0.5rem;
    user-select: none;
    -webkit-user-select: none;
}

/* Bottom Tab Bar Item */
.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    padding: 0.25rem 0;
    color: #71717a;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-item:active {
    transform: scale(0.92);
}
.tab-item.active {
    color: #f43f5e;
}
.tab-item.active svg {
    color: #f43f5e;
    filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.6));
    transform: translateY(-2px);
}
.tab-item .tab-indicator {
    position: absolute;
    bottom: -2px;
    width: 14px;
    height: 3px;
    background: linear-gradient(90deg, #f43f5e, #fb7185);
    border-radius: 9999px;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.8);
}

/* App Touch Haptic Feedback */
.app-press {
    transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), opacity 0.12s ease;
}
.app-press:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Native App Fullscreen Search & Bottom Sheet Modal */
.app-sheet {
    background: rgba(14, 14, 19, 0.98);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid var(--border-highlight);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
}

/* Movie Card Poster Aspect Ratio and Transitions */
.poster-ratio {
    aspect-ratio: 2 / 3;
}

.backdrop-ratio {
    aspect-ratio: 16 / 9;
}

.card-hover-effect {
    transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1);
}
@media (hover: hover) {
    .card-hover-effect:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.8), 0 0 20px var(--accent-glow);
    }
}

/* App Category Pill Chips (Horizontal Swiper) */
.app-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: rgba(24, 24, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #a1a1aa;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.app-pill:hover, .app-pill:active {
    color: #ffffff;
    background: rgba(39, 39, 48, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}
.app-pill.active {
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #ffffff;
    border-color: rgba(244, 63, 94, 0.5);
    box-shadow: 0 0 16px rgba(225, 29, 72, 0.4);
}

/* Hero gradient overlays */
.hero-vignette {
    background: linear-gradient(180deg, rgba(7,7,9,0.1) 0%, rgba(7,7,9,0.85) 75%, #070709 100%),
                linear-gradient(90deg, #070709 0%, rgba(7,7,9,0.9) 35%, rgba(7,7,9,0.35) 70%, transparent 100%);
}

.hero-vignette-mobile {
    background: linear-gradient(180deg, rgba(7,7,9,0.2) 0%, rgba(7,7,9,0.6) 40%, rgba(7,7,9,0.95) 75%, #070709 100%);
}

/* Shimmer placeholder animation */
@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}
.shimmer {
    position: relative;
    overflow: hidden;
    background-color: #27272a;
}
.shimmer::after {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
    content: '';
}

/* App badge with ambient pulse */
.app-badge-live {
    position: relative;
}
.app-badge-live::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: inherit;
    filter: blur(4px);
    opacity: 0.5;
    z-index: -1;
}

/* Ensure mobile safe padding on main so content is never cut off by fixed bottom tab bar */
@media (max-width: 767px) {
    body {
        padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    }
}
