/* ============================================================
   BAOBAO — Main Stylesheet
   Dark cinematic theme inspired by premium streaming platforms
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --red: #FFD600;
  --red-dark: #e6c000;
  --red-glow: rgba(255,214,0,0.40);
  --gold: #f5a623;
  --gold-dim: rgba(245,166,35,0.15);
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --bg4: #22222e;
  --surface: rgba(255,255,255,0.04);
  --surface2: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --text: #f0f0f5;
  --text2: #a0a0b0;
  --text3: #60607a;
  --white: #ffffff;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.6);
  --shadow-red: 0 0 30px rgba(229,9,20,0.4);
  --font-head: 'Bebas Neue', sans-serif;
  --font-ui: 'Rajdhani', sans-serif;
  --font-body: 'Inter', sans-serif;
  --nav-h: 64px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-overflow-scrolling: touch;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ══════════════════════════════════════
   NAVIGATION
══════════════════════════════════════ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 16px 0 20px;
  background: linear-gradient(to bottom, rgba(10,10,15,0.98) 0%, rgba(10,10,15,0.85) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: background var(--transition);
  overflow: visible; /* jangan hidden - memotong area klik tombol */
  width: 100%;
  box-sizing: border-box;
}

#navbar.scrolled {
  background: rgba(10,10,15,0.99);
  box-shadow: var(--shadow);
}

.nav-logo {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}

.nav-logo .logo-text {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--red);
  text-shadow: 0 0 20px var(--red-glow);
}

.nav-logo .logo-badge {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
  align-self: flex-start;
  margin-top: 6px;
}

.nav-links {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
}

.nav-link {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text2);
  padding: 6px 14px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface2);
}

.nav-link.active { color: var(--red); }

.nav-right {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
}

.nav-search-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  transition: all var(--transition);
}

.nav-search-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }

.nav-genre-btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; gap: 6px;
  transition: all var(--transition);
}

.nav-genre-btn:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }

.hamburger {
  display: none;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile nav drawer */
#mobile-nav {
  display: none;
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: rgba(10,10,15,0.97);
  backdrop-filter: blur(20px);
  z-index: 850;
  padding: 24px;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

#mobile-nav.open { transform: translateX(0); display: flex; }

.mobile-nav-link {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  color: var(--text2);
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all var(--transition);
}

.mobile-nav-link:hover { color: var(--text); background: var(--surface); border-color: var(--border); }

/* ── Search Overlay ── */
#search-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 950;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

#search-overlay.open { display: flex; }

.search-box {
  width: 100%; max-width: 680px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.search-input-wrap {
  display: flex; align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.search-input-wrap svg { color: var(--text3); flex-shrink: 0; }

#main-search {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 18px;
  padding: 20px 16px;
}

#main-search::placeholder { color: var(--text3); }

.search-close {
  color: var(--text3);
  padding: 8px;
  border-radius: 6px;
  transition: color var(--transition);
}

.search-close:hover { color: var(--text); }

#search-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
}

.search-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.search-item:hover { background: var(--surface2); }

.search-item-poster {
  width: 48px; height: 68px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg4);
  flex-shrink: 0;
}

.search-item-info h4 {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.search-item-info p {
  font-size: 12px;
  color: var(--text3);
}

.search-empty {
  text-align: center;
  padding: 40px;
  color: var(--text3);
  font-family: var(--font-ui);
}

/* ══════════════════════════════════════
   HERO / FEATURED
══════════════════════════════════════ */
#hero {
  position: relative;
  height: 85vh; min-height: 500px; max-height: 780px;
  display: flex; align-items: flex-end;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

#hero:not(.loaded) {
  opacity: 0;
}

#hero.loaded {
  opacity: 1;
}

.hero-backdrop {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#hero.loaded .hero-backdrop { opacity: 1; }

.hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,15,0.1) 0%,
    rgba(10,10,15,0.2) 30%,
    rgba(10,10,15,0.7) 60%,
    rgba(10,10,15,0.98) 100%
  );
}

.hero-gradient-side {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(10,10,15,0.85) 0%, transparent 60%);
}

.hero-content {
  position: relative; z-index: 2;
  padding: 0 48px 64px;
  max-width: 640px;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(245,166,35,0.3);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(42px, 6vw, 72px);
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

.hero-meta {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero-meta span {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
}

.hero-meta .rating {
  color: var(--gold);
  display: flex; align-items: center; gap: 4px;
}

.hero-synopsis {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}

.hero-dots {
  display: flex; gap: 8px; margin-top: 16px;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.35);
  cursor: pointer; transition: all 0.3s;
}
.hero-dot.active {
  background: var(--red);
  width: 24px; border-radius: 4px;
}
.hero-dot:hover { background: rgba(255,255,255,0.7); }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--red);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius);
  transition: all var(--transition);
  box-shadow: 0 4px 20px var(--red-glow);
}

.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 30px var(--red-glow);
}

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border2);
  padding: 12px 24px;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.btn-secondary:hover { background: var(--surface); border-color: var(--text3); }

.btn-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  transition: all var(--transition);
}

.btn-icon:hover { background: var(--surface); border-color: var(--border2); color: var(--gold); }
.btn-icon.active { color: var(--red); border-color: var(--red); }

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
#main-content { padding-top: 0; }

.section { padding: 48px 0; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 1.5px;
  color: var(--text);
  display: flex; align-items: center; gap: 10px;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px; height: 24px;
  background: var(--red);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--red-glow);
}

.section-link {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 4px;
  transition: opacity var(--transition);
}

.section-link:hover { opacity: 0.75; }

/* ── Movie Grid ── */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 16px;
}

.movie-grid.large { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* Browse page: 8 kolom tetap di desktop */
#browse-grid.movie-grid,
#browse-grid {
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
}

