/* ═══════════════════════════════════════════════════
   MO CINEMA — A Cinematic Streaming Experience
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a28;
  --surface3: #222236;
  --text: #e8e8f0;
  --text-dim: #8888a8;
  --accent: #a78bfa;
  --accent2: #7c3aed;
  --accent-glow: rgba(167, 139, 250, 0.3);
  --gold: #fbbf24;
  --success: #34d399;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --glass: rgba(18, 18, 26, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--surface3) transparent;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

/* Ambient Background */
#ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(167, 139, 250, 0.05), transparent);
  transition: background 1s ease;
}

/* ─── NAVIGATION ─── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s var(--transition);
}

#navbar.scrolled {
  background: rgba(10, 10, 15, 0.95);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border-radius: 12px;
  padding: 4px;
  position: relative;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

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

.genre-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  z-index: 200;
}

.genre-dropdown.hidden { display: none; }

.genre-chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.genre-chip:hover, .genre-chip.active {
  background: var(--accent2);
  color: var(--text);
  border-color: var(--accent);
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 14px;
  min-width: 240px;
  transition: all 0.3s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  min-width: 300px;
}

.search-icon { color: var(--text-dim); flex-shrink: 0; }

#searchInput {
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  width: 100%;
  outline: none;
  font-family: inherit;
}

#searchInput::placeholder { color: var(--text-dim); }

.search-kbd {
  background: var(--surface2);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: inherit;
}

/* ─── HERO ─── */
#hero {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 500px;
  overflow: hidden;
  margin-bottom: 0;
}

#hero.hidden { display: none; }

#hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  transition: opacity 0.8s ease, background-image 0.8s ease;
  transform: scale(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(10,10,15,0.6) 40%, rgba(10,10,15,0.3) 100%),
    linear-gradient(to right, rgba(10,10,15,0.8) 0%, transparent 60%);
}

.hero-content {
  position: absolute;
  bottom: 80px;
  left: 48px;
  right: 40%;
  z-index: 2;
  animation: fadeSlideUp 0.8s ease;
}

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

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

.hero-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-weight: 600;
  font-size: 14px;
}

.hero-rating::before {
  content: '★';
  font-size: 16px;
}

.hero-year {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}

.hero-genres {
  color: var(--text-dim);
  font-size: 13px;
}

#hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

#hero-overview {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.btn-secondary:hover {
  background: var(--surface2);
  border-color: var(--accent);
}

.hero-qualities {
  display: flex;
  gap: 8px;
}

.quality-tag {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quality-tag.q-4K {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
}

.quality-tag.q-1080p {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.quality-tag.q-SD\/HD {
  background: var(--surface3);
  color: var(--text-dim);
}

.quality-tag.q-3D {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.hero-nav {
  position: absolute;
  bottom: 24px;
  right: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.hero-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.hero-nav-btn:hover { background: var(--accent2); }

#hero-dots {
  display: flex;
  gap: 6px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface3);
  cursor: pointer;
  transition: all 0.3s;
}

.hero-dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

/* ─── MOVIE GRID ─── */
#movie-section {
  position: relative;
  z-index: 1;
  padding: 40px 32px 60px;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.movie-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s var(--transition);
  background: var(--surface);
  aspect-ratio: 2/3;
  group: true;
}

.movie-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 30px var(--accent-glow);
  z-index: 10;
}

.movie-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--transition);
}

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

.movie-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}

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

.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: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.card-rating {
  color: var(--gold);
  font-weight: 600;
}

.card-rating::before { content: '★ '; }

.card-qualities {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s;
}

.movie-card:hover .card-qualities {
  opacity: 1;
  transform: translateX(0);
}

.card-quality {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
}

.card-quality.q-4K {
  background: rgba(245, 158, 11, 0.9);
  color: #000;
}

.card-quality.q-1080p {
  background: rgba(124, 58, 237, 0.9);
  color: #fff;
}

.card-quality.q-SD\/HD {
  background: rgba(50, 50, 70, 0.9);
  color: var(--text-dim);
}

