/* ==========================================================================
   Tool Genzy KH - Telegram Drama Mini App
   Design System: Masterpiece Global Production (Pristine Light / Clean White)
   ========================================================================== */

:root {
  /* Apple Human Interface Typography Stack */
  --font-khmer: 'Kantumruy Pro', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', sans-serif;
  --font-en: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Outfit', 'Helvetica Neue', sans-serif;

  /* Layout Dimensions */
  --header-height: 60px;
  --nav-height: 68px;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Primary Gold VIP Palette */
  --gold-primary: #d97706;
  --gold-secondary: #f59e0b;
  --gold-light: #fef3c7;
  --gold-dark: #b45309;
  --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  --gold-glow: rgba(245, 158, 11, 0.25);

  --accent-red: #ef4444;
  --accent-blue: #2563eb;
  --accent-green: #10b981;
  --accent-purple: #7c3aed;
}

/* ==========================================================================
   THEME: Soft Titanium Grey Dark (Eye-Friendly Slate & Cool Grey Canvas)
   ========================================================================== */
:root, body.theme-dark {
  --bg-primary: #1e2430;         /* Soft Cool Grey/Slate Canvas */
  --bg-secondary: #272f3d;       /* Refined Slate Panel */
  --bg-card: #283141;            /* Eye-friendly Grey Surface */
  --bg-card-hover: #313c4e;
  --bg-elevated: #364255;
  --bg-input: #232a37;
  --bg-header: rgba(30, 36, 48, 0.94);
  --bg-nav: rgba(30, 36, 48, 0.96);
  --bg-glass: rgba(39, 47, 61, 0.92);

  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-normal: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #1e2430;

  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-focus: #fbbf24;
  --border-gold: rgba(245, 158, 11, 0.45);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 12px 30px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 4px 22px rgba(245, 158, 11, 0.25);
  --shadow-nav: 0 -4px 20px rgba(0, 0, 0, 0.3);

  --chip-bg: #283141;
  --chip-border: rgba(255, 255, 255, 0.12);
  --chip-text: #e2e8f0;
}

/* ==========================================================================
   THEME: Soft Warm Pearl Light (Non-glare, Eye-comfort Light Mode)
   ========================================================================== */
body.theme-light {
  --bg-primary: #f4f6f9;         /* Soft Non-glare Pearl Grey Canvas */
  --bg-secondary: #eaedf2;       /* Subtle muted container */
  --bg-card: #ffffff;            /* Crisp clean cards */
  --bg-card-hover: #f1f4f8;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;
  --bg-header: rgba(244, 246, 249, 0.94);
  --bg-nav: rgba(244, 246, 249, 0.96);
  --bg-glass: rgba(255, 255, 255, 0.92);

  --text-primary: #1e293b;       /* Soft Charcoal Slate */
  --text-secondary: #334155;
  --text-normal: #334155;
  --text-muted: #64748b;         /* Eye-comfort muted */
  --text-inverse: #ffffff;

  --border-subtle: #dbe2ea;
  --border-card: #dbe2ea;
  --border-focus: #f59e0b;
  --border-gold: rgba(217, 119, 6, 0.45);

  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 16px rgba(15, 23, 42, 0.05);
  --shadow-card-hover: 0 10px 24px rgba(15, 23, 42, 0.08);
  --shadow-gold: 0 4px 18px rgba(217, 119, 6, 0.2);
  --shadow-nav: 0 -2px 12px rgba(15, 23, 42, 0.04);

  --chip-bg: #eaedf2;
  --chip-border: #dbe2ea;
  --chip-text: #1e293b;
}

/* User's Original Logo (Chelsea / GenZ Drama Hub) Premium Frame */
.brand-logo-img,
.drawer-logo-img,
.pwa-logo-img {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  border-radius: 10px !important;
  object-fit: cover !important;
  border: 1.5px solid rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
  flex-shrink: 0 !important;
  display: block !important;
  transition: transform 0.2s ease;
}

.brand-logo-img:hover,
.drawer-logo-img:hover {
  transform: scale(1.05);
}

/* ==========================================================================
   Global Base Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-khmer);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  user-select: none;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* App Container Wrapper (Mobile First with Desktop Frame) */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  background-color: var(--bg-primary);
  box-shadow: 0 0 50px rgba(15, 23, 42, 0.08);
}

