/* ========================================
   BLUVIA — Home (After Login)
   ======================================== */

/* ── Sidebar ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 200px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: var(--space-lg);
  display: flex; flex-direction: column;
  z-index: 50;
  overflow: hidden;
}
.sidebar .logo {
  display: flex; align-items: center; gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  padding: 0 var(--space-sm);
}
.sidebar .logo-img {
  height: 32px;
  width: 32px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.sidebar .logo-text { font-weight: 800; font-size: var(--fs-lg); letter-spacing: 0.5px; }

/* User Profile */
.sidebar-profile {
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  text-align: center;
}
.sidebar-profile .avatar {
  width: 48px; height: 48px;
  margin: 0 auto var(--space-sm);
}
.sidebar-profile .profile-info { min-width: 0; }
.sidebar-profile .profile-greeting {
  font-size: var(--fs-sm); font-weight: 600;
  line-height: 1.4;
}
.sidebar-profile .profile-sub {
  font-size: var(--fs-xs); color: var(--text-secondary);
  margin-top: 2px;
}
.sidebar-profile .login-link {
  display: inline-block;
  margin-top: var(--space-sm);
  padding: 0.35rem 1rem;
  background: var(--accent-gradient);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all 0.2s;
}
.sidebar-profile .login-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* Upgrade Card */
.sidebar-upgrade {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md);
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(37,99,235,0.08));
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar-upgrade:hover { background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(37,99,235,0.12)); }
.sidebar-upgrade-left {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: var(--fs-sm); font-weight: 600;
}
.sidebar-upgrade-sub { font-size: var(--fs-xs); color: var(--text-secondary); display: block; font-weight: 400; }
.sidebar-upgrade svg { color: var(--accent); }

/* Menu */
.sidebar-menu-label {
  font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0 var(--space-sm);
  margin-bottom: var(--space-sm);
}
.sidebar-menu { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--space-xl); }
.sidebar-menu a {
  display: flex; align-items: center; gap: var(--space-md);
  padding: 0.55rem var(--space-sm);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm); color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s;
}
.sidebar-menu a:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.sidebar-menu a.active { color: var(--text-primary); background: rgba(59,130,246,0.1); }
.sidebar-menu a svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Dark Mode Toggle */
.sidebar-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm);
  font-size: var(--fs-sm); color: var(--text-secondary);
}
.toggle-switch {
  width: 40px; height: 22px;
  background: var(--accent);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-switch::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: var(--radius-full);
  transition: transform 0.2s;
}
.toggle-switch.off { background: var(--text-muted); }
.toggle-switch.off::after { transform: translateX(18px); }

/* Sidebar bottom */
.sidebar-bottom { margin-top: auto; }

.sidebar-download {
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin-top: var(--space-md);
}
.sidebar-download p { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 2px; }
.sidebar-download .sub { font-size: var(--fs-xs); color: var(--text-secondary); margin-bottom: var(--space-sm); }
.sidebar-download .store-badges { display: flex; gap: var(--space-sm); }
.sidebar-download .store-badge {
  padding: 0.35rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  display: flex; align-items: center; gap: 4px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.sidebar-download .store-badge:hover { border-color: var(--accent); color: var(--text-primary); }

/* ── Hamburger Button (mobile) ── */
.hamburger-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-primary); padding: 6px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.hamburger-btn:hover { background: var(--bg-card); }
.hamburger-btn svg { width: 22px; height: 22px; }

/* ── Sidebar Overlay (mobile) ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 49;
  opacity: 0; transition: opacity 0.3s;
}
.sidebar-overlay.active { display: block; opacity: 1; }
body.sidebar-open { overflow: hidden; }

/* ── Main Area ── */
.home-main {
  margin-left: 200px;
  min-height: 100vh;
  padding-top: 0;
}

