/**
 * ONLY4K — Pure White Frosted Glass (Liquid Glassmorphism)
 * Ultra-luxury translucent glass aesthetic with pure crystal white accents.
 */

:root,
html[data-theme="dark"] {
  color-scheme: dark;

  /* Surface & Background (Ultra-Transparent 98% Translucent Glass Canvas) */
  --ui-page: #050508;
  --ui-page-soft: #0c0d14;
  --ui-surface: rgba(255, 255, 255, 0.025);
  --ui-surface-solid: #0c0d14;
  --ui-surface-muted: rgba(255, 255, 255, 0.015);
  --ui-glass-card: rgba(255, 255, 255, 0.02);
  --ui-glass-info: rgba(255, 255, 255, 0.025);
  --ui-glass-overlay: rgba(0, 0, 0, 0.75);

  --bg-main: #050508;
  --bg-darker: #020204;
  --bg-surface: rgba(255, 255, 255, 0.025);
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-glass: rgba(255, 255, 255, 0.025);
  --bg-glass-heavy: rgba(255, 255, 255, 0.05);
  --bg-glass-card: rgba(255, 255, 255, 0.02);

  /* Pure White Crystal Glass Accents (Zero Saturated Circus Colors) */
  --neon-purple: #FFFFFF;
  --neon-purple-glow: rgba(255, 255, 255, 0.4);
  --neon-cyan: #FFFFFF;
  --neon-cyan-glow: rgba(255, 255, 255, 0.4);
  --accent-pink: #FFFFFF;
  --accent-pink-glow: rgba(255, 255, 255, 0.4);
  --accent-orange: #FFFFFF;
  --accent-purple: #FFFFFF;
  --accent-cyan: #FFFFFF;
  --accent-gold: #FFFFFF;
  --accent-green: #FFFFFF;

  /* Typography (High Clarity White & Moonlit Silver) */
  --ui-text: #FFFFFF;
  --ui-text-secondary: #E2E8F0;
  --ui-text-muted: #94A3B8;
  --text-primary: #FFFFFF;
  --text-secondary: #E2E8F0;
  --text-muted: #94A3B8;

  /* Crystalline White Frosted Borders & Specular Edges */
  --ui-border: rgba(255, 255, 255, 0.14);
  --ui-border-strong: rgba(255, 255, 255, 0.45);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-glass: rgba(255, 255, 255, 0.18);
  --border-hover: rgba(255, 255, 255, 0.6);
  --border-cyan-hover: rgba(255, 255, 255, 0.6);

  /* Frosted Glass Shadow & Specular Rim Light */
  --ui-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  --shadow-card: 0 16px 40px -8px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  --shadow-neon-purple: 0 0 25px rgba(255, 255, 255, 0.35);
  --shadow-neon-cyan: 0 0 25px rgba(255, 255, 255, 0.35);
  --shadow-hover: 0 24px 50px -10px rgba(0, 0, 0, 0.9), 0 0 28px rgba(255, 255, 255, 0.25);

  --reader-bg: var(--ui-page);
  --header-bg: var(--ui-surface);
}

html[data-theme="light"] {
  color-scheme: dark;

  /* Permanently lock to Dark Mode Canvas */
  --ui-page: #050508;
  --ui-page-soft: #0c0d14;
  --ui-surface: rgba(255, 255, 255, 0.025);
  --ui-surface-solid: #0c0d14;
  --ui-surface-muted: rgba(255, 255, 255, 0.015);
  --ui-glass-card: rgba(255, 255, 255, 0.02);
  --ui-glass-info: rgba(255, 255, 255, 0.025);
  --ui-glass-overlay: rgba(0, 0, 0, 0.75);

  --bg-main: #050508;
  --bg-darker: #020204;
  --bg-surface: rgba(255, 255, 255, 0.025);
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-glass: rgba(255, 255, 255, 0.025);
  --bg-glass-heavy: rgba(255, 255, 255, 0.05);
  --bg-glass-card: rgba(255, 255, 255, 0.02);

  --neon-purple: #FFFFFF;
  --neon-purple-glow: rgba(255, 255, 255, 0.4);
  --neon-cyan: #FFFFFF;
  --neon-cyan-glow: rgba(255, 255, 255, 0.4);
  --accent-pink: #FFFFFF;
  --accent-pink-glow: rgba(255, 255, 255, 0.4);
  --accent-orange: #FFFFFF;
  --accent-purple: #FFFFFF;
  --accent-cyan: #FFFFFF;
  --accent-gold: #FFFFFF;
  --accent-green: #FFFFFF;

  --ui-text: #FFFFFF;
  --ui-text-secondary: #E2E8F0;
  --ui-text-muted: #94A3B8;
  --text-primary: #FFFFFF;
  --text-secondary: #E2E8F0;
  --text-muted: #94A3B8;

  --ui-border: rgba(255, 255, 255, 0.14);
  --ui-border-strong: rgba(255, 255, 255, 0.45);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-glass: rgba(255, 255, 255, 0.18);
  --border-hover: rgba(255, 255, 255, 0.6);
  --border-cyan-hover: rgba(255, 255, 255, 0.6);

  --ui-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  --shadow-card: 0 16px 40px -8px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  --shadow-neon-purple: 0 0 25px rgba(255, 255, 255, 0.35);
  --shadow-neon-cyan: 0 0 25px rgba(255, 255, 255, 0.35);
  --shadow-hover: 0 24px 50px -10px rgba(0, 0, 0, 0.9), 0 0 28px rgba(255, 255, 255, 0.25);

  --reader-bg: var(--ui-page);
  --header-bg: var(--ui-surface);
}