/* Vector SVG Icon System */
.icon-svg {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-svg-xs {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-svg-sm {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-svg-lg {
  width: 26px;
  height: 26px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ==========================================================================
   Header Navigation Bar (Apple Style Frosted Glass)
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.brand-logo-icon svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: normal;
  line-height: 1.35;
}

.brand-sub {
  font-size: 9.5px;
  color: var(--gold-primary);
  font-family: var(--font-en);
  font-weight: 700;
  letter-spacing: 0.8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Theme Toggle Button */
.btn-theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-theme-toggle:active {
  transform: scale(0.92);
}

/* VIP Pill Badge in Header */
.vip-status-pill-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.8) 0%, rgba(253, 230, 138, 0.6) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-full);
  color: #b45309;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-en);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

body.theme-dark .vip-status-pill-badge {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.38);
  color: var(--gold-secondary);
}

.vip-status-pill-badge:active {
  transform: scale(0.95);
}

.crown-gold-icon {
  width: 14px;
  height: 14px;
  color: var(--gold-secondary);
}

.header-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.header-avatar-btn:active {
  transform: scale(0.92);
}

.header-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-avatar-initial {
  font-size: 14px;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 14px 16px calc(var(--nav-height) + env(safe-area-inset-bottom) + 36px) 16px;
}

/* View Transition Animations */
.view-panel {
  display: none;
  animation: panelSlideFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-panel.active {
  display: block;
}

@keyframes panelSlideFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Search Box Container in Home */
.search-box-wrap {
  margin-bottom: 14px;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-input-box:hover,
.search-input-box:active {
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.search-icon {
  color: var(--text-muted);
}

.search-placeholder {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
  font-weight: 400;
}

.search-shortcut {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* Section Header Bar */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fire-icon-wrap {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fire-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-red);
}

.section-title h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.section-subtitle-text {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-text-more {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--gold-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  transition: opacity 0.2s;
}

.btn-text-more:active {
  opacity: 0.7;
}

/* Desktop Frame & Multi-Platform Media Query */
@media (min-width: 768px) {
  body {
    background-color: #f1f5f9;
  }
  body.theme-dark {
    background-color: #060910;
  }
  .app-container {
    max-width: 960px !important;
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    box-shadow: 0 0 60px rgba(15, 23, 42, 0.1);
  }
  .app-header {
    max-width: 960px;
    margin: 0 auto;
  }
  .bottom-nav {
    max-width: 960px;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 16px 16px 0 0;
  }
  .dramas-grid, .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)) !important;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  body {
    background-color: #f1f5f9;
  }
  body.theme-dark {
    background-color: #060910;
  }
  .app-container {
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    box-shadow: 0 0 60px rgba(15, 23, 42, 0.1);
  }
}

/* Utilities */
.hidden {
  display: none !important;
}


/* Khmer Typography Optimization: Prevent glyph collision & overlap */
html, body, button, input, select, textarea, p, span, h1, h2, h3, h4, h5, h6 {
  letter-spacing: normal;
}


/* ==========================================================================
   DESKTOP COMPUTER & MULTI-PLATFORM RESPONSIVE MASTER STYLES
   ========================================================================== */

/* Mobile: Hide desktop top navigation */
.desktop-nav-menu {
  display: none;
}

/* ==========================================================================
   DESKTOP SCREEN (min-width: 768px): FULL-FEATURED COMPUTER WEB APP
   ========================================================================== */
@media (min-width: 768px) {
  body {
    background-color: #0b0f19 !important;
  }
  body.theme-light {
    background-color: #ffffff !important;
  }

  /* Full Width Expansive Container on Computer */
  .app-container {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    background-color: var(--bg-primary) !important;
    border-left: 1px solid var(--border-subtle) !important;
    border-right: 1px solid var(--border-subtle) !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.25) !important;
    min-height: 100vh !important;
  }

  /* Wide Cinema Header on Computer */
  .app-header {
    height: 70px !important;
    padding: 0 32px !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    background: var(--bg-header) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
  }

  .header-brand {
    gap: 12px !important;
  }
  .brand-logo-img {
    width: 44px !important;
    height: 44px !important;
  }
  .brand-title {
    font-size: 16px !important;
  }
  .brand-sub {
    font-size: 10.5px !important;
  }

  /* Desktop Top Navigation Menu Bar */
  .desktop-nav-menu {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 auto 0 28px !important;
  }

  .desktop-nav-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 8px 14px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 20px !important;
    color: var(--text-secondary) !important;
    font-family: var(--font-khmer) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .desktop-nav-btn svg {
    width: 15px !important;
    height: 15px !important;
    color: var(--text-muted) !important;
    transition: color 0.2s ease !important;
  }

  .desktop-nav-btn:hover {
    color: var(--text-primary) !important;
    background: var(--bg-input) !important;
  }

  .desktop-nav-btn.active {
    background: rgba(245, 158, 11, 0.15) !important;
    color: var(--gold-secondary) !important;
    font-weight: 700 !important;
  }

  .desktop-nav-btn.active svg {
    color: var(--gold-secondary) !important;
  }

  .desktop-nav-btn.vip-link {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25)) !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    color: #f59e0b !important;
  }

  /* Computer does NOT use Mobile Bottom Bar */
  .bottom-nav {
    display: none !important;
  }

  /* Main Content: No huge bottom padding on computer */
  .main-content {
    padding: 24px 32px 40px 32px !important;
  }

  /* Expansive Hero 3D Slider on Computer */
  .hero-slider-wrap {
    height: 360px !important;
    margin-bottom: 32px !important;
  }
  .hero-slide-card {
    width: 680px !important;
    height: 330px !important;
  }

  /* Drama Grid on Computer: 5-6 cards per row! */
  .dramas-grid,
  .catalog-grid,
  .drama-grid,
  #dramasGrid,
  #donghuaGrid,
  #aiKhmerGrid,
  #searchGrid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)) !important;
    gap: 20px !important;
  }

  /* Drama Card Styling on Computer */
  .drama-card {
    border-radius: 14px !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
  }
  .drama-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.3) !important;
  }
  .card-poster-wrap {
    aspect-ratio: 3 / 4.3 !important;
  }

  /* Tools / Services Grid on Computer */
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 20px !important;
  }

  /* Watch Page on Computer */
  .player-wrapper {
    max-width: 1050px !important;
    margin: 0 auto !important;
  }
  .video-container {
    max-height: 580px !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
  }
  .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)) !important;
    gap: 8px !important;
  }

  /* VIP Plans Grid on Computer (4 Plans: 7-Days, 1-Month, 1-Year, Lifetime) */
  .vip-plans-cards {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
  }
  @media (min-width: 768px) and (max-width: 1024px) {
    .vip-plans-cards {
      grid-template-columns: repeat(2, 1fr) !important;
    }
  }
  .vip-plan-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 22px !important;
    height: 100% !important;
  }
  .plan-price {
    margin-top: 16px !important;
  }

  /* Search Bar on Computer */
  .search-box-wrap {
    max-width: 650px !important;
    margin: 0 auto 24px auto !important;
  }
}


/* ==========================================================================
   Dedicated Desktop Navigation Bar (PC & Wide Screens)
   ========================================================================== */
