/* ============================================
   DRACIN STREAM - Netflix-Inspired Theme
   ============================================ */

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

:root {
  --bg-primary: #000000;
  --bg-secondary: #141414;
  --bg-tertiary: #1f1f1f;
  --bg-card: #181818;
  --bg-card-hover: #242424;
  --accent: #e50914;
  --accent-hover: #f40612;
  --accent-dark: #b20710;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-tertiary: #808080;
  --border: rgba(255, 255, 255, 0.1);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.8);
  --gradient-hero: linear-gradient(to top, #000 0%, transparent 60%), linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  --header-height: 70px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 4%;
  transition: background 0.3s ease;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 10%, transparent);
}

.header.scrolled {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 40px;
  transition: transform 0.2s;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-menu {
  display: flex;
  gap: 24px;
  list-style: none;
  flex: 1;
}

.nav-menu a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  padding: 4px 0;
  position: relative;
}

.nav-menu a:hover, .nav-menu a.active {
  color: var(--text-primary);
}

.nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  background: rgba(0,0,0,0.75);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px 8px 38px;
  border-radius: 4px;
  font-size: 14px;
  width: 200px;
  font-family: inherit;
  transition: all 0.3s;
}

.search-box input:focus {
  outline: none;
  width: 280px;
  border-color: var(--text-primary);
  background: rgba(0,0,0,0.9);
}

.search-box svg {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

/* Mobile nav toggle */
.mobile-toggle {
  display: none;
  font-size: 24px;
  color: var(--text-primary);
}
/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  height: 80vh;
  min-height: 500px;
  width: 100%;
  overflow: hidden;
  margin-bottom: -100px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
  z-index: 2;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.6);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #000 0%, transparent 50%), 
              linear-gradient(to right, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
}

.hero-content {
  position: absolute;
  bottom: 15%;
  left: 4%;
  max-width: 550px;
  z-index: 3;
  animation: heroFadeIn 0.8s ease;
}

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

.hero-badge {
  display: inline-block;
  background: #e50914;
  color: white;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-shadow: 2px 4px 8px rgba(0,0,0,0.6);
  font-weight: 700;
}

.hero-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 14px;
  color: rgba(255,255,255,0.9);
  align-items: center;
  flex-wrap: wrap;
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hero-meta .dot {
  width: 4px;
  height: 4px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  display: inline-block;
}

.hero-desc {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-dots {
  position: absolute;
  bottom: 60px;
  left: 4%;
  display: flex;
  gap: 8px;
  z-index: 4;
}

.hero-dots button {
  width: 32px;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.hero-dots button.active {
  background: #e50914;
  width: 48px;
}

@media (max-width: 768px) {
  .hero {
    height: 60vh;
    min-height: 400px;
    margin-bottom: -60px;
  }
  .hero-content {
    bottom: 10%;
    left: 16px;
    right: 16px;
    max-width: none;
  }
  .hero-title {
    font-size: 28px;
  }
  .hero-desc {
    font-size: 13px;
    -webkit-line-clamp: 1;
  }
  .hero-actions {
    gap: 8px;
  }
  .hero-dots {
    bottom: 40px;
    left: 16px;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn-play {
  background: white;
  color: black;
}
.btn-play:hover {
  background: rgba(255,255,255,0.8);
  transform: translateY(-1px);
}

.btn-info {
  background: rgba(109,109,110,0.7);
  color: white;
  backdrop-filter: blur(4px);
}
.btn-info:hover {
  background: rgba(109,109,110,0.5);
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(42,42,42,0.6);
}
.btn-icon-only:hover {
  border-color: white;
  background: rgba(42,42,42,0.9);
}

/* Hero dots indicator */
.hero-dots {
  position: absolute;
  bottom: 130px;
  left: 4%;
  display: flex;
  gap: 8px;
  z-index: 4;
}
.hero-dots button {
  width: 32px;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  transition: all 0.3s;
}
.hero-dots button.active {
  background: var(--accent);
  width: 48px;
}

/* ============================================
   SOURCE TABS
   ============================================ */
.source-tabs-wrap {
  position: relative;
  z-index: 5;
  padding: 0 4%;
  margin-bottom: 32px;
}

.source-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.source-tabs::-webkit-scrollbar { display: none; }

.source-tab {
  padding: 8px 20px;
  background: rgba(42,42,42,0.6);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.source-tab:hover {
  background: rgba(60,60,60,0.8);
  color: var(--text-primary);
}
.source-tab.active {
  background: white;
  color: black;
  border-color: white;
}
.source-tab .count {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 4px;
}

/* ============================================
   ROW / CAROUSEL
   ============================================ */
.row-section {
  margin-bottom: 48px;
  padding: 0 4%;
}

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

.row-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-title .accent {
  color: var(--accent);
}

.row-link {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.row-link:hover {
  color: var(--text-primary);
}

.row-container {
  position: relative;
}

.row-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 8px 0;
}
.row-scroll::-webkit-scrollbar { display: none; }

.row-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50px;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.3s;
  cursor: pointer;
  font-size: 24px;
  color: white;
}
.row-container:hover .row-nav { opacity: 1; }
.row-nav.prev { left: 0; border-radius: 0 4px 4px 0; }
.row-nav.next { right: 0; border-radius: 4px 0 0 4px; }
.row-nav:hover { background: rgba(0,0,0,0.85); }

/* ============================================
   CARD
   ============================================ */
.card {
  flex: 0 0 auto;
  width: 220px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
  position: relative;
}

.card:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-hover);
  z-index: 10;
}

.card-poster {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--bg-tertiary);
}

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

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

.card-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover .card-poster::after {
  opacity: 1;
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: white;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 3px;
  text-transform: uppercase;
  z-index: 2;
}

.card-eps {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.card-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 3;
}

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

.card-play-overlay .play-circle {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: black;
  transform: scale(0.8);
  transition: transform 0.3s;
}

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

.card-info {
  padding: 10px 12px 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.card-meta .source-tag {
  color: var(--accent);
  font-weight: 600;
}

/* Continue watching progress bar */
.card-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.2);
  z-index: 4;
}
.card-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