/* Base Body Styling */
body, .aurora-body, .watch-body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  transition: background-color 220ms ease, color 220ms ease;
}

/* Theme Toggle Button (Desktop & Mobile) */
.theme-toggle {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-glass);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 15px var(--neon-purple-glow);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}


/* ==========================================================================
   Responsive & Adaptive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .header-inner, .watch-header .header-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
  }
  .nav-menu-desktop {
    display: flex;
    order: 5;
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .nav-menu-desktop::-webkit-scrollbar {
    display: none;
  }
  .header-actions-neo {
    flex-wrap: wrap;
    margin-left: auto;
  }
  .watch-header-left {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
  }
  .watch-header .header-actions {
    order: 2;
    flex: 0 0 auto;
  }
  .watch-header .watch-search-box {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    max-width: none;
  }
  .theme-toggle {
    min-width: 38px;
    width: 38px;
    padding: 8px 10px;
  }
  .theme-toggle span {
    display: none;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .header-inner, .watch-header .header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }
  .nav-menu-desktop {
    order: 5;
    flex: 1 0 100%;
    width: 100%;
    justify-content: center;
  }
  .header-actions-neo {
    margin-left: auto;
  }
  .watch-header .watch-search-box {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 650px) {
  .header-inner {
    align-items: center;
  }
  .header-inner > .brand {
    order: 1;
    flex: 1 1 150px;
    min-width: 0;
  }
  .header-inner > .library-switch {
    order: 2;
    flex: 1 0 100%;
    width: 100%;
  }
  .nav-menu-desktop {
    order: 3;
    flex-basis: 100%;
    gap: 4px;
  }
  .nav-link-neo {
    flex: 0 0 auto;
    padding: 8px 11px;
  }
  .header-inner > .header-actions-neo {
    order: 4;
    flex: 1 0 100%;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .header-actions-neo .action-btn {
    flex: 1 1 auto;
  }
  .watch-header .header-actions {
    flex: 1 0 100%;
    justify-content: flex-end;
  }
  .watch-header .watchlist-text {
    display: none;
  }
  .watch-header .watchlist-btn {
    min-width: 40px;
    justify-content: center;
    padding: 8px 11px;
  }
  .watch-header .watch-search-box {
    display: flex;
  }
}

@media (max-width: 600px) {
  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
    gap: 14px 12px;
  }
  .card-title {
    font-size: 13px;
    line-height: 1.35;
  }
  .card-meta {
    gap: 6px;
  }
}

/* Category Navigation Strip Fix & Cyber Pill Styling */
.categories-container {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  scroll-behavior: smooth !important;
  padding: 8px 4px !important;
  width: 100% !important;
}

.categories-container::-webkit-scrollbar {
  display: none !important;
}

.category-pill {
  flex-shrink: 0 !important;
  min-width: max-content !important;
  white-space: nowrap !important;
  padding: 8px 18px !important;
  border-radius: 9999px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 38px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

/* Tier 1 & Tier 2 Cyber Navigation Badges */
.nav-tier-badge {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.sub-tier-badge {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
}

/* Reduced Motion Compliance */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* YouTube Clarity: Zero glass blur or dark film on card posters */
.card-poster {
  filter: none !important;
  -webkit-filter: none !important;
}
.movie-card::before,
.movie-card::after,
.card-overlay {
  display: none !important;
  content: none !important;
}

/* =========================================================================
 * ULTRA-TRANSPARENT CRYSTAL GLASS CARDS (98% Translucent, 10% Blur)
 * Crystal clear window aesthetic, razor specular borders, pure white halos
 * ========================================================================= */
.movie-card {
  background: rgba(255, 255, 255, 0.02) !important;
  backdrop-filter: blur(5px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(5px) saturate(120%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.18) !important;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease !important;
}

.movie-card:hover,
.movie-card:focus-visible {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 22px rgba(255, 255, 255, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
  transform: translateY(-4px) !important;
  outline: none;
}

.card-info {
  background: rgba(5, 5, 8, 0.25) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   ULTRA-TRANSPARENT NAVIGATION & BARS (10% Blur / 5px)
   ========================================================================== */
.site-header,
.watch-header,
.reader-header {
  background: rgba(7, 9, 15, 0.96) !important;
  backdrop-filter: blur(20px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.75) !important;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), background-color 220ms ease, opacity 240ms ease !important;
  will-change: transform;
}

.site-header.header-hidden,
.watch-header.header-hidden,
.reader-header.header-hidden {
  transform: translateY(-110%) !important;
}

.categories-bar {
  background: rgba(7, 9, 15, 0.94) !important;
  backdrop-filter: blur(20px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5) !important;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), background-color 220ms ease, opacity 240ms ease !important;
  will-change: transform;
}

.categories-bar.categories-hidden {
  transform: translateY(-220%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.channel-toggle-group {
  background: rgba(255, 255, 255, 0.02) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08) !important;
}

.channel-toggle-btn {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #CBD5E1 !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.channel-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.channel-toggle-btn.active {
  background: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.3) !important;
}

.category-pill {
  background: rgba(255, 255, 255, 0.025) !important;
  backdrop-filter: blur(4px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(4px) saturate(130%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #CBD5E1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.category-pill:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #FFFFFF !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
}

.category-pill.active {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
}

.modal-card {
  background: rgba(8, 8, 12, 0.75) !important;
  backdrop-filter: blur(8px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(140%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  padding: 24px !important;
  box-sizing: border-box !important;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85), inset 0 1px 2px rgba(255, 255, 255, 0.25) !important;
}

/* Light mode disabled */