.desktop-nav-bar {
  display: none;
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 54px;
  z-index: 95;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.desktop-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.desktop-nav-inner::-webkit-scrollbar {
  display: none;
}

.desktop-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.desktop-nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.desktop-nav-item.active {
  color: #fbbf24;
  border-bottom-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  font-weight: 700;
}

.desktop-nav-icon {
  font-size: 16px;
}

.desktop-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.desktop-badge.free {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.desktop-badge.new {
  background: rgba(220, 38, 38, 0.2);
  color: #ef4444;
  border: 1px solid rgba(220, 38, 38, 0.4);
}
.desktop-badge.iq {
  background: rgba(0, 220, 90, 0.2);
  color: #00dc5a;
  border: 1px solid rgba(0, 220, 90, 0.4);
}
.desktop-badge.gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.btn-pc-login {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
  transition: transform 0.15s ease;
}
.btn-pc-login:hover {
  transform: translateY(-1px);
}

@media (min-width: 768px) {
  .desktop-nav-bar {
    display: block !important;
  }
  .app-header {
    height: 58px;
    padding: 0 24px;
  }
  .main-content {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 24px !important;
  }
  .drama-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 18px !important;
  }
  .search-box-wrap {
    max-width: 700px;
    margin: 0 auto 20px auto;
  }
}


/* ==========================================================================
   DESKTOP MASTERPIECE RESPONSIVE & THEME PERFECTION
   ========================================================================== */

/* Light Theme Navigation Styling */
body.light-mode .desktop-nav-bar,
[data-theme="light"] .desktop-nav-bar {
  background: rgba(255, 255, 255, 0.98) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}
body.light-mode .desktop-nav-item,
[data-theme="light"] .desktop-nav-item {
  color: #334155 !important;
}
body.light-mode .desktop-nav-item:hover,
[data-theme="light"] .desktop-nav-item:hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
}
body.light-mode .desktop-nav-item.active,
[data-theme="light"] .desktop-nav-item.active {
  color: #d97706 !important;
  border-bottom-color: #d97706 !important;
  background: rgba(217, 119, 6, 0.1) !important;
  font-weight: 700 !important;
}

/* Dark Theme Navigation Styling */
body:not(.light-mode) .desktop-nav-bar {
  background: rgba(15, 23, 42, 0.97) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}
body:not(.light-mode) .desktop-nav-item {
  color: #94a3b8 !important;
}
body:not(.light-mode) .desktop-nav-item:hover {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
body:not(.light-mode) .desktop-nav-item.active {
  color: #fbbf24 !important;
  border-bottom-color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.12) !important;
  font-weight: 700 !important;
}

/* Desktop Full Width Layout (Netflix / YouTube Style) */
@media (min-width: 768px) {
  body {
    background-color: var(--bg-primary) !important;
  }
  .app-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background-color: var(--bg-primary) !important;
  }
  .app-header {
    max-width: 100% !important;
    height: 64px !important;
    padding: 0 36px !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    background: var(--bg-card) !important;
  }
  .desktop-nav-bar {
    display: block !important;
    position: sticky !important;
    top: 64px !important;
    z-index: 95 !important;
  }
  .desktop-nav-inner {
    max-width: 1440px !important;
    margin: 0 auto !important;
    padding: 0 36px !important;
    gap: 10px !important;
  }
  .main-content {
    max-width: 1440px !important;
    margin: 0 auto !important;
    padding: 28px 36px 60px 36px !important;
  }
  .drama-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
    gap: 24px !important;
  }
  .search-box-wrap {
    max-width: 820px !important;
    margin: 0 auto 28px auto !important;
  }
  .genre-chips-scroll {
    justify-content: center !important;
    margin-bottom: 24px !important;
  }
}


/* ==========================================================================
   GLOBAL CINEMA STANDARD: LUXURY UNIFIED NAVBAR & DESKTOP STYLING (Netflix/iQIYI)
   ========================================================================== */

.global-navbar {
  height: 68px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  width: 100% !important;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

body.theme-dark .global-navbar {
  background: rgba(11, 14, 20, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45) !important;
}

body.theme-light .global-navbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.global-navbar-container {
  max-width: 1560px !important;
  margin: 0 auto !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 20px !important;
  gap: 16px !important;
}

/* Nav Icons & Labels */
.nav-svg-icon {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
  min-height: 17px !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s ease, stroke 0.2s ease, fill 0.2s ease !important;
}

@media (max-width: 767px) {
  #desktopNavBar {
    display: none !important;
  }
  .nav-search-btn {
    display: none !important;
  }
}

@media (min-width: 768px) {
  #desktopNavBar {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    margin: 0 16px !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .desktop-nav-inner {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .desktop-nav-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 8px 12px !important;
    border-radius: 9px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
  }

  body.theme-dark .desktop-nav-item:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateY(-1px) !important;
  }

  body.theme-light .desktop-nav-item:hover {
    color: #0f172a !important;
    background: rgba(0, 0, 0, 0.06) !important;
    transform: translateY(-1px) !important;
  }

  .desktop-nav-item.active {
    color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.12) !important;
    font-weight: 700 !important;
  }

  .desktop-nav-item.active .nav-svg-icon {
    stroke: #f59e0b !important;
    color: #f59e0b !important;
    transform: scale(1.1) !important;
  }

  /* Desktop Badges */
  .desktop-badge {
    font-size: 9.5px !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px !important;
    line-height: 1 !important;
  }
  .desktop-badge.free {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
  }
  .desktop-badge.new {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
  }
  .desktop-badge.iq {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
  }
  .desktop-badge.gold {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #000 !important;
    font-weight: 900 !important;
  }

  /* Nav Quick Search */
  .nav-search-btn {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 7px 14px !important;
    border-radius: 20px !important;
    background: var(--bg-input) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
  }
  .nav-search-btn:hover {
    border-color: var(--gold-secondary) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15) !important;
  }

  /* Global Layout on PC */
  .main-content {
    max-width: 1560px !important;
    margin: 0 auto !important;
    padding: 24px 28px 70px 28px !important;
    width: 100% !important;
  }

  /* Cinematic Responsive Grid */
  .drama-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)) !important;
    gap: 20px !important;
  }

  .drama-card {
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease !important;
    border-radius: 14px !important;
  }
  .drama-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(245, 158, 11, 0.2) !important;
  }
}