.movie-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg3);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  group: true;
}

.movie-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 0 1px var(--border2);
  z-index: 10;
}

.movie-card-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--bg4);
  display: block;
}

.movie-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,10,15,0.95) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.movie-card:hover .movie-card-overlay { opacity: 1; }

.movie-card-play {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px var(--red-glow);
  transform: scale(0.8);
  transition: transform var(--transition);
}

.movie-card:hover .movie-card-play { transform: scale(1); }

.movie-card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px 12px 12px;
}

.movie-card-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-card-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--text3);
  font-family: var(--font-ui);
}

.movie-card-badge {
  position: absolute; top: 10px; left: 10px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
}

.movie-card-badge.ongoing { background: var(--gold); color: #111; }
.movie-card-badge.new { background: #2ecc71; }

/* ── Horizontal Scroll ── */
.movie-scroll-wrap {
  position: relative;
}

.movie-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.movie-scroll::-webkit-scrollbar { display: none; }

.movie-scroll .movie-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
}

/* ── Pagination ── */
.browse-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 0 8px;
  flex-wrap: wrap;
}

.pg-btn {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0 10px;
  display: flex; align-items: center; justify-content: center;
}

.pg-btn:hover:not(:disabled) {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border2);
}

.pg-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 2px 10px var(--red-glow);
}

.pg-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pg-arrow { font-size: 18px; }

.pg-dots {
  color: var(--text3);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 0 4px;
  user-select: none;
}

.scroll-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}

.scroll-btn:hover { background: var(--red); border-color: var(--red); }
.scroll-btn.left { left: -16px; }
.scroll-btn.right { right: -16px; }

/* ══════════════════════════════════════
   GENRE FILTER BAR
══════════════════════════════════════ */
.genre-filter {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 28px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.genre-filter::-webkit-scrollbar { display: none; }

.genre-chip {
  flex-shrink: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.genre-chip:hover { color: var(--text); border-color: var(--text3); }
.genre-chip.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ══════════════════════════════════════
   WATCH PAGE
══════════════════════════════════════ */
#watch-page { padding-top: var(--nav-h); }

.watch-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Video Player ── */
.player-container {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  /* overflow:hidden diperlukan untuk video, tapi premium-lock-overlay pakai position:absolute inset:0 jadi aman */
}

.player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

#video-player {
  width: 100%; height: 100%;
  display: block;
}

.player-wrapper iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}

.player-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  color: var(--text3);
}

.player-placeholder svg { opacity: 0.3; }

.player-placeholder p {
  font-family: var(--font-ui);
  font-size: 14px;
}

/* Custom video controls */
.player-controls {
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 20px 16px 14px;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.player-wrapper:hover .player-controls { opacity: 1; }

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 12px;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.1s linear;
  pointer-events: none;
}

.progress-thumb {
  position: absolute;
  top: 50%; transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  background: var(--red);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition);
}

.progress-bar:hover .progress-thumb { opacity: 1; }

.controls-row {
  display: flex; align-items: center; gap: 12px;
}

.ctrl-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.8);
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
}

.ctrl-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

.ctrl-time {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-left: 4px;
}

.ctrl-spacer { flex: 1; }

.volume-wrap { display: flex; align-items: center; gap: 8px; }

.volume-slider {
  width: 70px;
  -webkit-appearance: none;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50%;
}

/* Player Info */
.player-info {
  padding: 20px 0;
}