/* ============================================
   GRID (browse page)
   ============================================ */
.page-header {
  padding: calc(var(--header-height) + 40px) 4% 32px;
}

.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 0 4% 60px;
}

.browse-grid .card {
  width: 100%;
}

/* No results */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}
.empty-state .icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}
.empty-state h3 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 40px 0 80px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 40px;
  text-align: center;
}
.pagination a:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.pagination .current {
  background: var(--accent);
  color: white;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================
   DETAIL PAGE
   ============================================ */
.detail-hero {
  position: relative;
  min-height: 80vh;
  padding: calc(var(--header-height) + 40px) 4% 60px;
  display: flex;
  align-items: flex-end;
}
.detail-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.detail-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(30px) brightness(0.4);
}
.detail-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-primary) 0%, rgba(0,0,0,0.5) 60%, rgba(0,0,0,0.7) 100%);
}

.detail-container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  width: 100%;
  align-items: flex-end;
}

.detail-poster {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-hover);
  aspect-ratio: 2/3;
}
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info .badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.badge {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 3px;
  text-transform: uppercase;
}
.badge.accent { background: var(--accent); color: white; }
.badge.outline { border: 1px solid var(--border); color: var(--text-secondary); }

.detail-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.detail-meta {
  display: flex;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.detail-desc {
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  line-height: 1.6;
  max-width: 800px;
}

/* Episodes section */
.episodes-section {
  padding: 40px 4% 80px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title {
  font-size: 24px;
  font-weight: 700;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.ep-btn {
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.ep-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.ep-btn.watched {
  background: rgba(229, 9, 20, 0.15);
  border-color: var(--accent);
}
.ep-btn.watched::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  color: var(--accent);
}

/* Sinopsis */
.sinopsis-box {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  margin-bottom: 32px;
}
.sinopsis-box h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.sinopsis-box p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 14px;
}

/* ============================================
   VIDEO PLAYER PAGE
   ============================================ */
.player-page {
  background: black;
  min-height: 100vh;
  padding-top: var(--header-height);
}

/* Container: layout 2-kolom di desktop (video + info samping), 
   stacked di mobile. Video diberi max-height supaya kontrol selalu terlihat. */
.player-layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 4%;
  gap: 24px;
}

.player-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: black;
  border-radius: 8px;
  overflow: hidden;
  /* Video portrait (dracin) → tinggi maksimal 75vh supaya muat layar.
     Lebar mengikuti aspect ratio video aslinya (object-fit: contain). */
  height: 75vh;
  max-height: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: black;
  display: block;
}

/* iframe player (untuk embed nightload) */
.video-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: black;
}

.player-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex-direction: column;
  gap: 16px;
  color: var(--text-secondary);
  text-align: center;
  padding: 20px;
}

.player-info {
  padding: 0;
}

