/* ==========================================================================
   DRAMABOX & MELOLO FLOW WEB - MOBILE-FIRST GLASS AESTHETICS
   ========================================================================== */

:root {
  --bg-primary: #090a10;
  --bg-secondary: #12131c;
  --bg-surface: rgba(255, 255, 255, 0.05);
  --bg-surface-elevated: rgba(255, 255, 255, 0.09);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 51, 102, 0.5);

  --accent-pink: #ff3366;
  --accent-orange: #ff6b4a;
  --accent-gradient: linear-gradient(135deg, #ff3366 0%, #ff6b4a 100%);
  --accent-glow: 0 0 20px rgba(255, 51, 102, 0.35);

  --color-watched-bg: rgba(16, 185, 129, 0.16);
  --color-watched-border: rgba(16, 185, 129, 0.55);
  --color-watched-text: #34d399;

  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --nav-height: 64px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* APP ROOT CONTAINER */
.app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: radial-gradient(circle at 50% 0%, #1a162b 0%, #090a10 65%);
}

/* TOP APP HEADER */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 10, 16, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 8px 16px;
  transition: all 0.3s ease;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
}

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

.brand-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 10px rgba(255, 51, 102, 0.4));
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-title .accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.icon-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--bg-surface-elevated);
}

/* EXPANDABLE SEARCH BAR */
.search-container {
  overflow: hidden;
  transition: max-height 0.3s ease, margin 0.3s ease, opacity 0.3s ease;
  max-height: 60px;
  opacity: 1;
  margin-top: 8px;
}

.search-container.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 0 14px;
  gap: 10px;
  height: 42px;
}

.search-box:focus-within {
  border-color: var(--accent-pink);
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.25);
}

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

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.95rem;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.btn-clear-search {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
}

/* CATEGORY FILTER PILLS (HORIZONTAL SCROLL) */
.category-nav {
  margin-top: 10px;
  margin-bottom: 4px;
}

.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

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

.cat-pill {
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-pill.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 51, 102, 0.4);
}

/* MAIN CONTENT SCROLL AREA */
.main-content {
  flex: 1;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
}

.view-section {
  display: none;
}

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

/* HERO BANNER CAROUSEL */
.hero-banner {
  position: relative;
  min-height: 240px;
  margin: 12px 16px 20px 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #1a162b;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--border-glass);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 10, 16, 0.1) 0%, rgba(9, 10, 16, 0.85) 70%, #090a10 100%);
}

.hero-info {
  position: relative;
  z-index: 2;
  padding: 20px;
  max-width: 100%;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-gradient);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.btn-play-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-gradient);
  border: none;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--accent-glow);
  transition: all 0.2s ease;
}

.btn-play-primary:active {
  transform: scale(0.95);
}

.btn-fav-secondary {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-glass);
  color: #ffffff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

/* CONTENT SECTIONS */
.content-section {
  padding: 0 16px;
  margin-bottom: 26px;
}

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

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