.player-title {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.player-meta {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.player-meta span {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}

.player-meta .dot { color: var(--text3); }

.player-actions {
  display: flex; gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Episode selector */
.episode-selector {
  margin-top: 16px;
}

.episode-selector-title {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.episode-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-width: 100%;
}

.ep-btn {
  min-width: 44px;
  padding: 7px 12px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  transition: all var(--transition);
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-btn:hover { background: var(--surface2); border-color: var(--border2); color: var(--text); }
.ep-btn.active { background: var(--red); border-color: var(--red); color: #fff; }

/* Subtitle info */
.subtitle-info-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
}

.subtitle-info-box strong { color: var(--text); }

/* Sidebar */
.watch-sidebar {}

.sidebar-section {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.sidebar-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text2);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-movie-item {
  display: flex; gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.sidebar-movie-item:last-child { border-bottom: none; }
.sidebar-movie-item:hover { background: var(--surface); }

.sidebar-movie-poster {
  width: 56px; height: 80px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg4);
  flex-shrink: 0;
}

.sidebar-movie-info { flex: 1; min-width: 0; }

.sidebar-movie-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-movie-meta {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--font-ui);
}

/* ══════════════════════════════════════
   ANNOUNCEMENT POPUP
══════════════════════════════════════ */
#announcement-popup {
  position: fixed;
  z-index: 1000;
  display: none;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
}

#announcement-popup.open { display: flex; }

.announcement-box {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: calc(100% - 48px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  animation: popIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}

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

.announcement-type-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.announcement-type-bar.info { background: #3b82f6; }
.announcement-type-bar.warning { background: var(--gold); }
.announcement-type-bar.error { background: var(--red); }
.announcement-type-bar.success { background: #2ecc71; }

.announcement-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.announcement-icon.info { background: rgba(59,130,246,0.15); }
.announcement-icon.warning { background: rgba(245,166,35,0.15); }
.announcement-icon.error { background: rgba(229,9,20,0.15); }
.announcement-icon.success { background: rgba(46,204,113,0.15); }

.announcement-title {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.announcement-text {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 24px;
}

.announcement-close {
  display: block; width: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  padding: 12px;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: background var(--transition);
}

.announcement-close:hover { background: var(--red-dark); }

/* ══════════════════════════════════════
   PAGES
══════════════════════════════════════ */
.page { display: none; }
.page.active { display: block; }

/* ── Genres Page ── */
.genre-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  padding: 32px 0;
}

.genre-card {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg3);
  transition: all var(--transition);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  color: var(--text2);
}

.genre-card:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--red-glow);
}

.genre-card .icon { font-size: 28px; }

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo-text {
  font-family: var(--font-head);
  font-size: 32px;
  letter-spacing: 2px;
  color: var(--red);
}

.footer-brand p {
  font-size: 13px;
  color: var(--text3);
  margin-top: 8px;
  line-height: 1.6;
  max-width: 240px;
}

.footer-col h4 {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 8px;
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--text3);
}

/* ══════════════════════════════════════
   LOADING / SKELETON
══════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 0%, var(--bg4) 50%, var(--bg3) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.skeleton-card {
  aspect-ratio: 2/3;
  border-radius: var(--radius);
}

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 3px solid #2ecc71; }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid #3b82f6; }
.toast.warning { border-left: 3px solid var(--gold); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1100px) {
  .watch-layout { grid-template-columns: 1fr; }
  .watch-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  #browse-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 768px) {
  :root { --nav-h: 52px; }

  .nav-links, .nav-genre-btn { display: none; }
  .hamburger { display: flex; }

  /* Di mobile, sembunyikan tombol nav auth dari navbar atas — ada di mobile menu */
  .nav-auth-area .nav-auth-btn { display: none; }
  /* Tampilkan hanya jika sudah login (user menu) */
  .nav-auth-area .nav-user-menu,
  .nav-auth-area .nav-notif-btn { display: flex; }

  .hero-content { padding: 0 16px 36px; max-width: 100%; }
  .hero-title { font-size: 28px; letter-spacing: 1px; margin-bottom: 10px; }
  .hero-badge { font-size: 10px; padding: 4px 10px; margin-bottom: 10px; }
  .hero-synopsis { font-size: 12px; margin-bottom: 16px; -webkit-line-clamp: 2; }
  .hero-meta span { font-size: 12px; }
  .hero-actions { gap: 8px; }
  .btn-primary { font-size: 13px; padding: 9px 18px; }
  .btn-secondary { font-size: 12px; padding: 8px 14px; }

  .section-header { margin-bottom: 14px; }
  .section-title { font-size: 16px; letter-spacing: 0.5px; }
  .section-title::before { height: 16px; }

  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .movie-grid.large { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  #browse-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px; }
  .movie-card { border-radius: 6px; }

  /* Home scroll: 3 cards visible on mobile */
  .movie-scroll .movie-card {
    flex: 0 0 calc(33.33vw - 14px);
    min-width: 90px;
    max-width: 140px;
  }

  .genre-page-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
  .genre-card { font-size: 11px; gap: 4px; }
  .genre-card .icon { font-size: 20px; }

  .watch-layout { padding: 10px; }
  .watch-sidebar { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 4px; }

  #toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast { min-width: unset; }

  .modal { padding: 16px; margin: 12px; max-height: 90vh; overflow-y: auto; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 24px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .section-title { font-size: 15px; }
  .player-title { font-size: 18px; }
  .movie-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  #browse-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 7px; }
  .genre-page-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  /* modal detail film di HP */
  #movie-modal-box { padding: 14px !important; }
  #movie-modal-box > div[style*="grid-template-columns"] {
    grid-template-columns: 100px 1fr !important;
    gap: 12px !important;
  }
  #movie-modal-box img { width: 100px !important; }
  #movie-modal-box h2 { font-size: 16px !important; }
}

/* ══════════════════════════════════════
   MISC UI
══════════════════════════════════════ */
.tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text2);
}

.rating-star { color: var(--gold); font-size: 14px; }

.no-result {
  text-align: center;
  padding: 80px 20px;
  color: var(--text3);
}

.no-result h3 {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: var(--text2);
}

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  animation: popIn 0.25s ease;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-head);
  font-size: 24px;
  letter-spacing: 1px;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  transition: all var(--transition);
}

.modal-close:hover { background: var(--red); color: #fff; }

/* Synopsis expand */
.synopsis-text.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-btn {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  margin-top: 6px;
  cursor: pointer;
}

/* Genres badge row */
.genre-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.genre-tag {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  color: var(--text2);
  transition: all var(--transition);
  cursor: pointer;
}
.genre-tag:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ══ RANK BADGE ══ */
.movie-card.top-ranked { position: relative; }
.rank-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-head);
  font-size: 16px;
  padding: 2px 8px;
  border-radius: 6px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(229,9,20,0.5);
  line-height: 1.4;
}

/* ══ ONGOING GRID ══ */
.ongoing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.ongoing-card {
  display: flex;
  gap: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.ongoing-card:hover {
  border-color: var(--red);
  background: var(--bg4);
  transform: translateY(-2px);
}

.ongoing-poster {
  width: 70px; height: 98px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg4);
}

.ongoing-info { flex: 1; min-width: 0; }

.ongoing-title {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ongoing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text3);
}

.ongoing-badge {
  background: rgba(229,9,20,0.15);
  color: var(--red);
  border: 1px solid rgba(229,9,20,0.3);
  padding: 2px 7px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
}

.ongoing-country {
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 11px;
}

.ongoing-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.genre-tag-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-family: var(--font-ui);
}

.ongoing-eps {
  font-size: 11px;
  color: var(--text3);
}

