:root {
  --bg-dark: #07080c;
  --bg-surface: #0e1017;
  --bg-card: #141722;
  --bg-card-hover: #1e2233;
  --accent-primary: #ff5400;
  --accent-gradient: linear-gradient(135deg, #ff4500 0%, #ff7a00 50%, #ffaa00 100%);
  --accent-glow: rgba(255, 84, 0, 0.4);
  --accent-glow-strong: rgba(255, 84, 0, 0.7);
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 84, 0, 0.4);
  --glass-bg: rgba(14, 16, 23, 0.85);
  --glass-border: rgba(255, 255, 255, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-main: 'Prompt', 'Outfit', sans-serif;
  --font-en: 'Outfit', 'Prompt', sans-serif;
  --nav-height: 110px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-dark);
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #2a2f45;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ====== NAVBAR ====== */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  gap: 16px;
}

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

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

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--accent-glow);
  color: #fff;
}
.brand-icon svg {
  width: 22px;
  height: 22px;
}

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

.brand-title {
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
}
.brand-title .highlight {
  color: var(--accent-primary);
  margin-left: 2px;
}

.brand-badge {
  font-size: 10px;
  font-weight: 800;
  background: var(--accent-gradient);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Category Selector Button */
.category-selector-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s ease;
}
.category-selector-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}
.cat-icon-wrap {
  font-size: 14px;
}
.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* Center Search */
.nav-search {
  flex: 1;
  max-width: 440px;
  position: relative;
  display: flex;
  align-items: center;
}
.nav-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 10px 16px 10px 42px;
  border-radius: var(--radius-full);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: all 0.3s ease;
}
.nav-search input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}
.nav-search input::placeholder {
  color: var(--text-dim);
}
.nav-search .search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}

/* Nav Right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  transition: all 0.2s ease;
}
.nav-btn svg {
  width: 18px;
  height: 18px;
}
.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.nav-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
}

/* Category Tabs Scroll Bar */
.cat-tabs-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(10, 12, 18, 0.5);
}
.cat-tabs-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 24px;
  max-width: 1440px;
  margin: 0 auto;
  scrollbar-width: none;
}
.cat-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.cat-tab-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.cat-tab-pill img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
}
.cat-tab-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.cat-tab-pill.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 15px var(--accent-glow);
  transform: scale(1.02);
}

/* ====== MAIN CONTAINER & VIEWS ====== */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

.view-page {
  display: none;
}
.view-page.active {
  display: block;
}

/* ====== HERO SECTION ====== */
.hero-section {
  position: relative;
  height: 440px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  background: var(--bg-surface);
}
.hero-slides {
  width: 100%;
  height: 100%;
  position: relative;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.hero-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.5) contrast(1.1);
  transform: scale(1.02);
  transition: transform 6s ease;
}
.hero-slide.active .hero-backdrop {
  transform: scale(1.08);
}
.hero-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 8, 12, 0.95) 0%, rgba(7, 8, 12, 0.6) 45%, transparent 100%),
              linear-gradient(0deg, rgba(7, 8, 12, 0.9) 0%, transparent 60%);
}
.hero-content {
  position: absolute;
  bottom: 40px;
  left: 40px;
  max-width: 540px;
  z-index: 2;
}
.hero-app-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hero-app-badge img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}
.hero-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.hero-synopsis {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 0.25s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow-strong);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.hero-dots {
  position: absolute;
  bottom: 20px;
  right: 30px;
  display: flex;
  gap: 6px;
  z-index: 3;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}
.hero-dot.active {
  width: 24px;
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ====== SECTIONS & CARDS ====== */
.section-container {
  margin-bottom: 40px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-icon {
  font-size: 20px;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.section-badge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 84, 0, 0.15);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}
.btn-text {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.btn-text:hover {
  text-decoration: underline;
}

/* Cards Grid & Scroll Row */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.cards-scroll-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}

/* Single Drama Card */
.drama-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  flex: 0 0 170px;
}
.cards-grid .drama-card {
  flex: auto;
}

.drama-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-active);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
}

.card-poster-wrap {
  position: relative;
  width: 100%;
  padding-top: 145%; /* Aspect ratio 1:1.45 (Fits 2:3 drama poster proportions) */
  background: var(--bg-surface);
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.card-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.4s ease;
}
.drama-card:hover .card-poster-img {
  transform: scale(1.06);
}