/* ── Top Navbar ── */
.top-nav {
  position: sticky; top: 12px; z-index: 40;
  height: 64px;
  margin: 12px 0 0;
  background: rgba(6, 10, 20, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 var(--space-xl);
}
.top-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}
.top-nav-left {
  display: flex; align-items: center; gap: var(--space-xl);
}
.top-nav-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.top-nav-logo:hover { opacity: 0.9; }
.top-nav-links {
  display: flex; align-items: center; gap: var(--space-xl);
}
.top-nav-links a {
  font-size: var(--fs-sm); color: var(--text-secondary);
  font-weight: 500; transition: color 0.2s;
  position: relative;
}
.top-nav-links a:hover, .top-nav-links a.active { color: var(--text-primary); }
.top-nav-links a.active::after {
  content: '';
  position: absolute; bottom: -20px; left: 0; right: 0;
  height: 2px; background: var(--accent);
}
.top-nav-right {
  display: flex; align-items: center; gap: var(--space-md);
}
.top-nav-right .notification-btn {
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}
.top-nav-right .notification-btn:hover { color: var(--text-primary); }
.top-nav-right .notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-card);
}
.user-menu {
  display: flex; align-items: center; gap: var(--space-sm);
  cursor: pointer;
}
.user-menu .avatar { width: 32px; height: 32px; }
.user-menu span { font-size: var(--fs-sm); font-weight: 600; }

/* ── Top Nav User Area ── */
.top-nav-user {
  display: flex; align-items: center; gap: var(--space-sm);
}
.nav-action-btn {
  font-size: var(--fs-xs) !important;
  padding: 0.35rem 0.85rem !important;
  text-decoration: none;
}
.nav-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: transform 0.2s;
}
.nav-avatar:hover { transform: scale(1.08); }

/* ── Home Content ── */
.home-content {
  padding: var(--space-xl);
  padding-right: 320px;
}

/* ── Carousel constraint ── */

/* Poster sections: mepet sidebar kanan */
.home-content > section .carousel-wrap {
  margin-right: -300px;
}
.home-content > section .h-scroll {
  width: calc(100% + 300px);
}

/* Hero Banner */
.home-hero {
  background: linear-gradient(135deg, #0c0e1a 0%, #111328 50%, #0a0c18 100%);
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-2xl);
  
  height: 350px;
  display: flex;
}
.hero-slide {
  display: grid; grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
  position: relative;
}
.hero-slide-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(6,10,20,0.92) 0%, rgba(15,12,35,0.5) 50%, rgba(6,10,20,0.3) 100%),
              url('') right center/cover no-repeat;
}
.hero-slide-left {
  position: absolute; bottom: 0; left: 0; z-index: 1;
  padding: var(--space-2xl);
  display: flex; flex-direction: column; justify-content: flex-end;
  height: 100%;
  box-sizing: border-box;
}
.hero-slide-left .badge { align-self: flex-start; margin-bottom: var(--space-lg); }
.hero-slide-left h2 {
  font-size: var(--fs-3xl); font-weight: 800; margin-bottom: var(--space-sm);
}
.hero-slide-left .ep-label { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--space-md); }
.hero-slide-left .desc {
  font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.7;
  max-width: 420px; margin-bottom: var(--space-xl);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions {
  display: flex; gap: var(--space-sm); margin-top: var(--space-sm); flex-wrap: wrap;
}
.hero-slide-right {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-xl);
}
.hero-nav {
  position: absolute; bottom: var(--space-lg); left: 50%; transform: translateX(-50%);
  z-index: 2;
  display: flex; gap: var(--space-sm);
}
.hero-nav-btn {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  transition: all 0.25s var(--ease);
}
.hero-nav-btn:hover { background: rgba(99, 102, 241, 0.3); border-color: rgba(99, 102, 241, 0.4); box-shadow: 0 0 20px rgba(99, 102, 241, 0.2); }