/* ==========================================================================
   PRO DOWNLOAD MODAL & FOLDER PICKER STYLING
   ========================================================================== */

.download-modal-card {
  max-width: 520px !important;
  width: 92% !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6) !important;
  animation: modalPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dl-choice-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px !important;
  margin-bottom: 14px !important;
}

.dl-choice-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 12px 8px !important;
  border-radius: 12px !important;
  background: var(--bg-input) !important;
  border: 1.5px solid var(--border-subtle) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.dl-choice-card:hover {
  border-color: rgba(245, 158, 11, 0.5) !important;
  transform: translateY(-2px) !important;
}

.dl-choice-card.active {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.12) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.2) !important;
}

.dl-choice-icon {
  font-size: 20px !important;
  margin-bottom: 4px !important;
}

.dl-choice-title {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

.dl-choice-sub {
  font-size: 10px !important;
  color: var(--text-muted) !important;
  margin-top: 2px !important;
}

.dl-range-box {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  margin-bottom: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.dl-range-input {
  width: 75px !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-align: center !important;
  outline: none !important;
}

.dl-folder-box {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  margin-bottom: 16px !important;
}

.dl-folder-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-top: 6px !important;
}

.dl-folder-path {
  font-size: 12px !important;
  font-family: monospace !important;
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.1) !important;
  padding: 6px 10px !important;
  border-radius: 7px !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
  flex: 1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.btn-pick-folder {
  padding: 6px 12px !important;
  border-radius: 7px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
}

.btn-pick-folder:hover {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: #f59e0b !important;
}

.btn-execute-dl {
  width: 100% !important;
  padding: 14px !important;
  border-radius: 12px !important;
  border: none !important;
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #000 !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35) !important;
  transition: all 0.2s ease !important;
}

.btn-execute-dl:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5) !important;
}

/* Strict SVG Sizing Guarantee across all modals */
.tool-modal-features svg,
.tool-modal-features li svg,
.modal-card svg.icon-svg-sm,
.modal-card svg.icon-svg-xs {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0 !important;
}

/* Brand Logo Guarantee (Strict 36px on Mobile, 42px on Desktop) */
.brand-logo-img {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  border-radius: 9px !important;
  object-fit: cover !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
  border: 1.5px solid var(--border-gold) !important;
  flex-shrink: 0 !important;
  display: block !important;
}
.header-brand {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   OFFICIAL BAKONG KHQR LUXURY FINTECH CARD WITH LASER SCANNER
   ========================================================================== */

.khqr-luxury-modal {
  background: var(--bg-card) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75), 0 0 40px rgba(225, 29, 72, 0.25) !important;
  animation: modalScaleUp 0.26s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.khqr-official-header {
  position: relative;
  overflow: hidden;
}

.khqr-official-header::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

/* High-tech Scanner Card Container */
.khqr-scanner-card {
  position: relative;
  border: 2px solid rgba(225, 29, 72, 0.3) !important;
  overflow: hidden !important;
}

/* High-tech Neon Corner Brackets */
.corner-bracket {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #e11d48;
  border-style: solid;
  pointer-events: none;
  z-index: 5;
}
.corner-bracket.top-left {
  top: 6px;
  left: 6px;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 4px;
}
.corner-bracket.top-right {
  top: 6px;
  right: 6px;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 4px;
}
.corner-bracket.bottom-left {
  bottom: 6px;
  left: 6px;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 4px;
}
.corner-bracket.bottom-right {
  bottom: 6px;
  right: 6px;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 4px;
}

/* Laser Scanline Animation */
.khqr-laser-line {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #e11d48 30%, #ef4444 50%, #f43f5e 70%, transparent);
  box-shadow: 0 0 12px #e11d48, 0 0 20px rgba(225, 29, 72, 0.8);
  border-radius: 50%;
  z-index: 4;
  animation: laserScan 2.4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes laserScan {
  0% { top: 12px; opacity: 0.7; }
  50% { opacity: 1; }
  100% { top: calc(100% - 15px); opacity: 0.7; }
}

/* Central Watermark Emblem */
.khqr-center-emblem {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #e11d48;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 3;
}

/* Live Radar Pulsing Dot */
.live-radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  animation: radarPulse 1.6s infinite;
  flex-shrink: 0;
}

@keyframes radarPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Mini Bank Pills */
.bank-pill-mini {
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  background: var(--bg-input) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-secondary) !important;
}

/* Clear Downloads Button */
.btn-clear-downloads {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 14px !important;
  border-radius: 9px !important;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #ef4444 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-clear-downloads:hover {
  background: rgba(239, 68, 68, 0.22) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

/* Logout Account Button */
.btn-profile-logout {
  width: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 18px !important;
  border-radius: 12px !important;
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1.5px solid rgba(239, 68, 68, 0.35) !important;
  color: #ef4444 !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-profile-logout:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.25) !important;
}

/* Direct Bakong 1-Tap Pay Button Hover */
.btn-bakong-tap:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.5) !important;
}

/* ==========================================================================
   LUXURY GLOBAL CINEMA HEADER CONTROLS (Pixel-Perfect Alignment & No-Wrap)
   ========================================================================== */

.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}

/* Luxury PC Login Button */
.btn-pc-login {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 34px !important;
  padding: 0 14px !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.theme-light .btn-pc-login {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
}

.btn-pc-login:hover {
  background: rgba(2, 132, 199, 0.18) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25) !important;
}

.btn-pc-login span {
  white-space: nowrap !important;
}

/* Luxury VIP Pill Badge */
.vip-status-pill-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 34px !important;
  padding: 0 14px !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.12) 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.5) !important;
  color: #f59e0b !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15) !important;
}