.player-info h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.player-info .meta {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Episode list in player */
.player-eps {
  padding: 0 4% 80px;
  max-width: 1400px;
  margin: 0 auto;
}
.player-eps h3 {
  margin-bottom: 16px;
  font-size: 20px;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}

/* Mobile player adjustments */
@media (max-width: 768px) {
  .player-layout { padding: 12px 16px; gap: 16px; }
  .player-wrap { 
    height: 60vh;
    max-height: 600px;
    border-radius: 0;
    margin: 0 -16px;
    width: calc(100% + 32px);
    max-width: calc(100% + 32px);
  }
  .player-info h1 { font-size: 20px; }
  .player-eps { padding: 0 16px 60px; }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-secondary);
  padding: 40px 4%;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 2px;
}

.footer-text {
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ============================================
   MODAL (for download options etc)
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.active { display: flex; }

.modal {
  background: var(--bg-secondary);
  border-radius: 8px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 18px; }
.modal-close {
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-body {
  padding: 20px 24px;
}

.download-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: 6px;
  margin-bottom: 8px;
  transition: background 0.2s;
}
.download-option:hover { background: var(--bg-card-hover); }
.download-option-info { display: flex; flex-direction: column; }
.download-option-label { font-weight: 600; font-size: 14px; }
.download-option-meta { color: var(--text-tertiary); font-size: 12px; }
.download-option a {
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}
.download-option a:hover { background: var(--accent-hover); }

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 1000;
  transition: transform 0.3s;
  box-shadow: var(--shadow-card);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-left: 3px solid #28a745; }
.toast.error { border-left: 3px solid var(--accent); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .card { width: 180px; }
  .detail-container { grid-template-columns: 220px 1fr; gap: 24px; }
}

@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(8px);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    transform: translateY(-200%);
    transition: transform 0.3s;
    border-bottom: 1px solid var(--border);
  }
  .nav-menu.open { transform: translateY(0); }
  .mobile-toggle { display: block; }
  .search-box input { width: 140px; }
  .search-box input:focus { width: 180px; }
  
  .hero { height: 60vh; min-height: 400px; }
  .hero-content { bottom: 12%; max-width: 90%; left: 16px; right: 16px; }
  .hero-dots { bottom: 50px; left: 16px; }

  .source-tabs-wrap { padding: 0 16px; }
  .row-section { padding: 0 16px; }
  .page-header { padding: calc(var(--header-height) + 24px) 16px 24px; }
  .browse-grid {
    padding: 0 16px 40px;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  .card { width: 100%; }
  
  /* DETAIL PAGE MOBILE - SIMPLE */
  .detail-hero { 
    padding: calc(var(--header-height) + 20px) 16px 24px;
    min-height: auto;
    display: block;
  }
  .detail-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    z-index: 0;
  }
  .detail-bg img {
    filter: blur(40px) brightness(0.25);
  }
  .detail-container {
    grid-template-columns: 1fr;
    gap: 16px;
    position: relative;
    z-index: 1;
    text-align: center;
  }
  .detail-poster {
    max-width: 160px;
    margin: 0 auto;
    border-radius: 6px;
  }
  .detail-info {
    text-align: center;
  }
  .badge-row {
    justify-content: center;
  }
  .detail-title { 
    font-size: 24px;
    margin-bottom: 10px;
    line-height: 1.2;
    text-align: center;
  }
  .detail-meta { 
    justify-content: center;
    margin-bottom: 14px;
    font-size: 12px;
  }
  .detail-actions { 
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }
  .detail-desc { 
    font-size: 13px;
    text-align: left;
    margin-top: 12px;
  }
  
  /* PLAY MODE CARDS - MOBILE */
  .play-mode-cards {
    grid-template-columns: 1fr;
    max-width: 100%;
    margin: 16px 0;
  }
  .play-mode-card {
    justify-content: flex-start;
    text-align: left;
  }
  
  .episodes-section { padding: 24px 16px 60px; }
  .episode-grid { 
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 6px;
  }
  .ep-btn {
    padding: 10px 4px;
    font-size: 12px;
  }
  
  .footer { padding: 24px 16px; }
  .footer-content { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 36px; }
  .hero-desc { font-size: 13px; -webkit-line-clamp: 2; }
  .btn { padding: 8px 16px; font-size: 13px; }
  .card { width: 130px; }
  .card-info { padding: 8px 10px; }
  .card-title { font-size: 12px; }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card-hover) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   PLAY MODE CARDS (Full Movie vs Per Episode)
   ============================================ */
.play-mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
  max-width: 640px;
}
.play-mode-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}
.play-mode-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.play-mode-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.play-mode-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}
.play-mode-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}
.play-mode-resume {
  font-size: 11px;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 600;
}

/* ============================================
   MODE TOGGLE (in player)
   ============================================ */