/* Right sidebar */
.home-aside {
  position: fixed; right: 0.5rem; top: 80px;
  width: 280px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  z-index: 30;
}
.ranking-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
}
.ranking-card .section-header { margin-bottom: var(--space-md); }
.ranking-item {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-sm) 0;
}
.ranking-item + .ranking-item { border-top: 1px solid var(--border); }
.ranking-num {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: var(--fs-sm);
  flex-shrink: 0;
}
.ranking-num.top1 { background: #f59e0b; color: #000; font-size: var(--fs-base); }
.ranking-num.top2 { background: #94a3b8; color: #000; font-size: var(--fs-base); }
.ranking-num.top3 { background: #d97706; color: #000; font-size: var(--fs-base); }
.ranking-num.other { background: var(--bg-secondary); color: var(--text-muted); }
.ranking-thumb {
  width: 44px; height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover; background: var(--bg-secondary); flex-shrink: 0;
}
.ranking-info { min-width: 0; }
.ranking-title { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-ep { font-size: var(--fs-xs); color: var(--text-secondary); }

/* Premium Ad */
.premium-ad {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-top: var(--space-lg);
}
.premium-ad h3 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--space-sm); }
.premium-ad p { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--space-lg); line-height: 1.6; }
.premium-features { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.premium-feat {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: var(--fs-sm); color: var(--text-secondary);
}
.premium-feat svg { color: var(--accent); flex-shrink: 0; }

/* Download Ad */
.download-ad {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-top: var(--space-lg);
  text-align: center;
}
.download-ad h3 { font-size: var(--fs-md); font-weight: 700; margin-bottom: var(--space-xs); }
.download-ad p { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--space-lg); }
.qr-placeholder {
  width: 120px; height: 120px;
  background: #fff;
  border-radius: var(--radius-md);
  margin: 0 auto var(--space-md);
  display: flex; align-items: center; justify-content: center;
  color: #000; font-size: var(--fs-xs); font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

/* Hide right sidebar on smaller screens */
@media (max-width: 1200px) {
  .home-aside { display: none; }
}

/* Tablet: sidebar becomes drawer */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .home-main { margin-left: 0; }
  .hamburger-btn { display: flex; align-items: center; }
}

/* Mobile */
@media (max-width: 768px) {
  .top-nav { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; z-index: 100; margin: 0 !important; width: 100% !important; border-radius: 0 !important; }
  .home-main { padding-top: 64px; }
  .hero-slide { grid-template-columns: 1fr; }
  .hero-slide-right { display: none; }
  .top-nav-links { display: none; }
  .top-nav { padding: 0 var(--space-md) !important; }
  .home-content { padding: var(--space-md); padding-right: var(--space-xl); }
  .top-nav-right { gap: 6px !important; flex: 1 !important; justify-content: flex-end !important; min-width: 0 !important; overflow: hidden !important; }  .top-nav-right .btn { padding: 0.4rem 0.7rem !important; font-size: var(--fs-xs) !important; white-space: nowrap; }  .top-nav-right .user-menu span { display: none !important; }  .top-nav-right .user-menu svg:last-of-type { display: none !important; }  .search-bar { width: 0 !important; flex: 1 !important; min-width: 0 !important; }
  .search-bar { flex: 1 !important; min-width: 0 !important; }
  .user-menu span { display: none; }
  .home-hero {
  background: linear-gradient(135deg, #0c0e1a 0%, #111328 50%, #0a0c18 100%); border-radius: var(--radius-lg); height: 260px; }
  .hero-slide-left { padding: var(--space-lg) var(--space-md); padding-right: 50px; }
  .hero-slide-left h2 { font-size: 1.2rem !important; margin-bottom: 2px; line-height: 1.2; }
  .hero-slide-left .ep-label { margin-bottom: var(--space-sm); }
  .hero-slide-left .desc { -webkit-line-clamp: 2; font-size: var(--fs-xs); max-width: 100%; margin-bottom: var(--space-sm); line-height: 1.5; }
  .hero-actions { gap: 8px; margin-top: var(--space-xs); }
  .hero-actions .btn { padding: 0.45rem 0.9rem; font-size: var(--fs-xs); }
  .h-scroll { padding-left: var(--space-md); padding-right: var(--space-xl); }
}

@media (max-width: 480px) {
  .home-content { padding: var(--space-sm); padding-right: var(--space-sm); }
  .section-title { font-size: var(--fs-md); }
  .hero-slide-left .hero-content h2 { font-size: 1.1rem; }
  .hero-actions { justify-content: center !important; margin-top: var(--space-md) !important; }  .top-nav-right .notification-btn { display: none !important; }
  .hero-slide-left .hero-actions .btn { padding: 0.5rem 0.85rem; font-size: var(--fs-xs); }
  .h-scroll { padding-left: var(--space-sm); padding-right: var(--space-sm); }
}

/* Mobile poster fix: horizontal scroll instead of tiny grid */
@media (max-width: 768px) {
  .h-scroll.genre-grid {
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: unset !important;
    gap: 12px !important;
    padding-bottom: 8px;
  }
  .h-scroll.genre-grid > * {
    flex-shrink: 0;
    min-width: 130px;
    max-width: 130px;
    scroll-snap-align: start;
  }
  .h-scroll.genre-grid .poster-card {
    width: 130px !important;
    aspect-ratio: 2/3 !important;
  }
}

@media (max-width: 480px) {
  .h-scroll.genre-grid {
    gap: 10px !important;
  }
  .h-scroll.genre-grid > * {
    min-width: 120px;
    max-width: 120px;
  }
  .h-scroll.genre-grid .poster-card {
    width: 120px !important;
  }
}

/* ── Compact ranking fix ── */
.ranking-card {
  padding: var(--space-md) !important;
}
.ranking-card .section-header {
  margin-bottom: var(--space-sm) !important;
}
.ranking-item {
  gap: 10px !important;
  padding: 6px 0 !important;
}
.ranking-num {
  width: 24px !important;
  height: 24px !important;
  font-size: var(--fs-xs) !important;
}
.ranking-num.top1,
.ranking-num.top2,
.ranking-num.top3 {
  font-size: var(--fs-sm) !important;
}
.ranking-thumb {
  width: 40px !important;
  height: 54px !important;
  border-radius: var(--radius-sm) !important;
}
.ranking-title {
  font-size: var(--fs-xs) !important;
  line-height: 1.3;
}
.ranking-ep {
  font-size: 0.65rem !important;
  margin-top: 1px;
}

/* Sidebar taller to fit all ranking items */
.home-aside {
  max-height: calc(100vh - 80px) !important;
}

/* Search results grid */
.search-grid .poster-card {
  width: 100% !important;
  flex-shrink: unset !important;
  aspect-ratio: 2/3;
}
.search-grid .poster-card .poster-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}

/* ── Mobile: hide fixed right sidebar completely ── */
@media (max-width: 1200px) {
  .home-aside {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* ── Mobile: aside not fixed, stacked below content ── */
@media (max-width: 1200px) {
  .home-aside {
    position: static !important;
    width: 100% !important;
    right: auto !important;
    top: auto !important;
    max-height: none !important;
    display: none !important;
    z-index: auto !important;
  }
}

/* Mobile: hide hero nav arrows (swipe is more natural) */
@media (max-width: 768px) {
  .hero-nav { display: none !important; }
  .hero-slide-left { padding: var(--space-xl) var(--space-lg); padding-right: 20px; }
}
/* Mobile hamburger button */
.mobile-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary, #e2e8f0);
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-hamburger:active {
  background: rgba(255,255,255,0.15);
}
@media (max-width: 768px) {
  .mobile-hamburger { display: flex; }
}



/* Mobile Bottom Navbar - unified with home style */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(6, 10, 20, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
  justify-content: space-around;
  align-items: center;
}

/* Bottom nav - matching root style.css design */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(6, 10, 20, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted, #66667a);
  transition: color 0.2s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.nav-item.active {
  color: var(--accent, #5b6ef5);
}
.nav-item svg {
  width: 22px;
  height: 22px;
}
.nav-item.active svg {
  filter: drop-shadow(0 0 8px var(--accent-glow, rgba(91,110,245,0.25)));
}
body {
  padding-bottom: 68px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item.active {
  color: var(--accent);
}
.bottom-nav-item svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  .bottom-nav { display: flex; }
}

/* Desktop: bottom-nav is mobile-only — sidebar + top-nav take over */
@media (min-width: 769px) {
  .bottom-nav { display: none !important; }
  body { padding-bottom: 0 !important; }
}

/* Hide chat widget on ALL viewports */
.chat-widget { display: none !important; }

/* Mobile bottom nav padding */
@media (max-width: 768px) {
  body { padding-bottom: 70px !important; }
}

/* Light mode: hero text always white (hero bg stays dark) */
body.light-mode .hero-slide-left h2 { color: #fff !important; }
body.light-mode .hero-slide-left .hero-year { color: rgba(255,255,255,0.6) !important; }
body.light-mode .hero-slide-left .ep-meta { color: #fff !important; }
body.light-mode .hero-slide-left .ep-label { color: rgba(255,255,255,0.7) !important; }
body.light-mode .hero-slide-left .desc { color: rgba(255,255,255,0.75) !important; }
body.light-mode .hero-slide-left .ep-genres span { color: rgba(255,255,255,0.8) !important; }
body.light-mode .hero-nav-btn { background: rgba(255,255,255,0.15); color: #fff; }


/* ── Light Mode Overrides ── */
body.light-mode .top-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .home-hero {
  background: linear-gradient(135deg, #e8eaf0 0%, #f0f2f5 50%, #e8eaf0 100%);
}
body.light-mode .home-hero .hero-slide-bg {
  background: linear-gradient(135deg, rgba(248,249,252,0.92) 0%, rgba(240,242,245,0.5) 50%, rgba(248,249,252,0.3) 100%),
              url('') right center/cover no-repeat;
}
body.light-mode .sidebar {
  background: #ffffff;
  border-right-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .sidebar-menu a:hover {
  background: rgba(0, 0, 0, 0.04);
}
body.light-mode .sidebar-menu a.active {
  background: rgba(99, 102, 241, 0.08);
}
body.light-mode .sidebar-upgrade {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(79,70,229,0.04));
  border-color: rgba(99,102,241,0.15);
}
body.light-mode .ranking-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .premium-ad {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .download-ad {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-mode .home-content {
  color: #1a1d26;
}
body.light-mode .section-title {
  color: #1a1d26;
}
body.light-mode .section-link {
  color: #6366f1;
}
body.light-mode .poster-card .poster-title {
  color: #1a1d26;
}
body.light-mode .poster-card .poster-meta {
  color: #64748b;
}
body.light-mode .ranking-title {
  color: #1a1d26;
}
body.light-mode .ranking-ep {
  color: #64748b;
}
body.light-mode .hero-slide-left h2 {
  color: #1a1d26 !important;
}
body.light-mode .hero-slide-left .hero-year {
  color: #64748b !important;
}
body.light-mode .hero-slide-left .ep-label {
  color: #94a3b8 !important;
}
body.light-mode .hero-slide-left .desc {
  color: #64748b !important;
}
body.light-mode .hero-nav-btn {
  background: rgba(0, 0, 0, 0.08);
  color: #1a1d26;
  border-color: rgba(0, 0, 0, 0.12);
}
body.light-mode .hero-nav-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}
body.light-mode .badge-new {
  background: linear-gradient(135deg, #818cf8, #6366f1);
}

/* Hamburger button - hidden on desktop, visible on mobile */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .hamburger-btn { display: flex; align-items: center; justify-content: center; }
}
/* Mobile sidebar open */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: -280px; width: 260px; height: 100vh;
    z-index: 9999; transition: left 0.3s ease;
    background: var(--bg); border-right: 1px solid var(--border);
  }
  .sidebar.mobile-open { left: 0; }
}

/* ── Mobile Header: sticky + backdrop ── */
@media (max-width: 768px) {
  .header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background: rgba(14, 14, 20, 0.92) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid var(--border) !important;
  }
}