.card-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 40%);
  pointer-events: none;
  z-index: 1;
}

.card-rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  z-index: 3;
  line-height: 1;
}

.card-badge-app {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 3;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.card-footer-info {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
  pointer-events: none;
}

.card-eps-pill,
.card-badge-ep {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--accent-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 84, 0, 0.3);
  z-index: 3;
}

.card-footer-info .card-eps-pill {
  position: relative;
  bottom: auto;
  right: auto;
}

.card-play-hover,
.card-hover-play {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.card-play-hover .play-circle,
.card-hover-play .play-circle-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--accent-glow);
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.card-play-hover svg,
.card-hover-play svg {
  width: 20px;
  height: 20px;
  fill: #000;
  margin-left: 2px;
}
.drama-card:hover .card-play-hover,
.drama-card:hover .card-hover-play {
  opacity: 1;
}
.drama-card:hover .card-play-hover .play-circle,
.drama-card:hover .card-hover-play .play-circle-icon {
  transform: scale(1);
}

.card-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 6px;
  box-sizing: border-box;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  margin: 0;
}
.card-meta,
.card-sub-info {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  gap: 6px;
}
.card-status-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
  flex-shrink: 0;
}

/* Continue Watching Card Variation */
.cw-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 3;
}
.cw-progress-fill {
  height: 100%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ====== SEARCH VIEW ====== */
.search-view-container {
  max-width: 900px;
  margin: 0 auto;
  padding-top: 10px;
}
.page-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 20px;
}
.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.search-input-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 16px 48px 16px 52px;
  border-radius: var(--radius-full);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}
.search-input-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 25px var(--accent-glow);
}
.search-box-icon {
  position: absolute;
  left: 20px;
  width: 22px;
  height: 22px;
  color: var(--text-dim);
}
.clear-btn {
  position: absolute;
  right: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-provider-selector {
  margin-bottom: 30px;
}
.provider-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: block;
}
.search-provider-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.provider-pill {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.provider-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.provider-pill.active {
  background: var(--accent-gradient);
  color: #000;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon {
  font-size: 54px;
  margin-bottom: 12px;
  opacity: 0.8;
}
.empty-text {
  font-size: 15px;
  color: var(--text-muted);
}

/* ====== MODALS & SHEETS ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
}
.modal-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}
.modal-close-btn svg {
  width: 18px;
  height: 18px;
}
.modal-close-btn:hover {
  background: var(--accent-primary);
  color: #000;
}

/* Detail Modal Sheet */
.detail-sheet {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 880px;
  max-height: 88vh;
  overflow-y: auto;
  z-index: 2;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  animation: modalScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.detail-sheet .modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.detail-banner-wrap {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: #000;
}
.detail-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px) brightness(0.4);
  transform: scale(1.1);
}
.detail-banner-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-surface) 0%, transparent 100%);
}

.detail-main-info {
  padding: 0 32px 32px;
  margin-top: -80px;
  position: relative;
  z-index: 2;
}
.detail-header-flex {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}
.detail-poster-img,
.detail-poster {
  width: 140px;
  height: 195px;
  max-width: 140px;
  max-height: 195px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .detail-header-flex {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .detail-title-group {
    align-items: center;
  }
  .detail-tags-row,
  .detail-action-buttons {
    justify-content: center;
  }
  .detail-poster-img,
  .detail-poster {
    width: 130px;
    height: 180px;
  }
}
.detail-title-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.detail-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
}
.detail-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.detail-tag {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}
.detail-action-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-synopsis-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.episodes-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.ep-view-switcher {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: var(--radius-full);
}
.ep-view-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}
.ep-view-btn.active {
  background: var(--accent-primary);
  color: #000;
}

/* Episodes Grid (Number Buttons) */
.episodes-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px;
}