.vip-status-pill-badge:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(217, 119, 6, 0.2) 100%) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35) !important;
  transform: translateY(-1px) !important;
}

.vip-status-pill-badge span,
#headerVipLabel {
  white-space: nowrap !important;
  line-height: 1 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.vip-status-pill-badge svg {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  flex-shrink: 0 !important;
  color: #f59e0b !important;
}

/* Luxury Avatar Button */
.header-avatar-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  border: 1.5px solid var(--border-gold) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
  cursor: pointer !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.header-avatar-btn:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4) !important;
}

.header-avatar-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
}

/* Theme Toggle Button */
.btn-theme-toggle {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: var(--text-secondary) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

body.theme-light .btn-theme-toggle {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

.btn-theme-toggle:hover {
  color: var(--gold-secondary) !important;
  border-color: var(--gold-secondary) !important;
  transform: scale(1.05) !important;
}


/* ==========================================================================
   PERFECT MOBILE & TELEGRAM MINI APP HEADER (ZERO OVERFLOW, LUXURY LOOK)
   ========================================================================== */

@media (max-width: 767px) {
  /* Enforce compact height & zero horizontal scroll */
  .app-header.global-navbar {
    height: 54px !important;
    padding: 0 10px !important;
    overflow: hidden !important;
  }

  .global-navbar-container {
    padding: 0 4px !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  /* Compact Brand */
  .header-brand {
    gap: 7px !important;
    flex-shrink: 0 !important;
  }

  .brand-logo-img {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    border-radius: 8px !important;
  }

  .brand-title {
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: -0.2px !important;
    line-height: 1.1 !important;
  }

  .brand-sub {
    font-size: 8px !important;
    letter-spacing: 0.3px !important;
    line-height: 1 !important;
  }

  /* Header Right Actions */
  .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }

  /* CRITICAL: HIDE PC Login & Desktop Search on Mobile Mini App! */
  #btnPcLogin,
  .btn-pc-login,
  .nav-search-btn,
  #desktopNavBar {
    display: none !important;
  }

  /* Compact Theme Toggle */
  .btn-theme-toggle {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    padding: 0 !important;
  }
  .btn-theme-toggle svg {
    width: 13px !important;
    height: 13px !important;
  }

  /* Ultra-Sleek Mobile VIP Pill Badge */
  .vip-status-pill-badge {
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    border-radius: 14px !important;
    gap: 4px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .vip-status-pill-badge svg,
  .crown-gold-icon {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
  }

  .vip-status-pill-badge span,
  #headerVipLabel {
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }

  /* Mobile Avatar (Always visible, NEVER clipped) */
  .header-avatar-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    border-radius: 50% !important;
    border: 1.5px solid var(--border-gold) !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }

  .header-avatar-img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
  }
}

/* Light Theme Perfection for Header */
body.theme-light .global-navbar {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .brand-title {
  color: #0f172a !important;
}

body.theme-light .vip-status-pill-badge {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border: 1.2px solid #f59e0b !important;
  color: #b45309 !important;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15) !important;
}

body.theme-light .btn-theme-toggle {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.theme-dark .vip-status-pill-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.12) 100%) !important;
  border: 1.2px solid rgba(245, 158, 11, 0.6) !important;
  color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25) !important;
}

/* ==========================================================================
   PROFILE CARD LOGOUT & DESKTOP HEADER LOGOUT BUTTONS
   ========================================================================== */

.profile-card-pro {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  padding: 16px 20px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  margin-bottom: 16px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}

.profile-card-left {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  flex: 1 !important;
  min-width: 220px !important;
}

.profile-card-right {
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.btn-profile-logout-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 9px 18px !important;
  border-radius: 20px !important;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1.2px solid rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
}

.btn-profile-logout-pill:hover {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: #ef4444 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3) !important;
}

/* Header Logout Button on Desktop */
.btn-header-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-header-logout.hidden {
  display: none !important;
}

.btn-header-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  transform: translateY(-1px);
}

@media (max-width: 767px) {
  .btn-header-logout {
    display: none !important;
  }
}


/* ==========================================================================
   Masterpiece Mobile Bottom Navigation Bar & Header Responsiveness
   ========================================================================== */
.btn-mobile-login {
  display: none;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease;
}
.btn-mobile-login:active {
  transform: scale(0.95);
}

@media (max-width: 640px) {
  #googleAuthContainer {
    display: none !important;
  }
  .btn-mobile-login {
    display: inline-flex !important;
  }
  .header-actions {
    gap: 4px !important;
  }
  .brand-title {
    font-size: 13px !important;
  }
  .brand-sub {
    display: none !important;
  }
}

/* Bottom Navigation Removed (Navigation handled by modern Hamburger Drawer) */
.bottom-nav,
.bottom-dock-clearance {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
}

/* Apple Dynamic Touch Press State */
.btn-primary:active,
.btn-gold:active,
.nav-item:active,
.genre-chip-tab:active,
.server-pill-btn:active,
.header-action-btn:active,
.ep-btn:active {
  transform: scale(0.96) !important;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1) !important;
}

.drama-card {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease !important;
  will-change: transform, box-shadow;
}
.drama-card:hover {
  transform: translateY(-4px) scale(1.018);
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.55), 0 0 1px 1px rgba(245, 158, 11, 0.25);
}
.drama-card:active {
  transform: scale(0.96) !important;
}