@media (max-width: 600px) {
  .ongoing-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   AUTH MODAL
══════════════════════════════════════════════ */
.auth-modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.8);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.auth-modal-overlay.open { display: flex; }
.auth-modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 32px 28px;
  width: 100%; max-width: 420px;
  position: relative;
  animation: fadeUp 0.25s ease;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.auth-modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg3); border: none; color: var(--text2);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.auth-logo {
  font-family: var(--font-head); font-size: 28px; color: var(--red);
  letter-spacing: 2px; text-align: center; margin-bottom: 20px;
}
.auth-tabs {
  display: flex; border-radius: 10px; background: var(--bg3);
  padding: 4px; margin-bottom: 24px; gap: 4px;
}
.auth-tab {
  flex: 1; padding: 10px; border: none; background: transparent;
  color: var(--text2); border-radius: 8px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 600; font-size: 14px;
  transition: all 0.2s;
}
.auth-tab.active { background: var(--red); color: #fff; }
.auth-input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 10px; padding: 12px 16px; color: var(--text);
  font-size: 14px; outline: none; transition: border 0.2s;
  box-sizing: border-box;
}
.auth-input:focus { border-color: var(--red); }
.auth-submit-btn {
  width: 100%; padding: 14px; background: var(--red); color: #fff;
  border: none; border-radius: 10px; font-family: var(--font-ui);
  font-weight: 700; font-size: 15px; cursor: pointer;
  margin-top: 8px; transition: opacity 0.2s;
}
.auth-submit-btn:hover { opacity: 0.9; }
.auth-submit-btn:disabled { opacity: 0.5; }
.auth-error {
  background: rgba(229,9,20,0.1); border: 1px solid var(--red);
  border-radius: 8px; padding: 10px 14px; color: #ff6b6b;
  font-size: 13px; margin-bottom: 12px;
}
.auth-success {
  background: rgba(46,204,113,0.1); border: 1px solid #2ecc71;
  border-radius: 8px; padding: 10px 14px; color: #2ecc71;
  font-size: 13px; margin-bottom: 12px;
}
.auth-switch { text-align: center; font-size: 13px; color: var(--text3); margin-top: 16px; }
.auth-switch a { color: var(--red); cursor: pointer; font-weight: 600; }

/* ── Nav Auth ── */
.nav-auth-area { display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-width: 0; }
.nav-auth-btn {
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-auth-btn:hover { border-color: var(--text2); color: var(--text); }
.nav-auth-btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.nav-auth-btn.primary:hover { opacity: 0.9; }

/* Mobile auth area inside mobile-nav */
#mobile-auth-area { display: flex; }
#mobile-auth-area .nav-auth-btn {
  flex: 1;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
  font-size: 13px;
}

/* ── User Menu ── */
.nav-user-menu {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 4px 8px; border-radius: 10px; transition: background 0.2s;
  position: relative;
  min-width: 0;
  max-width: 180px;
}
.nav-user-menu:hover { background: var(--bg3); }
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.nav-user-name { font-size: 13px; font-weight: 600; color: var(--text); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.premium-badge-sm { font-size: 14px; }
.nav-chevron { font-size: 10px; color: var(--text3); }
.nav-notif-btn {
  position: relative; background: transparent; border: none;
  font-size: 20px; cursor: pointer; padding: 4px 8px;
  border-radius: 8px; transition: background 0.2s;
}
.nav-notif-btn:hover { background: var(--bg3); }
.notif-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; font-family: var(--font-ui);
  min-width: 16px; height: 16px; border-radius: 8px;
  align-items: center; justify-content: center; padding: 0 3px;
}

/* ── User Dropdown ── */
.user-dropdown {
  position: fixed;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 12px; min-width: 240px; max-width: calc(100vw - 16px); z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: none; animation: fadeUp 0.2s ease;
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
  display: flex; gap: 12px; align-items: center; padding: 16px;
}
.user-dropdown-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.user-dropdown-name { font-weight: 700; font-size: 14px; }
.user-dropdown-email { font-size: 12px; color: var(--text3); }
.user-dropdown-premium { font-size: 11px; color: #f5a623; font-weight: 600; margin-top: 2px; }
.user-dropdown-free { font-size: 11px; color: var(--text3); margin-top: 2px; }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 16px; color: var(--text2); cursor: pointer;
  font-size: 14px; transition: all 0.15s; text-decoration: none;
  background: none; border: none; text-align: left; font-family: inherit; box-sizing: border-box;
  border-radius: 6px;
}
.user-dropdown-item:hover { background: var(--bg3); color: var(--text); }
.user-dropdown-item.premium { color: #f5a623; }
.user-dropdown-item.danger { color: #ff6b6b; }
.user-dropdown-item.danger:hover { background: rgba(229,9,20,0.1); }

/* ── Notif Panel ── */
.notif-panel {
  position: fixed; top: 70px; right: 16px; z-index: 800;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 12px; width: 320px; max-height: 420px;
  overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: none; animation: fadeUp 0.2s ease;
}
.notif-panel.open { display: block; }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-family: var(--font-ui); font-size: 14px;
  position: sticky; top: 0; background: var(--bg2);
}
.notif-panel-header button {
  background: none; border: none; color: var(--text3); font-size: 11px; cursor: pointer;
}
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.notif-item:hover { background: var(--bg3); }
.notif-item.unread { background: rgba(229,9,20,0.05); }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.notif-msg { font-size: 12px; color: var(--text2); }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 4px; }
.notif-empty, .notif-loading { padding: 24px; text-align: center; color: var(--text3); font-size: 13px; }