.section-emoji {
  font-size: 1.2rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.item-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.btn-clean-history {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clean-history:active {
  background: rgba(239, 68, 68, 0.25);
  transform: scale(0.95);
}

/* HORIZONTAL SCROLL ROW (LANJUTKAN MENONTON) */
.horizontal-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 8px;
}

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

.history-card {
  flex-shrink: 0;
  width: 140px;
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.history-card:active {
  transform: scale(0.96);
}

.history-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4.2;
  background: #1e1b2e;
  overflow: hidden;
}

.history-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: #f87171;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

.history-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.history-progress-fill {
  height: 100%;
  background: var(--accent-gradient);
}

.history-meta {
  padding: 8px;
}

.history-title {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-part-badge {
  font-size: 0.7rem;
  color: var(--accent-pink);
  font-weight: 600;
  margin-top: 2px;
}

/* DRAMA GRID (RESPONSIVE FOR MOBILE 2-3 COLS, DESKTOP 5-6 COLS) */
.drama-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 380px) {
  .drama-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 640px) {
  .drama-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .drama-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.drama-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.drama-card:active {
  transform: scale(0.96);
  border-color: rgba(255, 51, 102, 0.4);
}

.poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4.4;
  background: #171524;
  overflow: hidden;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.drama-card:hover .poster-img {
  transform: scale(1.05);
}

.provider-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.provider-badge.melolo {
  background: rgba(16, 185, 129, 0.85);
  color: #ffffff;
}

.provider-badge.dramabox {
  background: rgba(255, 51, 102, 0.85);
  color: #ffffff;
}

.ep-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 4px;
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.drama-info {
  padding: 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.drama-title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.drama-cat {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* LOAD MORE BUTTON */
.pagination-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.btn-load-more {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 10px 28px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-load-more:active {
  background: var(--accent-gradient);
  border-color: transparent;
  transform: scale(0.95);
}

/* EMPTY STATES */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h4 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 280px;
}

/* BOTTOM NAVIGATION BAR (FIXED MOBILE) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(9, 10, 16, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px 0;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item span {
  font-size: 0.7rem;
  font-weight: 600;
}

.nav-item.active {
  color: var(--accent-pink);
}

.nav-item.active svg {
  stroke: var(--accent-pink);
  filter: drop-shadow(0 0 8px rgba(255, 51, 102, 0.5));
}

/* FULLSCREEN VIDEO PLAYER VIEW */
.player-view {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.player-view.hidden {
  display: none;
}

/* PLAYER TOP BAR */
.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.player-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.player-icon-btn:active {
  transform: scale(0.92);
}

.player-meta {
  flex: 1;
  margin: 0 12px;
  text-align: center;
  overflow: hidden;
}

.player-title {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-part-badge,
.player-part-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 51, 102, 0.18);
  border: 1px solid rgba(255, 51, 102, 0.45);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.75rem;
  color: #ff6699;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.player-part-badge-btn:hover {
  background: rgba(255, 51, 102, 0.35);
  transform: translateY(-1px);
}

.player-part-badge-btn:active {
  transform: scale(0.95);
}

/* VIDEO CONTAINER */
.video-container {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#mainVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* DOUBLE-TAP GESTURE OVERLAY */
.gesture-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}

.gesture-half {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gesture-half.active {
  opacity: 1;
}

.gesture-text {
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
}

/* CENTER PLAYER FEEDBACK HUD (Scroll Episode / Volume HUD) */
.player-hud {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(18, 19, 31, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 14px 26px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  z-index: 25;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-hud.hidden {
  opacity: 0;
  transform: translate(-50%, -40%) scale(0.92);
  pointer-events: none;
}

.player-hud-icon {
  font-size: 1.4rem;
}

/* LOADING SPINNER */
.player-loading {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-size: 0.85rem;
  pointer-events: none;
}

.player-loading.hidden {
  display: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* PLAYER BOTTOM CONTROLS */
.player-controls-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.progress-wrap {
  width: 100%;
  margin-bottom: 10px;
}

#videoSeek {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

#videoSeek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent-pink);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-pink);
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-full);
}

.play-pause-btn {
  width: 52px;
  height: 52px;
  background: var(--accent-gradient);
  box-shadow: var(--accent-glow);
}

.play-pause-btn:active {
  transform: scale(0.92);
}

.drawer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

/* QUICK PART SELECT DROPDOWN */
.part-select-wrap {
  display: flex;
  align-items: center;
}

.part-select-dropdown {
  background: rgba(30, 27, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  max-width: 110px;
}

.part-select-dropdown:hover,
.part-select-dropdown:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.35);
}

.part-select-dropdown option {
  background: #181428;
  color: #ffffff;
  font-weight: 600;
  padding: 6px;
}

/* VOLUME CONTROL MODULE */
.volume-control-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.volume-control-wrap:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.volume-btn {
  padding: 4px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.volume-btn:active {
  transform: scale(0.9);
}

.volume-slider {
  width: 65px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  background: var(--accent-pink);
  transform: scale(1.25);
  box-shadow: 0 0 8px var(--accent-pink);
}

@media (max-width: 480px) {
  .volume-slider {
    width: 48px;
  }
  .part-select-dropdown {
    max-width: 85px;
    font-size: 0.78rem;
    padding: 5px 8px;
  }
}

/* THUMB-ZONE BOTTOM SHEET / EPISODE DRAWER */
.drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 22;
  opacity: 1;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.drawer-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 75vh;
  background: #12131f;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border-top: 1px solid var(--border-glass);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  z-index: 25;
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: var(--safe-bottom);
}

.bottom-sheet.collapsed {
  transform: translateY(105%);
  pointer-events: none;
}

.sheet-handle-bar {
  padding: 10px 0 6px 0;
  display: flex;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
}

.sheet-handle-bar:hover {
  opacity: 0.8;
}

.sheet-handle {
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.sheet-header {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  gap: 8px;
}

.sheet-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.sheet-title-row:hover h4 {
  color: var(--accent-pink);
}

.sheet-toggle-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
}

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

.sheet-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sheet-close-btn:hover {
  background: rgba(255, 51, 102, 0.25);
  border-color: #ff3366;
  color: #ff3366;
  transform: translateY(-1px);
}

.sheet-close-btn:active {
  transform: scale(0.95);
}

.control-btn.drawer-btn.active {
  background: rgba(255, 51, 102, 0.28);
  border-color: #ff3366;
  color: #ff3366;
}

.sheet-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sheet-stats {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.quick-jump-box {
  display: flex;
  gap: 6px;
  align-items: center;
}

.quick-jump-box input {
  width: 80px;
  padding: 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
}

.quick-jump-box button {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.sheet-legend {
  padding: 8px 16px;
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.active {
  background: var(--accent-pink);
  box-shadow: 0 0 6px var(--accent-pink);
}

.dot.watched {
  background: var(--color-watched-text);
  box-shadow: 0 0 6px var(--color-watched-text);
}

.dot.unwatched {
  background: rgba(255, 255, 255, 0.25);
}

/* EPISODES GRID INSIDE DRAWER */
.episodes-grid {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

@media (min-width: 480px) {
  .episodes-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

.ep-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.2s ease;
}

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

/* COLOR CODING RULES */
/* 1. WATCHED EPISODE: EMERALD GREEN */
.ep-item.watched {
  background: var(--color-watched-bg);
  border-color: var(--color-watched-border);
  color: var(--color-watched-text);
}

.ep-item.watched::after {
  content: "✓";
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

/* 2. ACTIVE EPISODE: NEON PINK */
.ep-item.active {
  background: var(--accent-pink) !important;
  border-color: #ff6699 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(255, 51, 102, 0.6) !important;
  font-weight: 800;
}

.ep-item.active::after {
  content: "▶" !important;
  font-size: 0.65rem;
  line-height: 1;
}

/* 3. LOCKED VIP EPISODE */
.ep-item.locked {
  opacity: 0.55;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.ep-item.locked:hover {
  opacity: 0.85;
  border-color: rgba(255, 255, 255, 0.4);
}

.ep-item .lock-badge {
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.85;
}

/* PLAYER ERROR & VIP NOTICE OVERLAY */
.player-error-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 20, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 30;
  transition: opacity 0.3s ease;
}

.player-error-overlay.hidden {
  display: none;
}

.player-error-card {
  max-width: 380px;
  width: 100%;
  background: rgba(25, 28, 48, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8);
}

.player-error-icon {
  font-size: 2.6rem;
}

.player-error-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.player-error-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.player-error-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.player-error-btn-primary {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(255, 51, 102, 0.4);
}

.player-error-btn-primary:active {
  transform: scale(0.96);
}

.player-error-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-error-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.player-error-btn-secondary:active {
  transform: scale(0.96);
}

/* TOAST NOTIFICATION */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 19, 31, 0.95);
  border: 1px solid var(--border-glass);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 10000;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hidden {
  opacity: 0;
  transform: translate(-50%, 15px);
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   SEO & GEO TOPICAL AUTHORITY STYLING
   ========================================================================== */
.seo-header-intro {
  padding: 14px 16px 4px 16px;
  max-width: 900px;
  margin: 0 auto;
}

.seo-main-h1 {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  background: linear-gradient(135deg, #ffffff 30%, #ff8a65 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

@media (min-width: 768px) {
  .seo-main-h1 {
    font-size: 1.45rem;
  }
}

.seo-lead-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.seo-content-block {
  margin: 28px 14px 80px 14px;
}

.seo-card-glass {
  background: rgba(18, 19, 28, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  max-width: 960px;
  margin: 0 auto;
}

.seo-section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.seo-badge-tag {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--accent-pink);
  background: rgba(255, 51, 102, 0.12);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 51, 102, 0.25);
  text-transform: uppercase;
}

.seo-section-h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.seo-summary-text {
  font-size: 0.86rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 20px;
}

.seo-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .seo-metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.seo-metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
}

.metric-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ff6b4a;
  display: block;
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  display: block;
  margin-top: 2px;
}

.metric-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

.seo-faq-container {
  margin-top: 20px;
  border-top: 1px solid var(--border-glass);
  padding-top: 18px;
}

.seo-faq-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
}

.seo-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.seo-faq-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.seo-faq-q {
  font-size: 0.86rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.seo-faq-a {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #94a3b8;
}

.seo-tags-wrap {
  margin-top: 22px;
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
}

.seo-tags-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 8px;
}

.seo-tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seo-tag-pill {
  font-size: 0.74rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 11px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s ease;
}

.seo-tag-pill:hover {
  background: rgba(255, 51, 102, 0.15);
  border-color: rgba(255, 51, 102, 0.4);
  color: #ffffff;
}

.seo-footer {
  margin-top: 24px;
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
  text-align: center;
}

.seo-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.74rem;
}

.seo-footer-links a {
  color: var(--accent-orange);
  text-decoration: none;
  transition: color 0.2s;
}

.seo-footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.seo-footer-links .dot {
  color: var(--text-dim);
}

.seo-footer-copy {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ==========================================================================
   DRAMA INFO & SYNOPSIS MODAL / DRAWER STYLES
   ========================================================================== */

/* Top bar button styling */
.btn-drama-info {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-drama-info:hover {
  background: rgba(255, 51, 102, 0.25);
  border-color: #ff3366;
  color: #ff3366;
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.35);
}

.btn-drama-info .info-btn-text {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.2px;
}

@media (max-width: 380px) {
  .btn-drama-info .info-btn-text {
    display: none;
  }
}

/* Drawer synopsis preview bar */
.drawer-synopsis-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-glass);
  padding: 8px 16px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.drawer-synopsis-bar:hover {
  background: rgba(255, 255, 255, 0.08);
}

.synopsis-badge {
  background: rgba(255, 51, 102, 0.18);
  border: 1px solid rgba(255, 51, 102, 0.35);
  color: #ff6699;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.7rem;
  white-space: nowrap;
}

.synopsis-preview-text {
  flex: 1;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.3;
}

.btn-read-synopsis {
  background: transparent;
  border: none;
  color: var(--accent-orange);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  padding: 2px 4px;
}

.btn-read-synopsis:hover {
  text-decoration: underline;
  color: #fff;
}

/* Modal Sinopsis Popup */
.drama-info-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.3s ease;
}

.drama-info-modal.hidden {
  display: none !important;
}

.drama-info-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.drama-info-sheet {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  background: rgba(24, 20, 40, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9), 0 0 24px rgba(255, 51, 102, 0.2);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPopUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.drama-info-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin: 10px auto 4px auto;
}

.drama-info-header {
  padding: 12px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.drama-info-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-badge-provider {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-pink);
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  width: fit-content;
}

.info-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin: 0;
}

.drama-info-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.drama-info-close:hover {
  background: rgba(255, 51, 102, 0.25);
  border-color: #ff3366;
  color: #fff;
}

.drama-info-body {
  padding: 16px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drama-info-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.info-meta-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.info-meta-pill.info-pill-green {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.info-meta-pill.info-pill-pink {
  background: rgba(255, 51, 102, 0.18);
  border-color: rgba(255, 51, 102, 0.45);
  color: #ff6699;
}

.drama-info-synopsis-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.synopsis-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.synopsis-content {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.drama-info-actions {
  margin-top: 4px;
}

.btn-continue-watch {
  width: 100%;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 51, 102, 0.4);
  transition: all 0.2s ease;
}

.btn-continue-watch:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 51, 102, 0.55);
}

.btn-continue-watch:active {
  transform: scale(0.98);
}