.bottom-nav .nav-item {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  background: none !important;
  border: none !important;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 2px;
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

body.theme-light .bottom-nav .nav-item {
  color: #64748b !important;
}

.bottom-nav .nav-item:active {
  transform: scale(0.92);
}

.bottom-nav .nav-item.active {
  color: #f59e0b !important;
}

body.theme-light .bottom-nav .nav-item.active {
  color: #d97706 !important;
}

.bottom-nav .nav-icon-wrap {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav .nav-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.bottom-nav .nav-item.active .nav-icon {
  transform: translateY(-1px);
  color: var(--gold-primary);
  stroke: var(--gold-primary);
}

.bottom-nav .nav-label {
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.1;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bottom-nav .nav-dot-badge {
  position: absolute;
  top: -4px;
  right: -7px;
  padding: 1px 3px;
  border-radius: 4px;
  font-size: 7.5px;
  font-weight: 800;
  color: #fff;
  background: var(--gold-primary);
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}


/* ==========================================================================
   PERFECT RESPONSIVE DESIGN FOR MEDIUM SCREENS (768px - 1280px) & DESKTOP
   ========================================================================== */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

.global-navbar {
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

.global-navbar-container {
  max-width: 1440px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 0 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.header-brand {
  flex-shrink: 0 !important;
}

@media (max-width: 767px) {
  #desktopNavBar {
    display: none !important;
  }
}

body.is-telegram #desktopNavBar {
  display: none !important;
}

@media (min-width: 768px) {
  #desktopNavBar {
    display: flex !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  .desktop-nav-inner {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
  }
  .desktop-nav-inner::-webkit-scrollbar {
    display: none !important;
  }
}

.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

/* Medium screen adjustments (768px - 1180px) */
@media (min-width: 768px) and (max-width: 1180px) {
  .desktop-nav-item {
    padding: 6px 8px !important;
    font-size: 12px !important;
    gap: 4px !important;
  }
  .nav-svg-icon {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
  }
  .desktop-badge {
    display: none !important;
  }
  .nav-search-text {
    display: none !important;
  }
  .nav-search-btn {
    padding: 6px 10px !important;
    border-radius: 50% !important;
  }
  .brand-sub {
    display: none !important;
  }
  .brand-title {
    font-size: 13.5px !important;
  }
  .global-navbar-container {
    padding: 0 10px !important;
    gap: 6px !important;
  }
}

/* Screen width <= 920px: Collapse less critical links */
@media (min-width: 768px) and (max-width: 960px) {
  .desktop-nav-item[data-view="downloads"],
  .desktop-nav-item[data-view="services"] {
    display: none !important;
  }
}

/* Prevent any horizontal page overflow */
.main-content,
.app-container,
.hero-slider-wrap,
.hero-3d-slider-container {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Strictly hide Admin Button on Mobile & Telegram Mini App */
@media (max-width: 768px) {
  #btnSecretAdminNav {
    display: none !important;
  }
}

/* Hide Admin Button on Mobile phones & Telegram Mini App */
@media (max-width: 768px) {
  #btnSecretAdminNav,
  .btn-admin-nav,
  .admin-desktop-only {
    display: none !important;
  }
}

/* Fintech Luxury KHQR Modal Hierarchy & Stacking Fixes */
#khqrModal {
  z-index: 999999 !important;
}

#iqiyiDramaPreviewModal,
#iqiyiEpisodesModal,
#aiDramaBuyModal {
  z-index: 10000 !important;
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}


/* ==========================================================================
   MOBILE HAMBURGER MENU & NATIVE-APP SLIDE-OUT DRAWER (PWA READY)
   ========================================================================== */

/* 1. Hamburger Toggle Button (High Contrast in Both Light & Dark Themes) */
.btn-hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.btn-hamburger-menu:active {
  transform: scale(0.92);
  background: rgba(245, 158, 11, 0.22) !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
}

.hamburger-bar {
  display: block;
  width: 20px;
  height: 2.4px;
  background: #ffffff !important;
  border-radius: 4px;
  transition: all 0.25s ease;
}

/* Pristine High Contrast for Light Mode */
body.theme-light .btn-hamburger-menu,
body.light-mode .btn-hamburger-menu,
[data-theme="light"] .btn-hamburger-menu {
  background: rgba(15, 23, 42, 0.08) !important;
  border: 1.5px solid rgba(15, 23, 42, 0.25) !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08) !important;
}

body.theme-light .hamburger-bar,
body.light-mode .hamburger-bar,
[data-theme="light"] .hamburger-bar {
  background: #0f172a !important;
}

body.theme-light .btn-hamburger-menu:active,
body.light-mode .btn-hamburger-menu:active,
[data-theme="light"] .btn-hamburger-menu:active {
  background: rgba(217, 119, 6, 0.15) !important;
  border-color: rgba(217, 119, 6, 0.5) !important;
}

/* 2. Slide-out Drawer & Backdrop */
.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10010;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  background: #0d121f;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  z-index: 10020;
  display: flex;
  flex-direction: column;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.mobile-nav-drawer.active {
  transform: translateX(-320px);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(15, 23, 42, 0.6);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.drawer-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
}

.drawer-brand-text {
  display: flex;
  flex-direction: column;
}

.drawer-brand-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.drawer-brand-sub {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #f59e0b;
}

.drawer-close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
}

.drawer-close-btn:active {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.drawer-close-btn svg {
  width: 18px;
  height: 18px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 80px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* User Card in Drawer */
.drawer-user-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1.5px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.drawer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.drawer-user-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-badge-normal {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.drawer-badge-vip {
  font-size: 10px;
  font-weight: 800;
  color: #f59e0b;
  letter-spacing: 0.5px;
}

.drawer-user-actions {
  display: flex;
  gap: 8px;
}

.btn-drawer-login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 9px;
  color: #000;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.btn-drawer-logout {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 9px;
  color: #ef4444;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

/* PWA App Install Banner */
.drawer-pwa-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.drawer-pwa-card:active {
  transform: scale(0.98);
}

.pwa-card-icon img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

.pwa-card-text {
  flex: 1;
  min-width: 0;
}

.pwa-card-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #f59e0b;
}

.pwa-card-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-card-action {
  font-size: 11px;
  font-weight: 800;
  background: #f59e0b;
  color: #000;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Drawer Section Titles & Nav Items */
.drawer-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 6px;
  padding-left: 4px;
}

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}

.drawer-nav-item:active {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.drawer-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #94a3b8;
}

.drawer-nav-item:hover .drawer-nav-icon,
.drawer-nav-item:active .drawer-nav-icon {
  color: #f59e0b;
}

.drawer-nav-label {
  flex: 1;
}

.drawer-badge-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}