/* Episodes Thumbnail List (Rich Visual Cards) */
.episodes-thumb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.ep-thumb-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}
.ep-thumb-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
}
.ep-thumb-card.active {
  border-color: var(--accent-primary);
  background: rgba(255, 84, 0, 0.1);
  box-shadow: 0 0 15px var(--accent-glow);
}
.ep-thumb-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: var(--bg-surface);
  overflow: hidden;
}
.ep-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.ep-thumb-card:hover .ep-thumb-img {
  transform: scale(1.05);
}
.ep-thumb-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.ep-thumb-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ep-thumb-card:hover .ep-thumb-play-overlay,
.ep-thumb-card.active .ep-thumb-play-overlay {
  opacity: 1;
}
.ep-thumb-play-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}
.ep-thumb-info {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ep-thumb-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-number-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 12px 0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ep-number-btn:hover {
  background: rgba(255, 84, 0, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.ep-number-btn.active {
  background: var(--accent-gradient);
  color: #000;
  border-color: transparent;
  font-weight: 700;
}
.ep-number-btn.watched {
  border-color: rgba(255, 84, 0, 0.4);
  color: var(--accent-primary);
}

/* Providers Grid Modal */
.cat-modal-sheet {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 760px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  z-index: 2;
}
.cat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title-group h3 {
  font-size: 20px;
  font-weight: 700;
}
.modal-title-group p {
  font-size: 13px;
  color: var(--text-dim);
}
.cat-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.cat-grid-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.cat-grid-card img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}
.cat-grid-card span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}
.cat-grid-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}
.cat-grid-card.active {
  background: rgba(255, 84, 0, 0.15);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}

/* User Sheet (Bookmarks & History) */
.user-sheet {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  z-index: 2;
}
.user-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sheet-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: var(--radius-full);
}
.sheet-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sheet-tab.active {
  background: var(--accent-primary);
  color: #000;
}
.user-sheet-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.btn-danger-text {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}
.user-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.user-item-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}
.user-item-poster {
  width: 50px;
  height: 70px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.user-item-details {
  flex: 1;
}
.user-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.user-item-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.user-item-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 8px;
  cursor: pointer;
  border-radius: var(--radius-full);
}
.user-item-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ====== IMMERSIVE VERTICAL VIDEO PLAYER ====== */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
}
.player-overlay.active {
  display: flex;
}

.player-wrapper {
  position: relative;
  width: 100%;
  height: 100dvh;
  max-width: 520px; /* Designed vertical aspect fit on desktop */
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-wrapper.widescreen-mode {
  max-width: 960px;
}

@media (min-width: 768px) {
  .player-wrapper {
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.9), 0 0 40px var(--accent-glow);
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
  }
}

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

.player-blur-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(25px) brightness(0.4);
  transform: scale(1.1);
  opacity: 0.8;
}

#mainVideoPlayer {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.touch-interactive-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Top Player Bar */
.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  gap: 12px;
  transition: opacity 0.3s ease;
}
.player-top-bar.hide-ui {
  opacity: 0;
  pointer-events: none;
}
.player-icon-btn {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.player-icon-btn svg {
  width: 20px;
  height: 20px;
}
.player-info {
  flex: 1;
  overflow: hidden;
}
.player-brand-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.player-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-ep-text {
  font-size: 11px;
  color: var(--text-muted);
}

.player-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-dropdown-wrap {
  position: relative;
}
.player-quality-btn {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
}
.quality-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(14, 16, 23, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  padding: 6px;
  display: none;
  flex-direction: column;
  min-width: 110px;
  z-index: 20;
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}
.quality-dropdown-menu.show {
  display: flex;
}
.quality-dropdown-menu button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  text-align: left;
  font-family: inherit;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.quality-dropdown-menu button:hover,
.quality-dropdown-menu button.active {
  background: rgba(255, 84, 0, 0.2);
  color: var(--accent-primary);
  font-weight: 700;
}

/* Side Actions (TikTok Style) */
.player-side-actions {
  position: absolute;
  right: 16px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
  transition: opacity 0.3s ease;
}
.player-side-actions.hide-ui {
  opacity: 0;
  pointer-events: none;
}
.side-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}
.side-action-btn svg {
  width: 26px;
  height: 26px;
  padding: 10px;
  box-sizing: content-box;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}
.side-action-btn:hover svg,
.side-action-btn.active svg {
  background: var(--accent-primary);
  color: #000;
  fill: #000;
  border-color: transparent;
  transform: scale(1.1);
}
.side-action-btn span {
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* Bottom Player Controls Bar */
.player-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 20px 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  z-index: 10;
  transition: opacity 0.3s ease;
}
.player-bottom-bar.hide-ui {
  opacity: 0;
  pointer-events: none;
}