.mode-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px;
  margin: 16px 0;
  gap: 4px;
}
.mode-btn {
  padding: 8px 16px;
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.mode-btn:hover { color: var(--text-primary); }
.mode-btn.active {
  background: var(--accent);
  color: white;
}

/* ============================================
   AUTO-NEXT EPISODE OVERLAY
   ============================================ */
.next-ep-overlay {
  position: absolute;
  bottom: 80px;
  right: 24px;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 240px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  z-index: 10;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.next-ep-overlay.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.next-ep-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.next-ep-label #nextEpCountdown {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.next-ep-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}
.next-ep-actions {
  display: flex;
  gap: 8px;
}
.next-ep-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
  flex: 1;
}

@media (max-width: 600px) {
  .next-ep-overlay {
    bottom: 60px;
    right: 12px;
    left: 12px;
    min-width: 0;
  }
}

/* ============================================
   CARD RESUME LABEL (in continue watching cards)
   ============================================ */
.card-resume-label {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
}
.card:hover .card-resume-label {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================
   DETAIL PAGE MOBILE FIX (override)
   ============================================ */
@media (max-width: 768px) {
  .detail-hero { 
    padding: 90px 16px 24px !important;
    min-height: auto !important;
    display: block !important;
  }
  
  .detail-bg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    z-index: 0 !important;
  }
  
  .detail-bg img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    filter: blur(40px) brightness(0.25) !important;
  }
  
  .detail-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
    position: relative !important;
    z-index: 1 !important;
    text-align: center !important;
    grid-template-columns: none !important;
  }
  
  .detail-poster {
    max-width: 160px !important;
    width: 160px !important;
    margin: 0 auto !important;
    border-radius: 6px !important;
  }
  
  .detail-info {
    text-align: center !important;
    width: 100% !important;
  }
  
  .badge-row {
    justify-content: center !important;
  }
  
  .detail-title { 
    font-size: 22px !important;
    margin-bottom: 10px !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }
  
  .detail-meta { 
    justify-content: center !important;
    margin-bottom: 14px !important;
    font-size: 12px !important;
  }
  
  .detail-actions { 
    justify-content: center !important;
    flex-wrap: wrap !important;
    margin-bottom: 16px !important;
  }
  
  .detail-desc { 
    font-size: 13px !important;
    text-align: left !important;
    margin-top: 12px !important;
  }
  
  .play-mode-cards {
    grid-template-columns: 1fr 1fr !important;
    max-width: 100% !important;
    margin: 16px 0 !important;
    gap: 8px !important;
  }
  
  .play-mode-card {
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 12px !important;
    gap: 10px !important;
  }
  
  .play-mode-icon {
    font-size: 24px !important;
  }
  
  .play-mode-title {
    font-size: 13px !important;
  }
  
  .play-mode-desc {
    font-size: 11px !important;
  }
}

/* ============================================
   BUTTON STYLES - PLAYER PAGE
   ============================================ */

/* Tombol back */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  margin: 12px 0 20px;
}
.btn-back:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(-2px);
}

/* Mode toggle - lebih bagus */
.mode-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 5px;
  margin: 12px 0 20px;
  gap: 4px;
}

.mode-btn {
  padding: 9px 18px;
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s;
  text-decoration: none;
  white-space: nowrap;
}
.mode-btn:hover { 
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.mode-btn.active {
  background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

/* Nav buttons (Ep Sebelumnya / Berikutnya) */
.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-nav:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(-2px);
}

.btn-nav-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}
.btn-nav-primary:hover {
  background: linear-gradient(135deg, #f40612 0%, #c20810 100%);
  transform: translateX(2px);
  box-shadow: 0 6px 18px rgba(229, 9, 20, 0.5);
}

/* Episode buttons - lebih bagus */
.ep-btn {
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ep-btn:hover {
  background: rgba(229, 9, 20, 0.15);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.2);
}
.ep-btn.watched {
  background: rgba(229, 9, 20, 0.1);
  border-color: rgba(229, 9, 20, 0.4);
}
.ep-btn.watched::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 9px;
  color: var(--accent);
  font-weight: 700;
}

/* Mobile - tombol lebih kecil */
@media (max-width: 768px) {
  .btn-back {
    padding: 8px 14px;
    font-size: 12px;
  }
  .mode-toggle {
    width: 100%;
    justify-content: center;
  }
  .mode-btn {
    padding: 8px 14px;
    font-size: 12px;
    flex: 1;
    text-align: center;
  }
  .btn-nav,
  .btn-nav-primary {
    padding: 10px 16px;
    font-size: 13px;
    flex: 1;
    justify-content: center;
  }
  .action-bar {
    display: flex;
    gap: 8px;
  }
}