/* ══════════════════════════════════════════════
   PREMIUM POPUP
══════════════════════════════════════════════ */
.premium-popup-overlay {
  position: fixed; inset: 0; z-index: 2500;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; animation: fadeIn 0.2s ease;
}
.premium-popup-box {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border: 1px solid rgba(245,166,35,0.4);
  border-radius: 20px; padding: 36px 28px;
  max-width: 420px; width: 100%; text-align: center;
  animation: fadeUp 0.3s ease;
  box-shadow: 0 0 60px rgba(245,166,35,0.15);
}
.premium-popup-icon { font-size: 56px; margin-bottom: 12px; }
.premium-popup-title { font-family: var(--font-head); font-size: 28px; color: #f5a623; margin-bottom: 8px; }
.premium-popup-desc { font-size: 14px; color: var(--text2); margin-bottom: 20px; line-height: 1.6; }
.premium-popup-benefits { text-align: left; background: var(--bg4); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.premium-benefit { font-size: 13px; color: var(--text); padding: 4px 0; }
.premium-popup-how { text-align: left; margin-bottom: 24px; }
.premium-how-title { font-weight: 700; font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.premium-how-step { font-size: 13px; color: var(--text2); padding: 3px 0; }
.premium-popup-actions { display: flex; gap: 10px; justify-content: center; }

/* ══════════════════════════════════════════════
   COMMUNITY CHAT
══════════════════════════════════════════════ */
.chat-container {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  height: calc(100vh - 280px); min-height: 400px; max-height: 700px;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg.own { flex-direction: row-reverse; }
.chat-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--red); color: #fff; font-weight: 700;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-msg.own .chat-avatar { background: var(--surface2); }
.chat-bubble-wrap { max-width: 70%; }
.chat-meta { display: flex; gap: 6px; align-items: baseline; margin-bottom: 3px; }
.chat-msg.own .chat-meta { flex-direction: row-reverse; }
.chat-name { font-size: 12px; font-weight: 700; color: var(--text2); }
.chat-time { font-size: 10px; color: var(--text3); }
.chat-bubble {
  background: var(--bg3); border-radius: 12px 12px 12px 4px;
  padding: 8px 12px; font-size: 14px; color: var(--text);
  line-height: 1.5; word-break: break-word;
}
.chat-msg.own .chat-bubble { background: var(--red); color: #fff; border-radius: 12px 12px 4px 12px; }
.admin-tag { background: #f5a623; color: #000; font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.chat-loading, .chat-empty { text-align: center; color: var(--text3); padding: 32px; font-size: 14px; }
.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 12px 16px; background: var(--bg2);
}
.chat-input-row {
  display: flex; gap: 8px; align-items: center;
}
.chat-login-prompt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; color: var(--text2); font-size: 14px;
}
.chat-input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 24px; padding: 10px 16px; color: var(--text);
  font-size: 14px; outline: none;
}
.chat-input:focus { border-color: var(--red); }
.chat-send-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--red); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: opacity 0.2s;
}
.chat-send-btn:hover { opacity: 0.85; }
.chat-emoji-btn {
  background: transparent; border: none; font-size: 20px;
  cursor: pointer; padding: 4px; border-radius: 8px;
  transition: background 0.15s;
}
.chat-emoji-btn:hover { background: var(--bg3); }
.emoji-picker {
  flex-wrap: wrap; gap: 6px; padding: 10px;
  background: var(--bg3); border-radius: 12px;
  border: 1px solid var(--border2); margin-bottom: 8px;
}
.emoji-picker span { font-size: 22px; cursor: pointer; padding: 4px; border-radius: 6px; transition: background 0.15s; }
.emoji-picker span:hover { background: var(--bg4); }