.player-progress-container {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  cursor: pointer;
  margin-bottom: 12px;
}
.player-progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
}
.player-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px var(--accent-glow);
}
.player-scrubber-handle {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.player-progress-container:hover .player-scrubber-handle {
  opacity: 1;
}

.player-bottom-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bottom-ctrl-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.player-ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.player-ctrl-btn svg {
  width: 22px;
  height: 22px;
}
.player-ctrl-btn:hover {
  color: var(--accent-primary);
  transform: scale(1.15);
}
#playerPlayPauseBtn svg {
  width: 28px;
  height: 28px;
}
.player-time-display {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-en);
}

/* Double Tap Seek Ripples */
.seek-ripple {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.seek-ripple.left { left: 0; border-radius: 0 100px 100px 0; }
.seek-ripple.right { right: 0; border-radius: 100px 0 0 100px; }
.seek-ripple span {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: rgba(0,0,0,0.6);
  padding: 8px 16px;
  border-radius: var(--radius-full);
}
.seek-ripple.active {
  opacity: 1;
}

/* Swipe Hint */
.swipe-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.swipe-hint.show {
  opacity: 1;
}
.swipe-arrow {
  font-size: 28px;
  color: var(--accent-primary);
}
.swipe-hint span {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 8px 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* Player Loader */
.player-loader {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 12, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
  color: #fff;
  transition: opacity 0.4s ease;
}
.spinner-circle {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.player-loading-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.player-loading-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* Episode Drawer */
.episodes-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(14, 16, 23, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 60%;
  padding: 20px;
  z-index: 30;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
}
.episodes-drawer.open {
  transform: translateY(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.drawer-header h3 {
  font-size: 16px;
  font-weight: 700;
}
.drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding-bottom: 10px;
}

/* Next Episode Auto Play Countdown Card */
.next-ep-countdown-card {
  position: absolute;
  right: 20px;
  bottom: 80px;
  background: rgba(14, 16, 23, 0.95);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: none;
  align-items: center;
  gap: 16px;
  z-index: 35;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px var(--accent-glow);
  animation: slideLeft 0.4s ease;
}
.next-ep-countdown-card.show {
  display: flex;
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
.next-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-primary);
  text-transform: uppercase;
}
.next-ep-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.next-action-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-play-now {
  background: var(--accent-primary);
  color: #000;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.countdown-circle-wrap {
  position: relative;
  width: 32px;
  height: 32px;
}
.countdown-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 3.5;
}
.circle-progress {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear;
}
.countdown-seconds {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}

/* Toast Notifications */
.toast-popup {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(14, 16, 23, 0.95);
  border: 1px solid var(--accent-primary);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast-popup.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Skeletons */
.hero-skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #121520 25%, #1a1e2e 50%, #121520 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.tab-skeleton {
  width: 90px;
  height: 32px;
  border-radius: var(--radius-full);
  background: #141722;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-container {
    padding: 10px 16px;
  }
  .nav-search {
    display: none; /* Accessible via modal */
  }
  .main-container {
    padding: 14px 16px 50px;
  }
  .hero-section, .movie-hero-section {
    height: 340px;
  }
  .hero-content {
    left: 20px;
    bottom: 24px;
    right: 20px;
  }
  .hero-title {
    font-size: 22px;
  }
  .detail-header-flex {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .detail-main-info {
    margin-top: -60px;
    padding: 0 16px 20px;
  }
  .detail-title-group {
    align-items: center;
  }
  .detail-action-buttons {
    justify-content: center;
  }
  .nav-label {
    display: none;
  }
  .main-mode-switcher {
    order: 3;
    width: 100%;
    margin-top: 6px;
    justify-content: center;
  }
}

/* ==================================================== */
/* MOVIES & STREAMING PLATFORMS STYLING                 */
/* ==================================================== */

/* Main Mode Switcher Bar in Navbar */
.nav-mode-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(10, 12, 18, 0.6);
  padding: 6px 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-mode-bar::-webkit-scrollbar {
  display: none;
}
.main-mode-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1440px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-mode-switcher::-webkit-scrollbar {
  display: none;
}
.mode-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.mode-tab-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.mode-tab-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #000;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--accent-glow);
}


/* Streaming Platforms Grid (10 Platforms matching screenshot) */
.movie-platforms-header {
  margin-bottom: 30px;
}
.streaming-platforms-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 10px;
}
@media (max-width: 992px) {
  .streaming-platforms-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .streaming-platforms-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.streaming-card {
  position: relative;
  height: 86px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: #0d0f17;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
.streaming-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
}
.streaming-card.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 25px var(--accent-glow), inset 0 0 15px var(--accent-glow);
  transform: scale(1.02);
}
.streaming-card-img {
  max-width: 85%;
  max-height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s ease;
}
.streaming-card:hover .streaming-card-img {
  transform: scale(1.08);
}
.streaming-card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-glow);
  opacity: 0;
}
.streaming-card.active .streaming-card-badge {
  opacity: 1;
}