.card-quality.q-3D {
  background: linear-gradient(135deg, rgba(16,185,129,0.9), rgba(5,150,105,0.9));
  color: #fff;
}

.card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 56px;
  height: 56px;
  background: var(--accent2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.movie-card:hover .card-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.no-poster {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface), var(--surface2));
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  gap: 16px;
  color: var(--text-dim);
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.load-more {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

.load-more.hidden { display: none; }

/* ─── DETAIL MODAL ─── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  animation: modalIn 0.4s var(--transition);
  border: 1px solid var(--glass-border);
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--danger); }

.detail-backdrop {
  width: 100%;
  height: 300px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.detail-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--surface), transparent);
}

.detail-body {
  display: flex;
  gap: 28px;
  padding: 0 32px 32px;
  margin-top: -80px;
  position: relative;
}

.detail-poster-wrap {
  flex-shrink: 0;
  width: 200px;
}

.detail-poster {
  width: 200px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

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

.detail-info h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.detail-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.meta-badge {
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--surface2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

.rating-badge {
  color: var(--gold);
  font-weight: 600;
}

.rating-badge::before { content: '★ '; }

.detail-genres {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.detail-genre {
  padding: 4px 14px;
  border-radius: 20px;
  background: var(--surface3);
  font-size: 12px;
  color: var(--text-dim);
}

.detail-tagline {
  font-style: italic;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 8px;
}

.detail-overview {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.detail-director {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.detail-director strong { color: var(--text); }

/* Sources */
.detail-sources {
  margin-bottom: 20px;
}

.source-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
}

.source-item:hover {
  border-color: var(--accent);
  background: var(--surface3);
}

.source-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.source-quality-badge {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.source-play-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent2);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.source-play-btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

/* Cast */
.detail-cast-section {
  margin-bottom: 20px;
}

.cast-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.cast-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.cast-card {
  flex-shrink: 0;
  width: 80px;
  text-align: center;
}

.cast-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 6px;
  border: 2px solid var(--surface3);
}

.cast-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-char {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── VIDEO PLAYER ─── */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
}

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

.player-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.player-container:hover .player-top-bar,
.player-container.controls-visible .player-top-bar { opacity: 1; }

.player-back {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  transition: color 0.2s;
}

.player-back:hover { color: var(--accent); }

.player-title {
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.player-top-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.player-pip-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.player-pip-btn:hover { opacity: 1; }

#video-player {
  width: 100%;
  height: 100%;
  background: #000;
  cursor: pointer;
}


.ad-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  background: #000;
}
.ad-overlay iframe {
  flex: 1;
  width: 100%;
  border: none;
}
.ad-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0,0,0,0.9);
  font-size: 13px;
  color: #aaa;
  gap: 12px;
  flex-shrink: 0;
}
.ad-skip-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 5px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.ad-skip-btn:hover { background: rgba(255,255,255,0.22); }

.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 0 16px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.player-container:hover .player-controls,
.player-container.controls-visible .player-controls { opacity: 1; }

.progress-bar {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: height 0.15s;
}

.progress-bar:hover { height: 8px; }

.progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  pointer-events: none;
}

.progress-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  pointer-events: none;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s;
  pointer-events: none;
  box-shadow: 0 0 10px var(--accent-glow);
}

.progress-bar:hover .progress-thumb { transform: translate(-50%, -50%) scale(1); }

.progress-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  background: var(--surface);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  transform: translateX(-50%);
}

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

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

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

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

.ctrl-label span {
  font-size: 12px;
  font-weight: 500;
}

.time-display {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}

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

.volume-slider {
  width: 0;
  opacity: 0;
  transition: all 0.3s;
  accent-color: var(--accent);
  cursor: pointer;
}

.volume-wrap:hover .volume-slider {
  width: 80px;
  opacity: 1;
}

.dropdown-wrap { position: relative; }