/* ══════════════════════════════════════════════
   COMMENTS
══════════════════════════════════════════════ */
.comments-section { max-width: 800px; }
.comments-title { font-family: var(--font-ui); font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.comment-form { background: var(--bg2); border: 1px solid var(--border2); border-radius: 12px; padding: 16px; margin-bottom: 24px; }
.comment-rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.star-rating { display: flex; gap: 4px; }
.star { font-size: 22px; color: var(--text3); cursor: pointer; transition: color 0.15s; }
.star.active, .star:hover { color: #f5a623; }
.comment-textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 10px; padding: 12px; color: var(--text);
  font-size: 14px; resize: vertical; outline: none;
  font-family: var(--font-body, inherit); margin-bottom: 10px;
  box-sizing: border-box;
}
.comment-textarea:focus { border-color: var(--red); }
.comment-login-prompt {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 12px; padding: 16px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; color: var(--text2);
}
.avg-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 14px 16px; background: var(--bg2); border-radius: 10px; border: 1px solid var(--border2); }
.avg-stars { color: #f5a623; font-size: 20px; }
.avg-val { font-family: var(--font-head); font-size: 28px; color: var(--text); }
.avg-count { font-size: 13px; color: var(--text3); }
.comment-item { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.comment-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.comment-name { font-weight: 700; font-size: 14px; }
.comment-stars { color: #f5a623; font-size: 13px; }
.comment-time { font-size: 12px; color: var(--text3); }
.comment-del { margin-left: auto; background: none; border: none; color: var(--text3); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.comment-del:hover { background: rgba(229,9,20,0.1); color: var(--red); }
.comment-text { font-size: 14px; color: var(--text2); line-height: 1.6; }
.no-comments { text-align: center; color: var(--text3); padding: 32px 0; font-size: 14px; }
.comments-pagination { display: flex; gap: 6px; justify-content: center; padding: 20px 0 4px; flex-wrap: wrap; }
.cp-btn { min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border2); background: var(--bg2); color: var(--text2); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.cp-btn:hover { border-color: var(--red); color: var(--red); }
.cp-btn.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ══════════════════════════════════════════════
   PROFILE PAGE
══════════════════════════════════════════════ */
.profile-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 32px; text-align: center;
  margin-bottom: 20px;
}
.profile-avatar-big {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.profile-name { font-family: var(--font-head); font-size: 24px; margin-bottom: 4px; }
.profile-email { font-size: 13px; color: var(--text3); margin-bottom: 16px; }
.profile-status-badge {
  display: inline-block; padding: 6px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 700; font-family: var(--font-ui);
  margin-bottom: 12px;
}
.profile-status-badge.premium { background: rgba(245,166,35,0.15); color: #f5a623; border: 1px solid rgba(245,166,35,0.3); }
.profile-status-badge.free { background: var(--bg3); color: var(--text2); border: 1px solid var(--border2); }
.profile-expiry { font-size: 13px; color: var(--text2); margin-bottom: 16px; }
.profile-upgrade-card { background: var(--bg3); border-radius: 12px; padding: 16px; margin-top: 16px; border: 1px dashed rgba(245,166,35,0.3); }
.profile-upgrade-title { font-weight: 700; color: #f5a623; margin-bottom: 4px; }
.profile-upgrade-desc { font-size: 13px; color: var(--text2); margin-bottom: 12px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-stat { background: var(--bg2); border: 1px solid var(--border2); border-radius: 12px; padding: 20px; text-align: center; }
.profile-stat-value { font-family: var(--font-head); font-size: 32px; color: var(--red); }
.profile-stat-label { font-size: 12px; color: var(--text3); margin-top: 4px; }

/* ══════════════════════════════════════════════
   SKELETON LOADING
══════════════════════════════════════════════ */
.skeleton-card {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
  aspect-ratio: 2/3;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Movie card premium badge */
.movie-card-badge.premium {
  background: linear-gradient(135deg, #f5a623, #f0ad00);
  color: #000; font-weight: 700; font-size: 9px;
}

@media (max-width: 768px) {
  .nav-user-name, .nav-chevron { display: none; }
  .user-dropdown { right: 4px; max-width: calc(100vw - 16px); z-index: 1100; }
  .notif-panel { right: 8px; width: calc(100vw - 16px); max-width: 360px; }
  .chat-bubble-wrap { max-width: 85%; }
  .auth-modal-box { padding: 24px 20px; }
  .premium-popup-box { padding: 28px 20px; }

  /* Navbar saat login: kompakkan elemen */
  #navbar { padding: 0 12px; gap: 8px; }
  .nav-notif-btn { padding: 4px 5px; font-size: 18px; }
  .nav-avatar, .nav-avatar-img { width: 28px; height: 28px; font-size: 12px; }
  .nav-user-menu { padding: 3px 5px; gap: 4px; }
  .nav-search-btn { width: 32px; height: 32px; }

  /* Logo lebih kecil di mobile saat login */
  .nav-logo .logo-text { font-size: 20px; }
  .nav-logo .logo-badge { display: none; } /* Sembunyikan badge SUB INDO di mobile */
}

/* ═══════════════════════════════════════════════════════════
   FITUR BARU — Profile Pic, DM Page, Rating, Live Chat
   ═══════════════════════════════════════════════════════════ */

/* ── Profile Pic in Nav ─────────────────────────────────── */
.nav-avatar-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--red);
}
.chat-avatar-wrap {
  flex-shrink: 0;
}
.chat-avatar-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ── Profile Big Pic ───────────────────────────────────── */
.profile-avatar-big-wrap {
  display: inline-block;
  position: relative;
  margin-bottom: 12px;
}
.profile-avatar-big-img {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--red);
  display: block;
}

/* ── Delete button in chat ─────────────────────────────── */
.chat-del-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s;
}
.chat-msg:hover .chat-del-btn { opacity: 1; }
.chat-del-btn:hover { background: rgba(229,9,20,0.15); color: var(--red); }

/* ── Live member count pulse ─────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ── DM Admin Page ─────────────────────────────────────── */
.dm-admin-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
  max-width: 680px;
  margin: 0 auto;
}
.dm-admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.dm-back-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.dm-back-btn:hover { background: var(--bg4); }
.dm-admin-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dm-admin-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #c0392b);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.dm-admin-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.dm-admin-status {
  font-size: 12px;
  color: #2ecc71;
}
.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dm-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 78%;
}
.dm-msg.own {
  align-items: flex-end;
  align-self: flex-end;
}
.dm-msg.from-admin {
  align-self: flex-start;
}
.dm-admin-bubble-label {
  font-size: 10px;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: 0.5px;
}
.dm-bubble {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 12px 12px 12px 4px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}
.dm-msg.own .dm-bubble {
  background: var(--red);
  color: #fff;
  border-color: transparent;
  border-radius: 12px 12px 4px 12px;
}
.dm-time {
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
}
.dm-input-area {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}
.dm-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 18px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.dm-input:focus { border-color: var(--red); }

/* ── Admin Modal Overlay ────────────────────────────────── */
.admin-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal-overlay.open {
  display: flex;
}
.admin-modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

/* ── Movie Card Rating Stars ────────────────────────────── */
.card-rating-stars {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
}
.card-rating-stars .star-filled { color: #f39c12; }
.card-rating-stars .star-empty { color: var(--text3); }
.card-rating-avg {
  font-size: 11px;
  color: var(--text2);
  font-weight: 600;
}

/* ── Rating Widget in Watch Page ────────────────────────── */
.rating-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  flex-wrap: wrap;
}
.rating-star-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s;
  color: var(--text3);
  padding: 2px;
  line-height: 1;
}
.rating-star-btn.active, .rating-star-btn:hover { color: #f39c12; transform: scale(1.15); }
.rating-label-text {
  font-size: 13px;
  color: var(--text3);
  min-width: 80px;
}
.rating-avg-display {
  font-size: 13px;
  color: var(--text2);
}

/* ── Responsive tweaks ──────────────────────────────────── */
@media (max-width: 600px) {
  .dm-admin-page { max-width: 100%; }
  .dm-msg { max-width: 88%; }
  .dm-admin-header { padding: 12px 14px; }
  .dm-messages { padding: 14px 10px; }
  .dm-input-area { padding: 10px 10px; }
}

/* skeleton animation for rating widget loading */
@keyframes skeleton-anim {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}


/* ── DM Chat — Send Status & Optimistic UI ───────────────── */
.dm-send-status {
  font-size: 10px;
  margin-top: 2px;
  text-align: right;
}
.dm-send-status.pending { color: var(--text3); }
.dm-send-status.sent { color: #2ecc71; }
.dm-send-status.failed { color: var(--red); }

.dm-msg.dm-pending .dm-bubble {
  opacity: 0.6;
}
.dm-msg.dm-failed .dm-bubble {
  opacity: 0.75;
  border: 1px solid rgba(229,9,20,0.5);
}
.dm-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text3);
}

#dm-send-btn:disabled {
  cursor: not-allowed;
}
#dm-input:disabled {
  opacity: 0.6;
}