/* Movie Hero Banner Carousel */
.movie-hero-section {
  position: relative;
  height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  background: var(--bg-surface);
}
.movie-hero-slides {
  width: 100%;
  height: 100%;
  position: relative;
}
.movie-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
.movie-hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.movie-hero-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) contrast(1.1);
  transform: scale(1.02);
  transition: transform 6s ease;
}
.movie-hero-slide.active .movie-hero-backdrop {
  transform: scale(1.07);
}
.movie-hero-dots {
  position: absolute;
  bottom: 20px;
  right: 30px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

/* Cinema Modal & Widescreen Player */
.cinema-sheet {
  position: relative;
  background: #0a0b10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 1080px;
  max-height: 92vh;
  overflow-y: auto;
  z-index: 2;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95);
  animation: modalScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cinema-sheet .modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
}

.cinema-video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Widescreen */
  background: #000;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.cinema-video-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cinema-body {
  padding: 24px 30px 36px;
}
.cinema-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.cinema-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 8px;
}
.cinema-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cinema-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
}
.cinema-pill.gold {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.3);
}
.cinema-pill.brand {
  color: var(--accent-primary);
  border-color: var(--border-active);
  font-weight: 700;
}

/* Audio Selector */
.cinema-audio-section {
  margin: 16px 0 20px;
}
.audio-select-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.audio-buttons-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.audio-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
/* Cinema Loading Overlay */
.cinema-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 16, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 8;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cinema-video-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
}

.audio-toggle-btn.active {
  background: rgba(255, 84, 0, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 700;
}

/* Search Scope Switcher (Drama vs Movies) */
.search-scope-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.search-scope-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}
.search-scope-btn.active {
  background: var(--accent-gradient);
  color: #000;
  font-weight: 700;
  border-color: transparent;
}

/* Cinema Status Notice Overlay */
.cinema-status-notice-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 16, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 24px;
}
.cinema-notice-card {
  max-width: 440px;
  background: rgba(20, 24, 36, 0.95);
  border: 1px solid rgba(255, 84, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 84, 0, 0.15);
}
.cinema-notice-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.cinema-notice-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.cinema-notice-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
.cinema-notice-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==================================================== */
/* AUTHENTICATION & USER PROFILE STYLES                 */
/* ==================================================== */

.nav-user-wrap {
  position: relative;
}

.btn-auth-nav {
  background: var(--accent-gradient);
  color: #000;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: all 0.2s ease;
}
.btn-auth-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-auth-nav svg {
  width: 16px;
  height: 16px;
}

.profile-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}
.profile-pill-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.1);
}
.avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #000;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-text-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}
.user-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role-badge {
  font-size: 9px;
  font-weight: 800;
  color: var(--accent-primary);
}