.drawer-badge-pill.green {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
}

.drawer-badge-pill.red {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}

.drawer-badge-pill.gold {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
}

.drawer-admin-item {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.08)) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

/* ==========================================================================
   CLEAN MOBILE NAVBAR: CONDENSE HEADER PILLS INTO HAMBURGER MENU
   ========================================================================== */
@media (max-width: 768px) {
  /* Show Hamburger Menu Button */
  .btn-hamburger-menu {
    display: flex !important;
  }

  /* Hide crowded items from mobile top bar */
  #btnThemeToggle,
  .btn-community-pill,
  #btnSecretAdminNav,
  #googleAuthContainer,
  #btnPcLogin,
  #btnMobileLogin,
  #btnHeaderLogout,
  #btnHeaderVip,
  #headerUserAvatar {
    display: none !important;
  }

  /* Keep Search Button neat */
  .nav-search-btn {
    padding: 6px 10px !important;
    max-width: 110px !important;
  }
}

@media (min-width: 769px) {
  .btn-hamburger-menu {
    display: none !important;
  }
  .mobile-drawer-overlay,
  .mobile-nav-drawer {
    display: none !important;
  }
}


/* ==========================================================================
   ULTRA-PREMIUM GLOBAL RESPONSIVE DESIGN & LUXURY ANIMATION SYSTEM
   (Mobile Phone • Tablet • PC • Telegram Mini App 100% Fluid Scaling)
   ========================================================================== */

/* 1. Global Viewport & Ambient Deep Obsidian Styling */
body.theme-dark {
  background-color: #060913 !important;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245, 158, 11, 0.09), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(56, 189, 248, 0.05), transparent),
    radial-gradient(circle at 10% 90%, rgba(225, 29, 72, 0.04), transparent) !important;
  background-attachment: fixed !important;
  color: #f8fafc;
}

/* 2. Brand Vector SVG Emblem */
.brand-vector-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 11px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
  cursor: pointer;
}
.brand-vector-emblem:hover {
  transform: scale(1.06) rotate(-1deg);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.45);
}

/* 3. Fluid Responsive Layout (Scales automatically on any screen) */
.app-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.main-content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(10px, 2.5vw, 28px);
  box-sizing: border-box;
}

/* 4. Fluid Card Grids - Never clips or stretches weirdly */
.drama-grid,
.donghua-grid,
.iqiyi-grid,
.catalog-grid,
.grid-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(clamp(130px, 21vw, 190px), 1fr)) !important;
  gap: clamp(10px, 1.8vw, 20px) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Drama Card Ultra-Modern Glassmorphic Polish */
.drama-card,
.donghua-card,
.iqiyi-card {
  border-radius: 14px !important;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.26s ease, border-color 0.26s !important;
  overflow: hidden !important;
}

.drama-card:hover,
.donghua-card:hover,
.iqiyi-card:hover {
  transform: translateY(-5px) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.75), 0 0 20px rgba(245, 158, 11, 0.18) !important;
}

.drama-card:active,
.donghua-card:active,
.iqiyi-card:active {
  transform: scale(0.97) !important;
}

/* Card Poster Wrappers & Badges */
.card-poster-wrap {
  border-radius: 12px 12px 6px 6px !important;
  overflow: hidden !important;
}

.free-donghua-badge {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

/* 5. Banking-Grade KHQR Modal Styling */
.khqr-luxury-modal {
  border-radius: 22px !important;
  overflow: hidden !important;
  background: #0b101d !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85), 0 0 40px rgba(225, 29, 72, 0.25) !important;
  border: 1.5px solid rgba(225, 29, 72, 0.45) !important;
  animation: khqrPopIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes khqrPopIn {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(24px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.khqr-receipt-cutout {
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 12px;
  background-image: radial-gradient(circle at 10px 0, transparent 8px, #0c111e 9px);
  background-size: 20px 12px;
}

.khqr-scanner-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.khqr-scanner-card:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.55);
}

.bank-pill-mini {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.2px;
  transition: all 0.15s ease;
}
.bank-pill-mini:hover {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.btn-download-khqr,
.btn-bakong-tap {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-download-khqr:hover,
.btn-bakong-tap:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}
.btn-download-khqr:active,
.btn-bakong-tap:active {
  transform: scale(0.96);
}

/* 6. Telegram Mini App & Safe Area Adaptation */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }
  .mobile-nav-drawer {
    padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
  }
}

/* 7. Modern Sleek Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(11, 15, 25, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   Apple iOS 27 Cutting-Edge Liquid Glass (ត្រណក់ទឹក) Design System
   Spatial VisionOS & Liquid Acrylic Evolution | Specular Reflection | Floating Dock
   ========================================================================== */

/* 1. Global Floating Dynamic Island Header (Mobile & Telegram WebApp) */
@media (max-width: 767px) {
  .app-header.global-navbar {
    position: sticky !important;
    top: max(8px, env(safe-area-inset-top, 8px)) !important;
    margin: 8px 12px 14px 12px !important;
    border-radius: 9999px !important;
    padding: 6px 14px !important;
    height: auto !important;
    min-height: 52px !important;
    background: rgba(13, 19, 33, 0.75) !important;
    backdrop-filter: blur(36px) saturate(210%) !important;
    -webkit-backdrop-filter: blur(36px) saturate(210%) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45), inset 0 1px 1.5px rgba(255, 255, 255, 0.3) !important;
    z-index: 999 !important;
  }

  body.theme-light .app-header.global-navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08), inset 0 1px 1.5px rgba(255, 255, 255, 0.9) !important;
  }

  /* 2. Full-Screen Modern App Layout on Mobile (Bottom Nav Removed in Favor of Hamburger Drawer) */
  .bottom-nav,
  .bottom-dock-clearance {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
  }

  .main-content {
    padding-bottom: max(36px, env(safe-area-inset-bottom, 36px)) !important;
  }
  .view-panel {
    padding-bottom: 24px !important;
  }
  .drama-grid,
  .donghua-grid,
  .iqiyi-grid,
  .catalog-grid,
  #dramasGrid,
  #donghuaGrid,
  #aiKhmerGrid,
  #searchGrid {
    margin-bottom: 20px !important;
  }
}