/* ── Premium Lock Overlay ─────────────────────────────────── */
.premium-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 5;
  border-radius: var(--radius, 10px);
  padding: 20px;
}
.premium-lock-icon {
  font-size: 52px;
  animation: pulsePremium 2s ease-in-out infinite;
}
.premium-lock-title {
  font-family: var(--font-head, 'Bebas Neue', sans-serif);
  font-size: 26px;
  color: #f39c12;
  letter-spacing: 2px;
  text-align: center;
}
.premium-lock-desc {
  font-size: 14px;
  color: var(--text2, #aaa);
  text-align: center;
  max-width: 300px;
  line-height: 1.6;
}
@media (max-width: 600px) {
  .premium-lock-overlay { padding: 16px 12px; gap: 8px; }
  .premium-lock-icon { font-size: 36px; }
  .premium-lock-title { font-size: 20px; }
  .premium-lock-desc { font-size: 12px; max-width: 100%; }
  .premium-lock-overlay .btn-primary,
  .premium-lock-overlay .btn-secondary { font-size: 12px; padding: 8px 14px; }
}
@keyframes pulsePremium {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ── Premium Episode Badge on ep-btn ─────────────────────── */
.ep-btn.premium-ep {
  border-color: #f39c12 !important;
  color: #f39c12 !important;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE FIX — Responsif & Overflow
   ═══════════════════════════════════════════════════════════ */

/* Pastikan tidak ada elemen yang overflow ke kanan di mobile */
@media (max-width: 768px) {
  .container, .section, .watch-layout, .player-info, .comments-section {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* DM page full height di mobile */
  .dm-admin-page {
    height: calc(100vh - var(--nav-h));
    margin-top: var(--nav-h);
  }

  /* Input DM lebih besar di mobile untuk touch */
  .dm-input {
    font-size: 16px; /* Cegah zoom di iOS */
    padding: 10px 14px;
  }

  .auth-input {
    font-size: 16px; /* Cegah zoom di iOS */
  }

  /* Watch page layout di mobile */
  .watch-layout {
    display: block;
    padding: 8px;
  }

  .watch-sidebar {
    display: none; /* Sembunyikan sidebar di mobile, terlalu sempit */
  }

  /* Player container mobile */
  .player-container {
    border-radius: 0;
    margin: 0 -8px;
  }

  /* Episode grid mobile: 3 kolom, tidak kepotong */
  .episode-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    overflow-x: visible !important;
  }
  .ep-btn {
    font-size: 11px !important;
    padding: 6px 4px !important;
    min-width: 0 !important;
    width: 100%;
  }

  /* Komentar mobile */
  .comments-section {
    max-width: 100%;
    padding: 0 4px;
  }

  /* Rating widget mobile */
  .rating-widget {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Chat komunitas mobile */
  .chat-container {
    padding: 8px;
  }

  .chat-bubble-wrap {
    max-width: 80vw;
  }

  /* Toast mobile */
  #toast-container {
    bottom: 16px;
    left: 8px;
    right: 8px;
  }
}

@media (max-width: 480px) {
  /* Navbar lebih compact */
  .nav-logo { font-size: 18px; letter-spacing: 1px; }

  /* Hero mobile */
  .hero-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .hero-actions .btn-primary, .hero-actions .btn-secondary {
    flex: 1;
    min-width: 120px;
    text-align: center;
    justify-content: center;
  }

  /* DM page */
  .dm-msg { max-width: 90%; }
  .dm-admin-header { padding: 10px 12px; }

  /* Modal full width di mobile kecil */
  .auth-modal-box { margin: 8px; padding: 20px 16px; }
  .movie-modal-backdrop .movie-modal-box { margin: 8px; }
}

/* ═══════════════════════════════════════════════════════════
   FIX MEMBER LOGIN — Responsif saat sudah login
   ═══════════════════════════════════════════════════════════ */

/* Pastikan semua page tidak overflow */
.page {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Container utama tidak boleh melebihi viewport */
.container {
  max-width: 100%;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* Watch layout saat mobile tidak overflow */
#page-watch {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Profile page mobile */
#page-profile {
  padding: var(--nav-h) 0 60px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.profile-card {
  max-width: 100%;
  box-sizing: border-box;
}
.profile-stats {
  max-width: 100%;
  box-sizing: border-box;
}

/* DM page tidak overflow */
#page-dm-admin {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Auth modal tidak overflow layar */
.auth-modal-overlay {
  padding: 12px;
}
.auth-modal-box {
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}

/* Notif panel tidak overflow di mobile kecil */
.notif-panel {
  max-width: calc(100vw - 16px) !important;
  box-sizing: border-box;
}

/* User dropdown tidak overflow */
.user-dropdown {
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  word-break: break-word;
}
.user-dropdown-email {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Premium popup tidak overflow */
.premium-popup-overlay {
  padding: 12px;
}
.premium-popup-box {
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  /* Navbar ultra compact di HP kecil saat login */
  #navbar { padding: 0 10px; gap: 6px; }
  .nav-logo .logo-text { font-size: 18px; letter-spacing: 1px; }
  .nav-notif-btn { padding: 3px 4px; font-size: 16px; }

  /* Hamburger tetap kelihatan */
  .hamburger { margin-left: 4px; flex-shrink: 0; }

  /* Profile page */
  .profile-card { padding: 20px 16px; }

  /* DM bubbles tidak terlalu lebar */
  .dm-msg { max-width: 90%; }
  .dm-bubble { font-size: 13px; padding: 8px 12px; }

  /* Comment form mobile */
  .comment-form { padding: 12px; }
  .comment-textarea { font-size: 14px; }

  /* Rating widget mobile */
  .rating-star-btn { font-size: 20px; }
}

/* ══════════════════════════════════════════════════════════════
   DEPOSIT / PREMIUM PURCHASE SYSTEM
   ══════════════════════════════════════════════════════════════ */

.deposit-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  z-index: 10001; display: flex; align-items: flex-start;
  justify-content: center; padding: 16px; overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

.deposit-page-box {
  background: var(--bg2); border-radius: 18px; width: 100%;
  max-width: 760px; margin: 20px auto; padding: 0; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.deposit-page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.deposit-page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.deposit-page-close {
  background: var(--bg4); border: none; color: var(--text2);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.deposit-page-close:hover { background: var(--red); color: #000; }

.deposit-discount-banner {
  background: linear-gradient(90deg, #e67e22, #e74c3c);
  color: #fff; text-align: center; padding: 10px 24px;
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
}

.deposit-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px; padding: 24px;
}

.deposit-plan-card {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: 14px; padding: 18px 14px; text-align: center;
  position: relative; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.deposit-plan-card:hover {
  border-color: var(--red); transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--red-glow);
}
.deposit-plan-card.popular {
  border-color: var(--red); box-shadow: 0 4px 20px var(--red-glow);
}

.deposit-plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: #000; font-size: 10px; font-weight: 800;
  padding: 2px 10px; border-radius: 20px; white-space: nowrap;
}

.deposit-plan-label {
  font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; margin-top: 6px;
}
.deposit-plan-price { margin-bottom: 6px; }
.deposit-plan-original {
  display: block; font-size: 12px; color: var(--text3);
  text-decoration: line-through; margin-bottom: 2px;
}
.deposit-plan-final {
  font-size: 16px; font-weight: 800; color: var(--red);
}
.deposit-plan-save { font-size: 11px; color: #2ecc71; margin-bottom: 10px; }

.deposit-plan-btn {
  background: var(--red); color: #000; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  width: 100%; margin-top: 8px; transition: opacity 0.2s, transform 0.1s;
}
.deposit-plan-btn:hover { opacity: 0.88; transform: scale(0.98); }

.deposit-info-note {
  text-align: center; font-size: 12px; color: var(--text3);
  padding: 0 24px 20px; line-height: 1.6;
}

/* Payment page */
.deposit-pay-summary {
  margin: 20px 24px 0; background: var(--bg3); border-radius: 12px;
  overflow: hidden; border: 1px solid var(--border);
}
.deposit-pay-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.deposit-pay-row:last-child { border-bottom: none; }
.deposit-pay-row span { color: var(--text2); }
.deposit-pay-row.highlight { background: rgba(255,214,0,0.06); }
.deposit-pay-row.total { background: var(--bg4); }
.deposit-total-price { font-size: 18px; color: var(--red); }

.deposit-unique-note {
  margin: 12px 24px; background: rgba(255,214,0,0.08); border: 1px solid rgba(255,214,0,0.3);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--text2); line-height: 1.6;
}

.deposit-qris-wrap {
  margin: 16px 24px; text-align: center; background: #fff;
  border-radius: 12px; padding: 16px; border: 1px solid var(--border);
}
.deposit-qris-img {
  max-width: 220px; max-height: 220px; width: 100%;
  border-radius: 8px; object-fit: contain; display: block; margin: 0 auto;
}

.deposit-pay-steps {
  margin: 14px 24px; display: grid; gap: 6px;
}
.deposit-pay-step {
  font-size: 13px; color: var(--text2); padding: 8px 12px;
  background: var(--bg3); border-radius: 8px; border-left: 3px solid var(--red);
}

.deposit-pending-notice {
  margin: 14px 24px; background: var(--bg3); border-radius: 10px;
  padding: 14px 16px; font-size: 13px; color: var(--text2); line-height: 1.7;
  text-align: center;
}

.deposit-wa-btn {
  display: inline-block; margin-top: 10px; background: #25D366; color: #fff;
  padding: 9px 20px; border-radius: 24px; font-size: 13px; font-weight: 700;
  text-decoration: none; transition: opacity 0.2s;
}
.deposit-wa-btn:hover { opacity: 0.88; color: #fff; }

.deposit-done-btn {
  display: block; width: calc(100% - 48px); margin: 14px 24px 20px;
  background: var(--red); color: #000; border: none; border-radius: 10px;
  padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: opacity 0.2s;
}
.deposit-done-btn:hover { opacity: 0.88; }

/* Deposit history (member) */
.dep-history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px;
}
.dep-history-item:last-child { border-bottom: none; }
.dep-history-plan { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.dep-history-date { font-size: 11px; color: var(--text3); }
.dep-history-right { text-align: right; }
.dep-history-price { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.dep-history-status { font-size: 12px; font-weight: 600; }
.dep-status-pending { color: #f39c12; }
.dep-status-success { color: #2ecc71; }
.dep-status-rejected { color: var(--red); }

/* Mobile responsive */
@media (max-width: 480px) {
  .deposit-plans-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 16px; }
  .deposit-plan-card { padding: 14px 10px; }
  .deposit-plan-final { font-size: 14px; }
  .deposit-page-box { margin: 8px auto; border-radius: 14px; }
  .deposit-qris-img { max-width: 180px; }
}
@media (max-width: 360px) {
  .deposit-plans-grid { grid-template-columns: 1fr 1fr; }
}