/* User Dropdown Popover */
.user-profile-menu {
  position: relative;
}
.user-dropdown-popover {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  width: 220px;
  background: rgba(14, 16, 23, 0.96);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  z-index: 50;
  padding: 8px;
  display: none;
  animation: modalScaleIn 0.2s ease;
}
.user-dropdown-popover.show {
  display: block;
}
.popover-header {
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}
.popover-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.popover-role {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 600;
}
.popover-menu-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.popover-item {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.popover-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.popover-item.admin-link {
  color: #facc15;
  font-weight: 700;
}
.popover-item.admin-link:hover {
  background: rgba(250, 204, 21, 0.15);
}
.popover-item.logout-btn {
  color: #ef4444;
}
.popover-item.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}
.popover-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* Auth Modal Sheet */
.auth-sheet {
  position: relative;
  background: rgba(14, 16, 23, 0.96);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 440px;
  padding: 32px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 84, 0, 0.1);
  backdrop-filter: blur(20px);
  z-index: 2;
  animation: modalScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.auth-header {
  text-align: center;
  margin-bottom: 20px;
}
.auth-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.auth-subtitle {
  font-size: 12px;
  color: var(--text-dim);
}
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  margin-bottom: 20px;
}
.auth-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}
.auth-tab-btn.active {
  background: var(--accent-gradient);
  color: #000;
  font-weight: 800;
}
.auth-form .form-group {
  margin-bottom: 14px;
  text-align: left;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-input, .form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  transition: all 0.2s ease;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
  background: rgba(255, 255, 255, 0.08);
}
.form-select option {
  background: #141722;
  color: #fff;
}
.auth-submit-btn {
  width: 100%;
  margin-top: 10px;
  height: 44px;
  justify-content: center;
  font-size: 14px;
}

/* Demo Accounts Quick Box */
.demo-accounts-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-subtle);
  text-align: left;
}
.demo-title {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}
.demo-btns-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.demo-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}
.demo-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--accent-primary);
}
.demo-btn.admin {
  border-color: rgba(250, 204, 21, 0.3);
  color: #facc15;
}

/* ==================================================== */
/* ADMIN DOWNLOAD CENTER DASHBOARD STYLES               */
/* ==================================================== */

.admin-dashboard-container {
  max-width: 1100px;
  margin: 0 auto;
}
.admin-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.admin-badge-tag {
  font-size: 11px;
  font-weight: 800;
  color: #facc15;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.storage-info-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  text-align: right;
}
.storage-label {
  font-size: 11px;
  color: var(--text-dim);
}
.storage-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-primary);
}
.storage-status-pill {
  font-size: 10px;
  font-weight: 700;
  color: #4ade80;
}

.admin-card-panel {
  background: rgba(14, 16, 23, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-icon {
  font-size: 20px;
}
.panel-title-wrap h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.panel-sub-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

.search-picker-wrap {
  position: relative;
}
.admin-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: #121520;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  z-index: 30;
  box-shadow: 0 15px 35px rgba(0,0,0,0.8);
}
.admin-search-item {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}
.admin-search-item:hover {
  background: rgba(255, 84, 0, 0.15);
}
.admin-search-item img {
  width: 32px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
}
.admin-search-item-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.admin-search-item-meta {
  font-size: 10px;
  color: var(--text-dim);
}

.selected-series-preview {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 84, 0, 0.08);
  border: 1px solid var(--border-active);
  padding: 10px 16px;
  border-radius: var(--radius-md);
}
.preview-img {
  width: 44px;
  height: 58px;
  object-fit: cover;
  border-radius: 4px;
}
.preview-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.preview-meta {
  font-size: 11px;
  color: var(--accent-primary);
}

.range-inputs-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tasks Queue List */
.tasks-queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.task-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-item-card.completed {
  border-color: rgba(74, 222, 128, 0.3);
}
.task-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.task-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.task-status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.task-status-badge.downloading {
  background: rgba(255, 84, 0, 0.2);
  color: var(--accent-primary);
  animation: pulseGlow 1.5s infinite;
}
.task-status-badge.completed {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}
.task-status-badge.cancelled {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.task-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.task-progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}
.task-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