/* 2B. Guaranteed Desktop PC Website View (>= 768px outside Telegram) */
@media (min-width: 768px) {
  .bottom-nav,
  body .bottom-nav,
  html .bottom-nav,
  .hide-on-pc,
  html:not(.is-telegram) .bottom-nav,
  body:not(.is-telegram) .bottom-nav,
  html.is-desktop-website .bottom-nav,
  body.is-desktop-website .bottom-nav,
  body.is-desktop-platform .bottom-nav {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
  }
  .bottom-dock-clearance,
  html:not(.is-telegram) .bottom-dock-clearance,
  body:not(.is-telegram) .bottom-dock-clearance {
    display: none !important;
    height: 0 !important;
  }
  #desktopNavBar,
  html:not(.is-telegram) #desktopNavBar,
  body:not(.is-telegram) #desktopNavBar {
    display: flex !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    margin: 0 16px !important;
    height: 100% !important;
  }
  .btn-hamburger-menu,
  html:not(.is-telegram) .btn-hamburger-menu,
  body:not(.is-telegram) .btn-hamburger-menu {
    display: none !important;
  }
}

/* 3. Liquid Glass Buttons (Water Droplet Specular Highlights) */
.btn-primary,
.btn-gold,
.btn-download-hero,
.hero-play-btn,
.btn-pc-login,
.btn-mobile-login,
.btn-verify-pay {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 60%, #d97706 100%) !important;
  color: #0b0f19 !important;
  font-family: var(--font-khmer) !important;
  font-weight: 700 !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4), inset 0 1px 1.5px rgba(255, 255, 255, 0.6) !important;
  border-radius: 9999px !important;
  transition: all 0.22s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.btn-primary:hover,
.btn-gold:hover,
.btn-download-hero:hover,
.hero-play-btn:hover,
.btn-pc-login:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.55), inset 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

.btn-primary:active,
.btn-gold:active,
.btn-download-hero:active,
.hero-play-btn:active,
.btn-pc-login:active {
  transform: scale(0.96) !important;
  filter: brightness(1.1) !important;
}

/* 4. Translucent Frosted Secondary Buttons (1/2 blur ត្រណក់ទឹក) */
.btn-secondary,
.btn-download-poster,
.btn-header-logout,
.btn-theme-toggle,
.btn-community-pill,
.genre-chip-tab,
.search-input-box,
.nav-search-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.25) !important;
  border-radius: 9999px !important;
  transition: all 0.22s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

body.theme-light .btn-secondary,
body.theme-light .btn-download-poster,
body.theme-light .btn-header-logout,
body.theme-light .btn-theme-toggle,
body.theme-light .btn-community-pill,
body.theme-light .genre-chip-tab,
body.theme-light .search-input-box,
body.theme-light .nav-search-btn {
  background: rgba(255, 255, 255, 0.75) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
}

/* 5. Liquid Chips / Segmented Control Tabs */
.genre-chips-scroll {
  display: flex !important;
  gap: 8px !important;
  padding: 8px 4px 14px 4px !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
}
.genre-chips-scroll::-webkit-scrollbar {
  display: none !important;
}

.genre-chip-tab {
  padding: 8px 16px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  border-radius: 9999px !important;
  background: rgba(30, 41, 59, 0.75) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
}

.genre-chip-tab .chip-svg-icon {
  width: 14px !important;
  height: 14px !important;
  stroke: currentColor !important;
  flex-shrink: 0 !important;
}

body.theme-light .genre-chip-tab {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}

body.theme-light .genre-chip-tab .chip-svg-icon {
  stroke: #64748b !important;
  color: #64748b !important;
}

.genre-chip-tab.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #0b0f19 !important;
  font-weight: 700 !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
  transform: translateY(-1px) scale(1.02) !important;
}

body.theme-light .genre-chip-tab.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35) !important;
}

.genre-chip-tab.active .chip-svg-icon {
  stroke: currentColor !important;
  color: currentColor !important;
}

/* 6. Liquid Glass Cards & Modals */
.drama-card {
  background: rgba(18, 25, 42, 0.65) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38), inset 0 1px 1px rgba(255, 255, 255, 0.22) !important;
  overflow: hidden !important;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.drama-card:hover {
  transform: translateY(-4px) scale(1.02) !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.6), 0 0 24px rgba(245, 158, 11, 0.25), inset 0 1px 1.5px rgba(255, 255, 255, 0.4) !important;
}

.card-poster-wrap {
  border-radius: 16px 16px 8px 8px !important;
}

.vip-status-card,
.vip-plan-card,
.modal-dialog {
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border-radius: 22px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), inset 0 1px 1.5px rgba(255, 255, 255, 0.25) !important;
}

body.theme-light .drama-card,
body.theme-light .vip-status-card,
body.theme-light .vip-plan-card,
body.theme-light .modal-dialog {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
}

/* 7. Video Player Episode Pills (Liquid Glass Numbers) */
.ep-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  color: #cbd5e1 !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.15) !important;
}

.ep-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  transform: translateY(-2px) !important;
}

.ep-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #0b0f19 !important;
  font-weight: 700 !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.6) !important;
}

/* 8. Apple Typography Refinement */
body, button, input, select, textarea {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Outfit", "Kantumruy Pro", sans-serif !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}