.ctrl-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 6px;
  min-width: 160px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.ctrl-dropdown.hidden { display: none; }

.ctrl-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  font-family: inherit;
}

.ctrl-dropdown button:hover { background: var(--surface2); color: var(--text); }
.ctrl-dropdown button.active { color: var(--accent); font-weight: 600; }

.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  z-index: 15;
}

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

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  #navbar { padding: 0 16px; }
  .nav-center { display: none; }
  .search-box { min-width: 160px; }
  .search-box:focus-within { min-width: 200px; }

  .hero-content {
    left: 20px;
    right: 20px;
    bottom: 60px;
  }

  #hero-title { font-size: 28px; }

  #movie-section { padding: 20px 16px; }

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

  .detail-body {
    flex-direction: column;
    align-items: center;
    padding: 0 20px 20px;
  }

  .detail-poster-wrap { width: 160px; }
  .detail-poster { width: 160px; }

  .controls-left .time-display { display: none; }
}

/* ─── ANIMATIONS ─── */
.fade-in {
  animation: fadeIn 0.5s ease;
}

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

.movie-card {
  animation: cardIn 0.5s ease both;
}

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

/* ─── ADD STREAM ─── */
.add-stream-wrap {
  margin-bottom: 20px;
}

.add-stream-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  padding: 9px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  width: 100%;
  justify-content: center;
}

.add-stream-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.add-stream-form {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: center;
}

.add-stream-form input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  font-family: monospace;
  transition: border-color 0.2s;
}

.add-stream-form input:focus {
  border-color: var(--accent);
}

.add-stream-form input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

.add-stream-msg {
  font-size: 12px;
  margin-top: 6px;
  min-height: 18px;
}

.remove-stream-btn {
  background: none;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 6px;
  color: var(--danger);
  font-size: 12px;
  padding: 6px 9px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.remove-stream-btn:hover {
  background: rgba(248, 113, 113, 0.15);
}

/* ─── SKELETON ─── */
.skeleton-card { cursor: default; pointer-events: none; animation: none; }
.skeleton-img {
  width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── STATUS BAR ─── */
.status-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  transition: opacity 0.4s;
  min-width: 280px;
  font-size: 13px;
  color: var(--text-dim);
}
.status-track {
  flex: 1;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
  min-width: 80px;
}
.status-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 2px;
  transition: width 1s ease;
}

/* ─── EXTRAS ─── */
.source-filename {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 340px;
}

.cast-img-placeholder {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-dim);
  margin: 0 auto 6px;
}

.trailer-wrap {
  position: relative; padding-bottom: 56.25%;
  border-radius: 12px; overflow: hidden; margin-top: 8px;
}
.trailer-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ─── Recently Added Section ─────────────────────────── */
.recent-section {
  padding: 20px 40px 10px;
  margin-bottom: 10px;
}
.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}
.section-title {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--text);
}
.see-all-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
}
.see-all-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.recent-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 15px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.recent-scroll::-webkit-scrollbar {
  height: 6px;
}
.recent-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.03);
  border-radius: 3px;
}
.recent-scroll::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}
.recent-card {
  flex: 0 0 160px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.25s, box-shadow 0.25s;
}
.recent-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(124, 92, 252, 0.3);
}
.recent-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}
.recent-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 30px 10px 10px;
}
.recent-title {
  font-size: 0.8em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-meta {
  font-size: 0.7em;
  color: var(--text-dim);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.recent-meta .rq {
  font-size: 0.75em;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}
.recent-meta .rq.q-4K { background: #ffd700; color: #000; }
.recent-meta .rq.q-1080p { background: #4fc3f7; color: #000; }
.recent-meta .rq.q-SD\/HD { background: rgba(255,255,255,0.2); }
.recent-ago {
  font-size: 0.7em;
  color: var(--accent);
  margin-top: 3px;
  font-weight: 500;
}
@media (max-width: 768px) {
  .recent-section { padding: 15px 15px 5px; }
  .recent-card { flex: 0 0 130px; }
}