/* Local Media Library Grid */
.local-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.local-media-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}
.local-media-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}
.local-card-top {
  display: flex;
  gap: 10px;
}
.local-card-poster {
  width: 50px;
  height: 68px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.local-card-details {
  overflow: hidden;
}
.local-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.local-card-meta {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 600;
}
.local-card-size {
  font-size: 10px;
  color: var(--text-dim);
}
.local-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.btn-sm-play {
  flex: 1;
  background: var(--accent-gradient);
  color: #000;
  border: none;
  padding: 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.btn-sm-del {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

/* Local Video Tag in Player */
.local-source-tag {
  background: rgba(74, 222, 128, 0.2);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #4ade80;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ==================================================== */
/* RONGYOK (โรงหยก) VIEW STYLES                         */
/* ==================================================== */
.rongyok-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.rongyok-filter-tabs {
  display: flex;
  gap: 10px;
}
.rongyok-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}
.rongyok-filter-btn:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
  color: #fff;
}
.rongyok-filter-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.rongyok-stats-tag {
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

/* ==================================================== */
/* COMPREHENSIVE RESPONSIVE DESIGN (MOBILE + DESKTOP)  */
/* ==================================================== */

/* ---- Desktop Extra Large (≥1400px): Premium layout ---- */
@media (min-width: 1400px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 22px;
  }
  .cards-scroll-row .drama-card { flex: 0 0 175px; width: 175px; }
  .hero-section, .movie-hero-section { height: 480px; }
  .hero-title { font-size: 32px; }
  .nav-container { padding: 14px 32px; }
  .main-container { padding: 24px 32px 80px; }
}

/* ---- Desktop Large (1200px – 1399px) ---- */
@media (min-width: 1200px) and (max-width: 1399px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 20px;
  }
  .cards-scroll-row .drama-card { flex: 0 0 165px; width: 165px; }
  .hero-section, .movie-hero-section { height: 440px; }
  .hero-title { font-size: 30px; }
}

/* ---- Desktop Medium (992px – 1199px) ---- */
@media (min-width: 992px) and (max-width: 1199px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 16px;
  }
  .cards-scroll-row .drama-card { flex: 0 0 155px; width: 155px; }
}

/* ---- Tablet (768px – 991px) ---- */
@media (min-width: 768px) and (max-width: 991px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }
  .cards-scroll-row .drama-card { flex: 0 0 145px; width: 145px; }
  .hero-section, .movie-hero-section { height: 360px; }
  .hero-title { font-size: 24px; }
  .hero-content { left: 28px; bottom: 28px; }
  .main-container { padding: 16px 20px 60px; }
  .detail-poster-img, .detail-poster {
    width: 120px; height: 168px;
  }
  .player-wrapper { max-width: 600px !important; }
}

/* ---- Mobile (up to 767px) ---- */
@media (max-width: 767px) {
  :root { --nav-height: 96px; }

  /* Prevent ANY horizontal page overflow on mobile */
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Navbar */
  .navbar {
    width: 100% !important;
    max-width: 100vw !important;
  }
  .nav-container {
    padding: 8px 12px !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  .nav-left {
    gap: 8px !important;
    max-width: 75% !important;
    overflow: hidden;
  }
  .brand-title { font-size: 16px !important; }
  .brand-badge { display: none !important; }
  .nav-search { display: none !important; }
  .nav-label { display: none !important; }

  .category-selector-btn {
    font-size: 11px !important;
    padding: 4px 8px !important;
    max-width: 110px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Mode Switcher Bar on mobile */
  .nav-mode-bar {
    padding: 6px 10px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  .main-mode-switcher {
    width: 100% !important;
    gap: 6px !important;
  }
  .mode-tab-btn {
    font-size: 11px !important;
    padding: 5px 11px !important;
  }

  /* Main content */
  .main-container {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 10px 10px 80px !important;
    box-sizing: border-box !important;
  }

  /* Hero */
  .hero-section, .movie-hero-section {
    height: 240px !important;
    border-radius: 12px !important;
    width: 100% !important;
  }
  .hero-content { left: 12px !important; bottom: 14px !important; right: 12px !important; }
  .hero-title { font-size: 16px !important; line-height: 1.3 !important; }
  .hero-synopsis { display: none !important; }
  .hero-actions { gap: 6px !important; }
  .btn-primary, .btn-secondary { padding: 8px 14px !important; font-size: 11px !important; }

  /* Cards grid: 3 columns on medium/large mobile screens */
  .cards-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .drama-card { flex: 0 0 calc(33.333% - 7px); }
  .cards-scroll-row .drama-card { flex: 0 0 125px; width: 125px; }
  .card-title { font-size: 11px !important; line-height: 1.3 !important; }
  .card-info { padding: 8px 6px 8px !important; }
  .card-meta, .card-sub-info { font-size: 10px !important; }

  /* Section headers */
  .section-title { font-size: 16px; }
  .section-container { margin-bottom: 28px; }

  /* Detail modal */
  .detail-header-flex { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .detail-title-group { align-items: center; }
  .detail-action-buttons, .detail-tags-row { justify-content: center; }
  .detail-title { font-size: 18px; }
  .detail-poster-img, .detail-poster { width: 110px; height: 154px; }

  /* Player */
  .player-wrapper { max-width: 100% !important; }
  .player-top-bar { padding: 8px 12px; }
  .player-bottom-bar { padding: 8px 12px 12px; }
  .player-side-actions { right: 8px; gap: 12px; }
  .side-action-btn { width: 38px; height: 38px; font-size: 13px; }
  .side-action-btn span { font-size: 9px; }

  /* Mode switcher on mobile */
  .main-mode-switcher { order: 3; width: 100%; justify-content: center; margin-top: 4px; }
  .mode-tab-btn { font-size: 11px; padding: 5px 10px; }

  /* Category tabs */
  .cat-tabs-scroll { padding: 6px 12px; gap: 6px; }
  .cat-tab-pill { font-size: 11px; padding: 5px 10px; }

  /* Search page */
  .search-view-container { padding-top: 6px; }
  .search-input-box input { font-size: 14px; padding: 12px 40px 12px 44px; }
  .page-title { font-size: 20px; }

  /* Rongyok filter bar */
  .rongyok-filter-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .rongyok-filter-tabs { flex-wrap: wrap; }
  .rongyok-filter-btn { font-size: 11px; padding: 6px 12px; }

  /* Episodes grid in detail */
  .episodes-grid { grid-template-columns: repeat(5, 1fr) !important; gap: 6px !important; }
  .ep-btn { font-size: 11px !important; padding: 7px 2px !important; }

  /* Login/admin panels & Downloader header on mobile */
  .auth-card { padding: 24px 16px; }
  .admin-panel { padding: 12px 10px; }
  .admin-card-panel {
    padding: 14px 12px !important;
    border-radius: 14px !important;
  }
  .panel-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    margin-bottom: 14px !important;
  }
  .panel-title-wrap {
    gap: 6px !important;
  }
  .panel-title-wrap h3 {
    font-size: 14px !important;
    line-height: 1.35 !important;
    word-break: break-word;
  }
  .panel-sub-tag {
    font-size: 10px !important;
    align-self: flex-start;
  }
  .form-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .form-group[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }

  /* Category selector dropdown */
  .category-selector-btn { font-size: 12px; padding: 5px 10px; }
  .cat-icon-wrap { display: none; }

  /* Movie page */
  .movie-platforms-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 10px !important; }
  .platform-card { padding: 12px 8px !important; }
  .platform-name { font-size: 11px !important; }

  /* Shimmer cards */
  .shimmer-card { height: 200px; }
}

/* ---- Mobile Small (< 480px) ---- */
@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .cards-scroll-row .drama-card { flex: 0 0 135px; width: 135px; }
  .card-info { padding: 8px 8px 10px !important; }
  .card-title { font-size: 12px !important; line-height: 1.35 !important; }
  .card-meta, .card-sub-info { font-size: 11px !important; }
  .hero-section, .movie-hero-section { height: 220px; }
  .hero-title { font-size: 15px; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 6px; }
  .btn-primary, .btn-secondary { padding: 8px 14px; font-size: 11px; }
  .detail-poster-img, .detail-poster { width: 90px; height: 126px; }
  .episodes-grid { grid-template-columns: repeat(4, 1fr) !important; }
  .nav-container { padding: 8px 10px; }
  .brand-text .brand-title { font-size: 16px; }
  .main-container { padding: 10px 10px 80px; }
}

/* ---- Player loader error state ---- */
.player-loader .spinner-circle[style*="display: none"] ~ .player-loading-title {
  color: #ff6b6b;
  font-size: 16px;
}

/* ---- Fix bottom nav on mobile ---- */
@media (max-width: 767px) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }
}

/* ---- Touch device optimizations ---- */
@media (hover: none) {
  .drama-card:hover { transform: none; box-shadow: none; }
  .drama-card:active { transform: scale(0.97); opacity: 0.9; }
  .card-play-hover { display: none; }
  .btn-primary:hover { transform: none; }
  .btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }
}

/* ---- Landscape mobile ---- */
@media (max-width: 767px) and (orientation: landscape) {
  .player-wrapper { max-width: 100% !important; max-height: 100dvh; }
  .hero-section, .movie-hero-section { height: 200px; }
}

