/* ═══════════════════════════════════════════════════════════════════════════
   FreeFlix v2 — Premium Dark Streaming UI
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #12121a;
  --bg-card:       #16162280;
  --bg-glass:      rgba(20, 20, 35, 0.75);
  --surface:       #1c1c2e;
  --surface-light: #252540;
  --accent:        #e50914;
  --accent-hover:  #ff1a26;
  --accent-glow:   rgba(229, 9, 20, 0.35);
  --accent-2:      #6366f1;
  --accent-2-glow: rgba(99, 102, 241, 0.3);
  --green:         #22c55e;
  --yellow:        #eab308;
  --text-primary:  #f1f1f1;
  --text-secondary:#8a8a9a;
  --text-muted:    #55556a;
  --border:        rgba(255,255,255,0.06);
  --border-light:  rgba(255,255,255,0.1);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --shadow-card:   0 8px 32px rgba(0,0,0,0.45);
  --shadow-glow:   0 0 40px var(--accent-glow);
  --transition:    0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font:          'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --navbar-h:      64px;
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

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

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ─── User Picker ─────────────────────────────────────────────────────────── */
.user-picker-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg-primary);
  display: none; align-items: center; justify-content: center;
}
.user-picker-overlay.active { display: flex; }

.user-picker {
  text-align: center;
  padding: 24px;
  max-width: 700px;
  width: 100%;
}

.user-picker-header { margin-bottom: 48px; }
.user-picker-header .picker-logo {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 32px;
}
.user-picker-header h2 {
  font-size: 1.8rem; font-weight: 400; color: var(--text-secondary);
}

.user-grid {
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: center;
}

.user-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  cursor: pointer; padding: 16px; border-radius: var(--radius-lg);
  transition: transform var(--transition), background var(--transition);
  width: 120px;
}
.user-card:hover { transform: scale(1.1); background: rgba(255,255,255,0.04); }

.user-card-avatar {
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 3px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.user-card:hover .user-card-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.user-card-name {
  font-size: 0.9rem; color: var(--text-secondary);
  transition: color var(--transition);
}
.user-card:hover .user-card-name { color: var(--text-primary); }

.user-card-add .user-card-avatar {
  background: transparent;
  border: 2px dashed var(--text-muted);
  font-size: 2rem; color: var(--text-muted);
}
.user-card-add:hover .user-card-avatar {
  border-color: var(--green);
  color: var(--green);
  box-shadow: none;
}
.user-card-add:hover .user-card.nav-btn span { display: inline; }

@media (max-width: 768px) {
  .user-picker { padding: 16px; }
  .user-picker-header { margin-bottom: 32px; }
  .user-picker-header h2 { font-size: 1.5rem; }
  .user-grid { gap: 16px; }
  .user-card { width: 100px; padding: 12px; }
  .user-card-avatar { width: 70px; height: 70px; font-size: 2rem; }
  .user-card-name { font-size: 0.85rem; }
  .user-card-add .user-card-avatar { font-size: 1.8rem; }

  .nav-btn span { display: none; }
  .navbar { padding: 0 16px; height: 60px; }
  .logo-text { font-size: 1.4rem; }
  .nav-btns { gap: 8px; }
}

.user-card-delete {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(229, 9, 20, 0.9);
  border: none; border-radius: 50%; color: #fff; font-size: 0.7rem;
  cursor: pointer; display: none; align-items: center; justify-content: center;
}
.user-card { position: relative; }
.user-card:hover .user-card-delete { display: flex; }

/* ─── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--navbar-h);
  padding: 0 clamp(16px, 4vw, 48px);
  background: linear-gradient(180deg, rgba(10,10,15,0.95) 0%, transparent 100%);
  transition: background var(--transition);
}
.navbar.scrolled {
  background: rgba(10,10,15,0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

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

.nav-tabs { display: flex; gap: 20px; margin-left: 20px; }
.nav-tab {
  background: none; border: none; color: var(--text-secondary);
  font-family: var(--font); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: color var(--transition), transform var(--transition);
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav-tab:hover { color: var(--text-primary); }
.nav-tab.active {
  color: var(--text-primary); font-weight: 700;
  border-bottom-color: var(--accent);
}
@media (max-width: 768px) {
  .nav-tabs { display: none; }
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-primary); }
.logo-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff4d58 100%);
  border-radius: var(--radius-sm); font-size: 16px; color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.logo:hover .logo-icon { transform: scale(1.1); box-shadow: var(--shadow-glow); }
.logo-text {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, #ccc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Search */
.search-container { 
  display: flex; align-items: center; 
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px;
  width: clamp(250px, 40vw, 500px); 
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-container:focus-within { border-color: var(--accent); box-shadow: 0 0 15px var(--accent-glow); }
.search-icon-fixed { color: var(--text-muted); display: flex; align-items: center; pointer-events: none; }

.search-input {
  flex: 1; opacity: 1; padding: 10px 12px; border: none; background: transparent;
  color: var(--text-primary); font-family: var(--font); font-size: 0.95rem;
  outline: none; width: 100%;
}
.search-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 8px; font-size: 1rem; transition: color var(--transition);
  display: flex; align-items: center;
}
.search-close:hover { color: var(--text-primary); }
.search-container.active .search-toggle { display: none; }

/* Nav buttons */
.nav-btn {
  background: none; border: none; color: var(--text-secondary); cursor: pointer;
  padding: 8px; border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.nav-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
#menu-toggle { display: none; }
@media (max-width: 768px) { #menu-toggle { display: flex; } }
.nav-btn.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.user-avatar-btn {
  background: none; border: 2px solid var(--border-light);
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.user-avatar-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; height: 75vh; min-height: 480px; max-height: 800px;
  display: flex; align-items: flex-end; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1a0a2e 0%, #0a0a1e 50%, #0a1a2e 100%);
  background-size: cover; background-position: center;
  transition: opacity 1s ease;
}
.hero-gradient {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, var(--bg-primary) 0%, transparent 60%),
    linear-gradient(90deg, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0.4) 40%, transparent 80%),
    linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 40%);
}
.hero-content {
  position: relative; z-index: 2;
  padding: 0 clamp(16px, 4vw, 48px); padding-bottom: 80px;
  max-width: 650px;
}
.hero-badges { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.hero-badge {
  display: inline-block; padding: 4px 12px;
  background: var(--accent); color: #fff;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; border-radius: 3px;
}
.hero-badge.genre {
  background: var(--accent-2);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900;
  line-height: 1.1; margin-bottom: 12px;
  text-shadow: 0 4px 30px rgba(0,0,0,0.5);
}
.hero-description {
  font-size: 1.05rem; color: #fff;
  margin-bottom: 12px; line-height: 1.6;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  max-width: 580px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-description:empty { display: none; }
.hero-meta {
  font-size: 0.9rem; color: var(--text-muted);
  margin-bottom: 24px; line-height: 1.5;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-play {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-play:hover {
  background: var(--accent-hover); transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}
.btn-play:active { transform: translateY(0); }

.btn-info {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: rgba(255,255,255,0.1);
  color: var(--text-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 1rem; font-weight: 600; cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background var(--transition), transform var(--transition);
}
.btn-info:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); }

.btn-trailer {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: rgba(255,255,255,0.08);
  color: var(--text-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn-trailer:hover { background: rgba(255,255,255,0.15); transform: translateY(-2px); }

.btn-vlc {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: #FF8800; color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-vlc:hover { background: #FF9911; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255, 136, 0, 0.3); }

/* VLC icon for cards and episodes */
.vlc-mini-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: #FF8800; color: #fff;
  border-radius: 50%; border: none; cursor: pointer;
  transition: transform var(--transition), background var(--transition);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.vlc-mini-btn:hover { background: #FF9911; transform: scale(1.1); }
.vlc-mini-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ─── Content Rows ────────────────────────────────────────────────────────── */
.content { position: relative; z-index: 2; margin-top: 0; padding-top: 0; padding-bottom: 80px; }

.row { margin-bottom: 40px; }
.row-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 48px); margin-bottom: 14px;
}
.row-title { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.row-title .row-icon { margin-right: 8px; }
.row-count { font-size: 0.8rem; color: var(--text-muted); }

.row-scroll {
  display: flex; gap: 12px;
  padding: 20px clamp(16px, 4vw, 48px);
  margin: -20px 0;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  touch-action: pan-y;
  overscroll-behavior-x: contain;
}
.row-scroll::-webkit-scrollbar { display: none; }

/* ─── Video Card ──────────────────────────────────────────────────────────── */
.video-card {
  flex: 0 0 auto; width: clamp(140px, 12vw, 200px);
  scroll-snap-align: start; border-radius: var(--radius-md);
  overflow: hidden; background: var(--bg-card);
  border: 1px solid var(--border); cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.video-card:hover {
  transform: scale(1.08) translateY(-8px);
  box-shadow: var(--shadow-card); border-color: rgba(255,255,255,0.12);
  z-index: 10;
}
.video-card:hover .card-genre {
  transform: scale(0.925);
  transform-origin: top left;
}

.card-thumb {
  position: relative; width: 100%; aspect-ratio: 2 / 3;
  overflow: hidden; background: var(--bg-secondary);
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.video-card:hover .card-thumb img { transform: scale(1.1); }

.card-play-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3); opacity: 0;
  transition: opacity var(--transition);
}
.video-card:hover .card-play-icon { opacity: 1; }
.card-play-icon svg { width: 48px; height: 48px; fill: #fff; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }

.card-duration {
  position: absolute; bottom: 8px; right: 8px;
  padding: 2px 8px; background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px); color: #fff;
  font-size: 0.7rem; font-weight: 600; border-radius: 3px;
}

/* Progress bar on card */
.card-progress {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 6px; background: rgba(255,255,255,0.15);
  overflow: hidden;
}
.card-progress-fill {
  height: 100%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transition: width 0.5s ease;
}

.card-genre {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 8px; background: rgba(99, 102, 241, 0.85);
  backdrop-filter: blur(4px); color: #fff;
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; border-radius: 3px;
}

.card-vlc-btn {
  position: absolute; top: 8px; right: 8px;
  z-index: 5; opacity: 0; transform: scale(0.8);
  transition: opacity var(--transition), transform var(--transition);
}
.video-card:hover .card-vlc-btn { opacity: 1; transform: scale(1); }

.episode-vlc-btn {
  background: #FF8800; color: #fff; 
  padding: 6px 12px; border-radius: 4px;
  font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  text-decoration: none; transition: background 0.2s;
}
.episode-vlc-btn:hover { background: #FF9911; }
.episode-vlc-btn svg { width: 14px; height: 14px; fill: currentColor; }

.card-info { padding: 12px; }
.card-title {
  font-size: 0.875rem; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.card-meta {
  font-size: 0.75rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}

/* ─── Player Overlay ──────────────────────────────────────────────────────── */
.player-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: #000; display: none; flex-direction: column;
}
.player-overlay.active { display: flex; }
.player-overlay:fullscreen { display: flex !important; width: 100vw; height: 100vh; background: #000; z-index: 9999; }
.player-overlay:-webkit-full-screen { display: flex !important; width: 100vw; height: 100vh; background: #000; z-index: 9999; }

.player-overlay:fullscreen .player-header,
.player-overlay:fullscreen .player-controls,
.player-overlay:-webkit-full-screen .player-header,
.player-overlay:-webkit-full-screen .player-controls {
  z-index: 10000;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.video-player {
  width: 100%; height: 100%; object-fit: contain; background: #000;
  touch-action: manipulation;
}

.player-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  padding: 30px 40px;
  background: linear-gradient(rgba(0,0,0,0.8), transparent);
  opacity: 0; transition: opacity 0.4s ease;
}
.player-overlay.show-controls .player-header { opacity: 1; }

.player-close {
  background: rgba(255,255,255,0.1); border: none; color: #fff; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s ease;
}
.player-close:hover { background: rgba(255,255,255,0.2); }
.player-title { font-size: 1.2rem; font-weight: 700; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.video-player {
  width: 100%; height: 100%; object-fit: contain; background: #000;
}

/* Custom Controls */
.player-controls {
  position: absolute; bottom: 0; left: 0; width: 100%;
  background: linear-gradient(transparent, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0.95));
  padding: 20px 40px 40px;
  display: flex; flex-direction: column; gap: 15px;
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0; transform: translateY(20px);
  z-index: 10;
}
.player-overlay.show-controls .player-controls {
  opacity: 1; transform: translateY(0);
}

.controls-top { width: 100%; }
.progress-container {
  width: 100%; height: 20px;
  display: flex; align-items: center;
  cursor: pointer;
  position: relative;
}
.progress-bar-bg {
  width: 100%; height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px; position: relative;
  transition: height 0.2s ease;
}
.progress-container:hover .progress-bar-bg { height: 6px; }

.progress-bar-buffer {
  position: absolute; left: 0; top: 0; height: 100%;
  background: rgba(255,255,255,0.2);
  width: 0%; border-radius: 2px;
}
.progress-bar-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--accent);
  width: 0%; border-radius: 2px;
}
.progress-handle {
  position: absolute; right: -8px; top: 50%;
  transform: translateY(-50%) scale(0);
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}
.progress-container:hover .progress-handle { transform: translateY(-50%) scale(1); }

.controls-bottom {
  display: flex; justify-content: space-between; align-items: center;
}
.controls-left, .controls-right { display: flex; align-items: center; gap: 20px; }

.skip-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
.skip-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}
.skip-btn:active { transform: scale(0.95); }

.ctrl-btn {
  background: none; border: none; color: #fff;
  cursor: pointer; padding: 10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.ctrl-btn svg { width: 32px; height: 32px; }
.ctrl-btn:hover { background: rgba(255,255,255,0.1); }
.ctrl-btn:active { transform: scale(0.9); }
.ctrl-btn svg text { fill: #fff; font-family: var(--font); font-size: 8px; font-weight: 800; }

.time-display {
  font-size: 0.9rem; color: #ccc;
  font-variant-numeric: tabular-nums;
  margin-left: 10px;
}

.volume-container {
  display: flex; align-items: center; gap: 5px;
}
.volume-slider {
  width: 0; opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  accent-color: #fff; cursor: pointer;
}
.volume-container:hover .volume-slider { width: 80px; opacity: 1; }

.player-overlay-status {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  padding: 30px 50px; border-radius: 60px;
  display: none; flex-direction: column; align-items: center; gap: 15px;
  z-index: 20; color: #fff; pointer-events: none;
  backdrop-filter: blur(10px);
}
.player-overlay-status.active { display: flex; }

.autoplay-overlay {
  position: absolute; right: 40px; bottom: 120px; z-index: 50;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
  border-radius: var(--radius-md); padding: 15px;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; gap: 15px; 
  animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.autoplay-thumb {
  width: 140px; aspect-ratio: 16/9; background-size: cover; background-position: center;
  border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.autoplay-info { display: flex; flex-direction: column; justify-content: center; }
.autoplay-label { font-size: 0.85rem; color: #ccc; margin-bottom: 4px; font-weight: 500;}
.autoplay-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 12px; color: #fff;}
.autoplay-actions { display: flex; gap: 10px; }
.autoplay-actions .btn-cancel { 
  background: rgba(255,255,255,0.1); border:none; color:#fff; padding:8px 16px; 
  border-radius:20px; cursor:pointer; font-weight: 600; transition: all 0.2s;
}
.autoplay-actions .btn-cancel:hover { background: rgba(255,255,255,0.25); transform: scale(1.05); }
@keyframes slideInRight { 
  from { transform: translateX(120%); opacity: 0; } 
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Watchlist ──────────────────────────────────────────────────────────── */
.wl-header { 
  margin-bottom: 30px; 
  border-bottom: 1px solid var(--border-light); 
  padding-bottom: 20px; 
}
.wl-title { 
  border-left: 6px solid #f5c518; 
  padding-left: 14px; 
  color: #fff;
}

.wl-search-box {
  display: flex; gap: 12px; margin-bottom: 40px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-light);
  padding: 8px; border-radius: 4px; padding-left: 20px;
  align-items: center;
}
.wl-search-box:focus-within {
  border-color: #f5c518; background: rgba(255,255,255,0.08);
}
.wl-search-icon { font-size: 1.3rem; }
.wl-search-box input {
  flex: 1; background: transparent; border: none; color: #fff;
  font-family: var(--font); font-size: 1.1rem; outline: none;
}
.wl-search-box input::placeholder { color: var(--text-muted); }
.wl-search-box button {
  background: #f5c518; color: #000; border: none; border-radius: 3px;
  padding: 10px 30px; font-weight: 800; font-size: 1rem;
  font-family: var(--font); cursor: pointer; transition: background 0.2s;
}
.wl-search-box button:hover { background: #e3b616; }

#wl-status { 
  display: flex; gap: 10px; align-items: center; margin-bottom: 20px; 
  height: 24px;
}
.wl-loader {
  width: 18px; height: 18px; border: 2px solid #f5c518;
  border-top-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.wl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}
@media (min-width: 1400px) {
  .wl-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

.wl-imdb-card {
  background: #1a1a1a; border-radius: 4px; overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer; position: relative;
  display: flex; flex-direction: column;
}
.wl-imdb-card:hover { transform: scale(1.03); box-shadow: 0 8px 16px rgba(0,0,0,0.8); z-index: 10; }

.wl-imdb-poster {
  position: relative; width: 100%; aspect-ratio: 2/3; background: #111;
}
.wl-imdb-poster img {
  width: 100%; height: 100%; object-fit: cover;
}

.wl-imdb-type {
  position: absolute; bottom: 8px; left: 8px;
  padding: 2px 8px; background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px); color: #fff; border-radius: 3px;
  font-size: 0.70rem; font-weight: 700; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.2);
}

.wl-imdb-ribbon {
  position: absolute; top: 0; left: 0; width: 32px; height: 42px;
  cursor: pointer; transition: filter 0.2s; z-index: 2;
  opacity: 0.95;
}
.wl-imdb-ribbon:hover { filter: brightness(1.2); opacity: 1; }
.wl-ribbon-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wl-ribbon-check {
  position: absolute; top: 8px; left: 0; width: 100%; text-align: center;
  color: #000; font-weight: 900; font-size: 1.1rem;
}

/* Change check to an X on hover to signify remove, only if it's already added */
.wl-imdb-card:hover .wl-imdb-ribbon.is-added .wl-ribbon-check { opacity: 0; }
.wl-imdb-ribbon.is-added::after {
  content: "✕"; position: absolute; top: 8px; left: 0; width: 100%;
  text-align: center; color: #000; font-weight: 900; font-size: 1.1rem;
  opacity: 0; transition: opacity 0.2s;
}
.wl-imdb-card:hover .wl-imdb-ribbon.is-added::after { opacity: 1; }

.wl-imdb-info { padding: 12px 10px; flex: 1; display: flex; flex-direction: column; }
.wl-imdb-rating {
  display: flex; gap: 4px; align-items: center; font-size: 0.85rem;
  color: var(--text-secondary); margin-bottom: 6px;
}
.wl-imdb-title {
  font-size: 0.95rem; font-weight: 600; color: #fff; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 4px;
}
.wl-imdb-year { font-size: 0.85rem; color: #aaa; margin-top: auto; }

.wl-empty {
  grid-column: 1/-1; padding: 80px 20px; text-align: center;
  background: rgba(255,255,255,0.02); border-radius: 4px;
  border: 1px dashed var(--border-light);
}
.wl-empty-icon { font-size: 4rem; opacity: 0.5; margin-bottom: 20px; }

/* --- Watchlist Views & Modal Additions --- */
.wl-view-toggle {
  display: flex; gap: 8px; background: rgba(255,255,255,0.05);
  padding: 4px; border-radius: 8px; border: 1px solid var(--border-light);
}
.wl-toggle-btn {
  background: transparent; border: none; color: var(--text-muted);
  width: 40px; height: 36px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.wl-toggle-btn.active {
  background: rgba(255,255,255,0.1); color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.wl-toggle-btn:hover:not(.active) { color: #fff; background: rgba(255,255,255,0.05); }

/* List View overrides */
.wl-grid.is-list-view { display: flex; flex-direction: column; gap: 16px; }
.wl-grid.is-list-view .wl-imdb-card {
  flex-direction: row; height: 160px;
}
.wl-grid.is-list-view .wl-imdb-poster {
  width: 106px; height: 100%; flex-shrink: 0; aspect-ratio: auto;
}
.wl-grid.is-list-view .wl-imdb-info {
  flex-direction: column; align-items: flex-start; justify-content: flex-start;
  padding: 16px 20px;
}
.wl-grid.is-list-view .wl-imdb-title { font-size: 1.2rem; margin-bottom: 8px; -webkit-line-clamp: 1; line-clamp: 1; }
.wl-grid.is-list-view .wl-imdb-year { margin-top: 0; margin-bottom: 8px; }
.wl-grid.is-list-view .wl-imdb-desc { display: -webkit-box; }

.wl-imdb-desc {
  display: none; font-size: 0.9rem; color: #888;
  -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Modal Seasons */
.wl-details-content { max-width: 800px; }
.wl-seasons-container { margin-top: 30px; border-top: 1px solid var(--border-light); padding-top: 20px; }
.wl-season-select {
  background: rgba(255,255,255,0.05); color: #fff; border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 6px; font-size: 1rem; width: 100%; max-width: 200px;
  margin-bottom: 16px; outline: none; cursor: pointer;
}
.wl-season-select option { background: var(--bg-primary); color: #fff; }
.wl-episodes-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 250px; overflow-y: auto; padding-right: 10px;
}
.wl-episode-item {
  display: flex; gap: 16px; padding: 12px;
  background: rgba(255,255,255,0.02); border-radius: 6px;
  border: 1px solid transparent; transition: border-color 0.2s;
}
.wl-episode-item:hover { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); }
.wl-ep-num { font-weight: 700; color: #f5c518; min-width: 30px; }
.wl-ep-title { color: #ddd; }

@media (max-width: 600px) {
  .autoplay-overlay { right: 10px; bottom: 140px; left: 10px; flex-direction: column; }
  .autoplay-thumb { display: none; }
}

.status-spinner {
  width: 44px; height: 44px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-text { font-weight: 600; font-size: 1.1rem; letter-spacing: 0.5px; }

/* ─── Detail Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }

.modal-content {
  width: 100%; max-width: 700px;
  background: var(--bg-secondary); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: modalIn 0.35s ease;
  max-height: 90vh; overflow-y: auto;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
  border: none; color: #fff; width: 36px; height: 36px;
  border-radius: 50%; font-size: 1rem; cursor: pointer; z-index: 2;
  transition: background var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.2); }

.modal-poster {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: var(--surface); background-size: cover; background-position: center;
}
.modal-poster::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 60%; background: linear-gradient(transparent, var(--bg-secondary));
}

.modal-body { padding: 24px 28px 28px; position: relative; }
.modal-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }

.modal-tags {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.modal-tag {
  display: inline-block; padding: 3px 10px;
  background: var(--surface-light); color: var(--text-secondary);
  font-size: 0.75rem; font-weight: 600; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.modal-tag.genre { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.modal-tag.year { background: rgba(234, 179, 8, 0.15); color: #fbbf24; }

.modal-description {
  font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6;
  margin-bottom: 16px;
}
.modal-description:empty { display: none; }

.modal-meta {
  display: flex; gap: 16px; color: var(--text-muted);
  font-size: 0.85rem; margin-bottom: 20px; flex-wrap: wrap;
}
.modal-meta span { display: flex; align-items: center; gap: 4px; }

.modal-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ─── Series Detail Overlay ────────────────────────────────────────────────── */
.series-overlay {
  position: fixed; inset: 0; z-index: 160;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
  display: none; align-items: center; justify-content: center;
  padding: 0;
}
.series-overlay.active { display: flex; }

.series-content {
  width: 100%; max-width: 1000px; height: 95vh;
  background: var(--bg-primary); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  display: flex; flex-direction: column;
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.series-close {
  position: absolute; top: 20px; right: 20px;
  background: rgba(0,0,0,0.5); border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem;
  cursor: pointer; z-index: 10; transition: background var(--transition);
}
.series-close:hover { background: rgba(255,255,255,0.2); }

.series-header {
  position: relative; height: 40vh; min-height: 300px;
  display: flex; align-items: flex-end; padding: 40px;
  overflow: hidden; flex-shrink: 0;
}
.series-header-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transition: opacity 0.5s ease;
}
.series-header-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--bg-primary) 0%, transparent 60%, rgba(0,0,0,0.6) 100%);
}
.series-header-info { position: relative; z-index: 2; max-width: 700px; }
.series-header-info h2 { font-size: 2.5rem; font-weight: 900; margin-bottom: 12px; }
.series-header-info p { color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }

.series-body { flex: 1; overflow-y: auto; padding: 0 40px 40px; }

.series-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-top: 20px;
  position: sticky; top: 0; background: var(--bg-primary); z-index: 5;
}
.season-selector {
  background: var(--surface); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 16px; font-family: var(--font); font-size: 1rem;
  font-weight: 600; outline: none; cursor: pointer;
}
.season-selector:hover { border-color: var(--border-light); }
.episode-count { color: var(--text-muted); font-size: 0.9rem; }

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

.episode-item {
  display: flex; align-items: center; gap: 20px;
  padding: 16px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid transparent;
  cursor: pointer; transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.episode-item:hover {
  background: var(--surface); border-color: var(--border-light);
  transform: translateX(8px);
}
.episode-item.active { background: rgba(229,9,20,0.1); border-left: 2px solid var(--accent); }
.episode-item.watched { opacity: 0.6; }
.episode-item.watched:hover { opacity: 0.85; }
.episode-num { font-size: 1.5rem; font-weight: 800; color: var(--text-muted); width: 30px; text-align: center; }
.episode-thumb {
  width: 160px; aspect-ratio: 16/9; border-radius: var(--radius-sm);
  overflow: hidden; position: relative; flex-shrink: 0;
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.3); opacity: 0; transition: opacity var(--transition);
}
.episode-item:hover .episode-play { opacity: 1; }
.episode-play svg { width: 40px; height: 40px; fill: #fff; }

.episode-info { flex: 1; }
.episode-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.episode-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.episode-progress {
  height: 6px; background: rgba(255,255,255,0.1);
  margin-top: 10px; border-radius: 3px; overflow: hidden;
  display: none;
}
.episode-progress-fill { 
  height: 100%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

@media (max-width: 600px) {
  .series-header { height: auto; min-height: auto; padding: 20px 15px 15px; }
  .series-header-info h2 { font-size: 1.5rem; margin-bottom: 5px; }
  .series-header-info p { 
    font-size: 0.8rem; 
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; 
    -webkit-box-orient: vertical; overflow: hidden; 
  }
  .series-body { padding: 0 15px 15px; }
  .episode-item { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; }
  .episode-thumb { width: 100%; aspect-ratio: 16/9; }
  .episode-num { display: none; }
  .episode-title { font-size: 0.95rem; }
  .episode-desc { font-size: 0.8rem; -webkit-line-clamp: 2; line-clamp: 2; }

  /* Player Controls Mobile Compression */
  .controls-left, .controls-right { gap: 8px; }
  .ctrl-btn { padding: 8px; }
  .ctrl-btn svg { width: 22px; height: 22px; }
  .time-display { font-size: 0.75rem; margin-left: 5px; }
  .volume-container { display: none; } /* Hide volume slider on mobile portrait to save space */
  .player-header { padding: 15px 20px; }
  .player-controls { padding: 10px 15px 20px; }
}
.settings-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: none;
}
.settings-overlay.active { display: block; }

.settings-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 90vw);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  animation: slideIn 0.35s ease;
  overflow-y: auto;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.settings-header h2 { font-size: 1.3rem; font-weight: 700; }
.settings-close {
  background: none; border: none; color: var(--text-secondary);
  font-size: 1.2rem; cursor: pointer; padding: 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  position: absolute; top: 12px; right: 12px;
}
.settings-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

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

.settings-section {
  margin-bottom: 28px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child { border-bottom: none; }
.settings-section h3 {
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 16px;
}

.setting-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
}
.setting-item label {
  font-size: 0.9rem; color: var(--text-secondary);
}
.setting-value {
  font-size: 0.85rem; color: var(--text-primary); font-weight: 500;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: right;
}

.setting-actions { display: flex; flex-direction: column; gap: 10px; }

.btn-setting {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; width: 100%;
  background: var(--surface); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-setting:hover { background: var(--surface-light); border-color: var(--border-light); }
.btn-setting.loading { opacity: 0.6; pointer-events: none; }

/* Settings user list */
.settings-user-list { margin-bottom: 16px; }

.settings-user-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.settings-user-item:last-child { border-bottom: none; }

.settings-user-avatar {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border-radius: var(--radius-sm); font-size: 1.1rem;
}
.settings-user-name { flex: 1; font-size: 0.9rem; }
.settings-user-delete {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 6px; border-radius: var(--radius-sm); font-size: 0.8rem;
  transition: color var(--transition), background var(--transition);
}
.settings-user-delete:hover { color: var(--accent); background: rgba(229,9,20,0.1); }

.add-user-form { margin-top: 8px; }

.add-user-form input {
  width: 100%; padding: 10px 14px;
  background: var(--surface); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; outline: none;
  transition: border-color var(--transition);
  margin-bottom: 10px;
}
.add-user-form input:focus { border-color: var(--accent); }
.add-user-form input::placeholder { color: var(--text-muted); }

.avatar-picker {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
}
.avatar-option {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid transparent;
  border-radius: var(--radius-sm); font-size: 1.1rem; cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}
.avatar-option:hover { transform: scale(1.15); }
.avatar-option.selected { border-color: var(--accent); }

/* ─── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  padding: 14px 20px;
  background: var(--surface); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  display: flex; align-items: center; gap: 12px;
  animation: toast-in 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  pointer-events: auto;
  font-size: 0.85rem; font-weight: 500;
}
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 400;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast.success { border-left: 3px solid #10b981; }
.toast.error { border-left: 3px solid var(--accent); }
.toast.info { border-left: 3px solid var(--accent-2); }

/* User Add Modal (Custom) */
.user-add-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
}
.user-add-overlay.active { display: flex; }
.user-add-modal {
  background: var(--surface-dark);
  padding: 40px; border-radius: var(--radius-lg);
  width: 100%; max-width: 400px;
  text-align: center; border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: slideInUp 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.user-add-modal h2 { margin-bottom: 24px; font-size: 1.8rem; }
.user-add-modal input {
  width: 100%; padding: 14px 18px; font-size: 1.1rem;
  background: var(--surface); color: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-bottom: 32px; outline: none;
  text-align: center;
}
.user-add-modal input:focus { border-color: var(--accent); }
.user-add-modal .modal-actions { display: flex; gap: 12px; justify-content: center; }

/* Confirmation Modal (Custom) */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
}
.confirm-overlay.active { display: flex; }
.confirm-modal {
  background: var(--surface-dark);
  padding: 54px 48px; border-radius: 20px;
  width: 100%; max-width: 420px;
  text-align: center; border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 50px 100px rgba(0,0,0,0.9);
  animation: confirm-pop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  backdrop-filter: blur(10px);
}
.confirm-icon {
  width: 64px; height: 64px; background: rgba(229,9,20,0.1);
  color: var(--accent); border-radius: 50%;
  margin: 0 auto 24px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(229,9,20,0.3);
}
.confirm-modal h3 { 
  margin-bottom: 32px; font-size: 1.6rem; font-weight: 700; 
  line-height: 1.3; color: #fff; 
}
.confirm-modal .modal-actions { display: flex; gap: 16px; justify-content: center; }

.btn-cancel {
  background: rgba(255,255,255,0.06); color: var(--text-primary);
  padding: 14px 32px; border-radius: var(--radius-md);
  font-weight: 600; border: 1px solid var(--border); cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel:hover { background: rgba(255,255,255,0.12); border-color: var(--text-muted); transform: translateY(-1px); }
.btn-cancel:active { transform: translateY(0); }

.btn-danger {
  background: var(--accent); color: #fff;
  padding: 14px 28px; border-radius: var(--radius-md);
  font-weight: 700; border: none; cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(229,9,20,0.3);
}
.btn-danger:hover { background: #b9090b; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(229,9,20,0.4); }
.btn-danger:active { transform: translateY(0); }

@keyframes confirm-pop {
  0% { opacity: 0; transform: scale(0.9) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

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

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* ─── Empty State ─────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 120px 24px 80px; }
.empty-icon { font-size: 4rem; margin-bottom: 20px; opacity: 0.5; }
.empty-state h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p {
  color: var(--text-secondary); margin-bottom: 28px;
  max-width: 400px; margin-left: auto; margin-right: auto;
}

/* ─── Loading Screen ──────────────────────────────────────────────────────── */
.loading-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg-primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 32px; transition: opacity 0.5s ease;
}
.loading-screen.hidden { opacity: 0; pointer-events: none; }

.loading-logo { display: flex; align-items: center; gap: 14px; }
.loading-logo .logo-icon { width: 56px; height: 56px; font-size: 22px; }
.loading-logo .logo-text { font-size: 2.5rem; }

.logo-icon.pulse { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.92); }
}

.loading-bar { width: 200px; height: 3px; background: var(--surface); border-radius: 2px; overflow: hidden; }
.loading-bar-fill {
  width: 40%; height: 100%; background: var(--accent);
  border-radius: 2px; animation: loadSlide 1.2s ease-in-out infinite;
}
@keyframes loadSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ─── Search Results ──────────────────────────────────────────────────────── */
.search-results { display: none; }
.search-results.active {
  display: block; padding: 100px clamp(16px, 4vw, 48px) 80px;
}
.search-results-title {
  font-size: 1.3rem; font-weight: 700; margin-bottom: 24px;
  color: var(--text-secondary);
}
.search-results-title span { color: var(--text-primary); }
.search-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.search-grid .video-card { width: 100%; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-content { padding-left: 5%; }
  .video-card { width: 150px; }
  .modal-content { max-width: 90%; }
}

@media (max-width: 768px) {
  .hero { height: auto; min-height: 480px; padding-top: 80px; padding-bottom: 80px; }
  .content { padding-top: 0; }
  .hero-content { padding-bottom: 40px; }
  .hero-title { font-size: 2rem; }
  .hero-description { 
    font-size: 0.9rem; 
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero-meta { font-size: 0.8rem; flex-wrap: wrap; }
  .hero-actions { gap: 10px; width: 100%; }
  .btn-play, .btn-info { flex: 1; justify-content: center; padding: 12px; }
  
  .row { padding: 0 16px; margin-bottom: 30px; }
  .video-card { width: clamp(120px, 42vw, 160px); }
  .search-container.active .search-input { width: calc(100vw - 120px); }
  .logo-text { display: none; } /* Show only icon on small phones to make room */
  .logo-icon { width: 32px; height: 32px; }
  
  .modal-overlay { z-index: 1000; }
  .modal-content { width: 100%; height: 100%; max-width: 100%; max-height: 100%; border-radius: 0; }
  .modal-poster { height: 250px; }
  .modal-body { padding: 24px; }
  
  .confirm-modal, .user-add-modal { width: 95%; padding: 40px 24px; }
  
  /* Player Touch */
  .player-controls { padding: 15px 15px 30px; }
  .ctrl-btn svg { width: 28px; height: 28px; }
  .controls-left, .controls-right { gap: 10px; }
  .volume-cont { display: none; } /* Use system volume on mobile */
  
  /* Episode List */
  .episode-item { padding: 12px; transform: none !important; }
  .episode-img { width: 100px; height: 56px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .hero-description { display: none; }
  .hero-meta { gap: 8px; }
  .row-title { font-size: 1rem; }
  .series-header-info { padding: 100px 16px 20px; }
  .series-title { font-size: 1.8rem; }

  /* Player — phone-optimized touch targets */
  .player-controls { padding: 10px 12px 24px; gap: 10px; }
  .ctrl-btn { padding: 12px; min-width: 44px; min-height: 44px; }
  .ctrl-btn svg { width: 24px; height: 24px; }
  .player-header { padding: 16px 12px; }
  .player-close { width: 44px; height: 44px; }
  .player-title { font-size: 0.95rem; }
  .progress-container { height: 32px; } /* bigger hit area */
  .progress-bar-bg { height: 5px; }
  .time-display { font-size: 0.75rem; margin-left: 6px; }
}

/* ─── iPad / Tablet ──────────────────────────────────────────────────────── */
@media (min-width: 481px) and (max-width: 1024px) {
  .video-card { width: clamp(130px, 28vw, 170px); }
  .row-scroll { gap: 14px; }
  .modal-content { max-width: 85%; }
  
  /* Player controls: bigger for finger targets on iPad */
  .ctrl-btn { padding: 14px; min-width: 48px; min-height: 48px; }
  .ctrl-btn svg { width: 30px; height: 30px; }
  .progress-container { height: 28px; }
}

/* ─── Touch devices ──────────────────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Always show controls slightly since no hover on touch */
  /* Default hide for tap toggle */
  .player-overlay.active .player-controls { opacity: 0; transform: translateY(10px); pointer-events: none; }
  .player-overlay.active .player-header { opacity: 0; transform: translateY(-10px); pointer-events: none; }
  
  .player-overlay.active.show-controls .player-controls,
  .player-overlay.active.show-controls .player-header { 
    opacity: 1; transform: translateY(0); pointer-events: auto;
  }
  
  /* Disable hover scale on cards for touch — rely on tap */
  .video-card:hover { transform: none; box-shadow: none; }
  .video-card:active { transform: scale(0.97); }
  .video-card:hover .card-genre { transform: none; }
  
  /* Disable volume slider (use hardware volume) */
  .volume-container { display: none; }
  
  /* bigger progress bar */
  .progress-bar-bg { height: 5px; }
  .progress-handle { width: 20px; height: 20px; transform: translateY(-50%) scale(1); }
}

/* ─── Safe-area for notched devices ──────────────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .player-controls {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .navbar {
    padding-top: env(safe-area-inset-top);
  }
}

/* ─── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.row { animation: fadeInUp 0.5s ease forwards; }
.row:nth-child(2) { animation-delay: 0.1s; }
.row:nth-child(3) { animation-delay: 0.2s; }
.row:nth-child(4) { animation-delay: 0.3s; }
.row:nth-child(5) { animation-delay: 0.4s; }
/* ─── Downloads Page ─────────────────────────────────────────────────────── */
.downloads-page-container {
  animation: fadeIn 0.5s ease-out;
}

.ctrl-btn {
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.9rem;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  transform: translateY(-1px);
}

.btn-ctrl-cancel:hover {
  background: rgba(229, 9, 20, 0.2) !important;
  border-color: var(--accent) !important;
}

#btn-page-download:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--accent-glow);
}

#page-magnet-input:focus {
  border-color: var(--accent) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Watchlist Controls */
.wl-controls {
  display: flex; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; align-items: center;
}
.wl-filter-group, .wl-sort-group {
  display: flex; gap: 8px; background: rgba(255,255,255,0.05);
  padding: 6px; border-radius: 8px; border: 1px solid var(--border-light);
}
.wl-control-btn {
  background: transparent; border: none; color: var(--text-secondary);
  padding: 6px 14px; border-radius: 6px; cursor: pointer;
  font-family: var(--font); font-size: 0.85rem; font-weight: 600;
  transition: all 0.2s;
}
.wl-control-btn.active {
  background: rgba(255,255,255,0.1); color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.wl-control-btn:hover:not(.active) { color: #fff; background: rgba(255,255,255,0.05); }

/* ─── Explore Page ───────────────────────────────────────────────────────── */

/* Hero Banner */
.explore-hero {
  position: relative;
  width: 100%;
  min-height: 520px;
  margin-top: calc(-1 * var(--navbar-h));
  overflow: hidden;
  background: #0a0a0f;
  display: flex;
  align-items: flex-end;
}
.explore-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  transition: opacity 0.8s ease;
  transform: scale(1.05);
}
.explore-hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to right,
    rgba(10,10,15,0.98) 0%,
    rgba(10,10,15,0.80) 35%,
    rgba(10,10,15,0.3) 65%,
    rgba(10,10,15,0.05) 100%
  ), linear-gradient(to top, rgba(10,10,15,1) 0%, transparent 60%);
}
.explore-hero-content {
  position: relative; z-index: 2;
  padding: calc(var(--navbar-h) + 60px) 60px 60px;
  max-width: 700px;
  animation: heroFadeIn 0.8s ease both;
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.explore-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(245,197,24,0.15); color: #f5c518;
  border: 1px solid rgba(245,197,24,0.4);
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 18px;
}
.explore-hero-title {
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 900; line-height: 1.1;
  letter-spacing: -1.5px; margin-bottom: 14px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.explore-hero-meta {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.explore-hero-rating {
  display: flex; align-items: center; gap: 5px;
  background: rgba(245,197,24,0.15); color: #f5c518;
  padding: 4px 10px; border-radius: 6px;
  font-weight: 800; font-size: 0.95rem;
}
.explore-hero-year { color: var(--text-muted); font-size: 0.9rem; }
.explore-hero-type {
  color: #fff; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 3px 10px; border-radius: 4px;
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
}
.explore-hero-genres {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px;
}
.explore-genre-pill {
  padding: 4px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary); font-size: 0.8rem; font-weight: 500;
  transition: all 0.2s;
}
.explore-genre-pill:hover { background: rgba(255,255,255,0.12); color: #fff; }
.explore-hero-desc {
  font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7;
  margin-bottom: 28px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.explore-hero-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.explore-hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 8px;
  font-weight: 700; font-size: 0.95rem;
  cursor: pointer; border: none; transition: all 0.25s;
  white-space: nowrap;
}
.explore-hero-btn.primary {
  background: #f5c518; color: #000;
}
.explore-hero-btn.primary:hover { background: #ffd700; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(245,197,24,0.4); }
.explore-hero-btn.secondary {
  background: rgba(255,255,255,0.1); color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.explore-hero-btn.secondary:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); }

/* Hero Dots */
.explore-hero-dots {
  position: absolute; bottom: 24px; right: 60px;
  display: flex; gap: 8px; z-index: 3;
}
.explore-hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.3); cursor: pointer;
  transition: all 0.3s; border: none;
}
.explore-hero-dot.active { background: #f5c518; width: 24px; border-radius: 4px; }

/* Category Tabs */
.explore-tabs-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 20px 60px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  overflow-x: auto; scrollbar-width: none;
}
.explore-tabs-bar::-webkit-scrollbar { display: none; }
.explore-tab {
  padding: 10px 20px 12px; border: none; background: transparent;
  color: var(--text-muted); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; white-space: nowrap; position: relative;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.explore-tab:hover { color: #fff; }
.explore-tab.active { color: #f5c518; border-bottom-color: #f5c518; }

/* Rows Container */
.explore-rows {
  padding: 36px 60px 80px;
}
.explore-section { margin-bottom: 52px; }

/* Section Header */
.explore-section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.explore-section-left { display: flex; align-items: center; gap: 14px; }
.explore-section-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.explore-section-title {
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.3px;
  color: #fff; margin: 0;
}
.explore-section-subtitle {
  font-size: 0.8rem; color: var(--text-muted); margin-top: 2px;
}
.explore-see-all {
  display: flex; align-items: center; gap: 4px;
  color: #f5c518; font-weight: 600; font-size: 0.85rem;
  background: rgba(245,197,24,0.08); border: 1px solid rgba(245,197,24,0.2);
  padding: 6px 14px; border-radius: 20px; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.explore-see-all:hover { background: rgba(245,197,24,0.18); transform: translateX(2px); }

/* Card skeleton loader */
.explore-skeleton-row {
  display: flex; gap: 16px; overflow: hidden;
}
.explore-skeleton-card {
  flex: 0 0 calc(100% / 7.5); min-width: 160px;
  border-radius: 10px; background: rgba(255,255,255,0.04);
  overflow: hidden;
}
.explore-skeleton-poster {
  width: 100%; aspect-ratio: 2/3;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.explore-skeleton-info { padding: 10px 8px; }
.explore-skeleton-line {
  height: 10px; border-radius: 4px; margin-bottom: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.explore-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

/* Season Torrent Button */
.wl-season-actions {
  display: flex; gap: 12px; margin-bottom: 20px; align-items: center;
}
.btn-season-torrent {
  background: rgba(245, 197, 24, 0.1); color: #f5c518;
  border: 1px solid rgba(245, 197, 24, 0.3);
  padding: 10px 20px; border-radius: 8px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: all 0.2s;
}
.btn-season-torrent:hover {
  background: rgba(245, 197, 24, 0.2); border-color: #f5c518;
}

/* Spinner fix */
.status-spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Adjustments for existing elements */
.wl-season-select { margin-bottom: 0 !important; flex: 1; min-width: 150px; }

/* Search Results Sections */
.search-results-section { margin-bottom: 48px; }
.search-section-title {
  font-size: 1.4rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
}
.search-section-title span { color: var(--accent); font-size: 1.1rem; }

.result-tag {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,0.7); color: #fff;
  padding: 4px 10px; border-radius: 4px; font-size: 0.7rem;
  font-weight: 700; backdrop-filter: blur(4px);
  z-index: 2; border: 1px solid rgba(255,255,255,0.1);
}
.result-tag.local { background: rgba(34, 197, 100, 0.85); color: #fff; }
.result-tag.internet { background: rgba(229, 9, 20, 0.85); color: #fff; }

/* Watchlist Voting */
.wl-vote-box {
  position: absolute; top: 10px; right: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  padding: 6px 4px; border-radius: 20px; z-index: 5;
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.2s, background 0.2s;
}
.wl-imdb-card:hover .wl-vote-box { background: rgba(0,0,0,0.85); }

.wl-vote-btn {
  background: transparent; border: none; color: #fff; cursor: pointer;
  padding: 4px; display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s, color 0.1s; border-radius: 50%;
}
.wl-vote-btn:hover { background: rgba(255,255,255,0.1); }
.wl-vote-btn.up:hover { color: var(--green); transform: translateY(-2px); }
.wl-vote-btn.down:hover { color: var(--accent); transform: translateY(2px); }

.wl-vote-count {
  font-size: 0.85rem; font-weight: 800; color: #fff;
  min-width: 20px; text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.wl-vote-count.negative { color: var(--accent); }

/* Watched State */
.wl-watched-toggle {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,0.6); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 10px; border-radius: 15px; cursor: pointer; font-size: 0.75rem;
  font-weight: 600; backdrop-filter: blur(8px); z-index: 5;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.wl-watched-toggle:hover { background: var(--accent); border-color: var(--accent); transform: scale(1.05); }
.wl-imdb-card.is-watched .wl-watched-toggle { background: var(--green); border-color: var(--green); }
.wl-imdb-card.is-watched .wl-imdb-poster img { filter: grayscale(0.8) brightness(0.5); }
.wl-imdb-card.is-watched::after {
  content: 'WATCHED'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  border: 3px solid var(--green); color: var(--green);
  padding: 4px 12px; font-weight: 900; font-size: 1.2rem;
  border-radius: 8px; pointer-events: none; opacity: 0.8;
  z-index: 10; font-family: 'Outfit', sans-serif;
  box-shadow: 0 0 15px rgba(34, 197, 100, 0.3);
}

.suggestion-card:hover { transform: translateY(-8px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

/* ─── Page Containers ─────────────────────────────────────────────────────── */
.page-container {
  padding: calc(var(--navbar-h) + 24px) 60px 60px;
  max-width: 100%;
  min-height: 100vh;
}

.wl-section-title {
  grid-column: 1 / -1;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 40px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.wl-section-title:first-of-type { margin-top: 0; }
.wl-section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
}

/* Explore Refresh Button */
.explore-refresh-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.explore-refresh-btn:hover {
  background: var(--accent);
  color: #000;
  transform: scale(1.1) rotate(45deg);
  border-color: var(--accent);
}
.explore-refresh-btn.rotating svg {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Explore Netflix-style Rows */
.explore-container {
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.explore-row-scroll {
  display: flex; gap: 16px; overflow-x: auto; padding: 6px 0 24px;
  scroll-behavior: smooth; scroll-snap-type: x mandatory;
  -ms-overflow-style: none; scrollbar-width: none;
}
.explore-row-scroll::-webkit-scrollbar { display: none; }

.explore-row-scroll .wl-imdb-card {
  flex: 0 0 calc(100% / 7.5);
  min-width: 160px; scroll-snap-align: start;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s;
}
.explore-row-scroll .wl-imdb-card:hover { transform: scale(1.08) translateY(-4px); z-index: 10; box-shadow: 0 20px 40px rgba(0,0,0,0.7); }

@media (max-width: 1400px) { .explore-row-scroll .wl-imdb-card { flex: 0 0 calc(100% / 5.5); } }
@media (max-width: 1000px) { .explore-row-scroll .wl-imdb-card { flex: 0 0 calc(100% / 3.5); } }
@media (max-width: 600px) { .explore-rows { padding: 20px 20px 60px; } .explore-tabs-bar { padding: 16px 20px 0; } .explore-hero-content { padding: calc(var(--navbar-h) + 40px) 24px 40px; } .explore-hero-dots { right: 24px; } .explore-row-scroll .wl-imdb-card { flex: 0 0 calc(100% / 2.2); } }
/* ─── Mobile Navigation Overlay ────────────────────────── */
.mobile-nav-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: none; flex-direction: column;
  opacity: 0; transition: opacity 0.3s ease;
}
.mobile-nav-overlay.active { display: flex; opacity: 1; }

.mobile-nav-content {
  padding: 24px 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mobile-nav-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 48px;
}

.mobile-nav-tabs {
  display: flex; flex-direction: column; gap: 12px;
}

.mobile-nav-tab {
  background: none; border: none; color: var(--text-secondary);
  font-family: var(--font); font-size: 1.5rem; font-weight: 700;
  text-align: left; padding: 12px 0;
  cursor: pointer; transition: color var(--transition), transform var(--transition);
  border-bottom: 1px solid var(--border);
}
.mobile-nav-tab:last-child { border-bottom: none; }
.mobile-nav-tab:hover, .mobile-nav-tab.active {
  color: var(--text-primary);
}
.mobile-nav-tab.active {
  color: var(--accent);
}

/* ─── Adjustments for existing elements ────────────────── */
@media (max-width: 768px) {
  .nav-center { display: none; } /* Hide search in navbar on mobile to make room */
  .nav-right { gap: 8px; }
  .logo-text { display: none; }
  .logo-icon { width: 34px; height: 34px; }
  
  .navbar { padding: 0 16px; height: 60px; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .btn-play, .btn-info { width: 100%; }
  
  .row-header { padding: 0 16px; }
  .row-scroll { padding: 0 16px; }
}

/* Ensure detail modal is responsive */
@media (max-width: 768px) {
  .modal-content {
    max-width: 100%;
    margin: 10px;
    max-height: 95vh;
  }
}

/* ─── File Manager Styles ────────────────────────────────── */
.fm-container {
  padding: calc(var(--navbar-h) + 24px) 5% 50px;
  max-width: 1300px;
  margin: 0 auto;
  min-height: 80vh;
}

.fm-header {
  background: rgba(20, 20, 30, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.fm-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.fm-title-section h2 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 60%, rgba(255, 255, 255, 0.5));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.fm-title-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 4px;
  margin-bottom: 0;
}

.fm-storage-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 250px;
  max-width: 350px;
  flex: 1;
}

.fm-storage-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.fm-storage-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.fm-storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #ff4b55 100%);
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

.fm-header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
  flex-wrap: wrap;
  gap: 16px;
}

.fm-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.fm-breadcrumb-item {
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 8px;
  border-radius: 6px;
}

.fm-breadcrumb-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.fm-breadcrumb-item.active {
  color: #fff;
  font-weight: 700;
  cursor: default;
}

.fm-breadcrumb-item.active:hover {
  background: none;
}

.fm-breadcrumb-separator {
  opacity: 0.3;
}

.fm-action-buttons {
  display: flex;
  gap: 12px;
}

.btn-fm-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 18px;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-fm-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-fm-action.accent {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-fm-action.accent:hover {
  background: #ff2a35;
  border-color: #ff2a35;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.25);
}

.fm-list-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 150px;
  padding: 12px 24px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fm-list-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.fm-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 150px;
  align-items: center;
  padding: 14px 24px;
  background: rgba(20, 20, 30, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.fm-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.fm-row-name-col {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0; /* for text truncate */
}

.fm-icon-wrapper {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.25rem;
  transition: transform 0.2s;
}

.fm-row:hover .fm-icon-wrapper {
  transform: scale(1.1);
}

.fm-icon-wrapper.folder {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.05);
}

.fm-icon-wrapper.video {
  background: rgba(229, 9, 20, 0.1);
  color: var(--accent);
}

.fm-icon-wrapper.audio {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.fm-icon-wrapper.image {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.fm-icon-wrapper.doc {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.fm-icon-wrapper.archive {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.fm-icon-wrapper.other {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.fm-filename {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-date-col, .fm-size-col {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.fm-actions-col {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-fm-item-action {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.btn-fm-item-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-1px);
}

.btn-fm-item-action.delete:hover {
  background: rgba(229, 9, 20, 0.15);
  border-color: rgba(229, 9, 20, 0.3);
  color: var(--accent);
}

.btn-fm-item-action.play:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

/* Drag & Drop Upload Overlay */
.fm-drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.fm-drag-box {
  width: 80%;
  max-width: 600px;
  padding: 60px 40px;
  border: 2px dashed var(--accent);
  border-radius: 24px;
  text-align: center;
  background: rgba(20, 20, 30, 0.5);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.fm-drag-overlay.active {
  display: flex;
}

.fm-drag-overlay.active .fm-drag-box {
  transform: scale(1);
}

.fm-drag-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

/* Upload progress widget */
.fm-upload-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  width: 380px;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.fm-upload-widget-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.fm-upload-widget-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
}

.fm-upload-widget-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 250px;
  overflow-y: auto;
}

.fm-upload-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fm-upload-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.fm-upload-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fm-upload-bar-bg {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.fm-upload-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  width: 0%;
}

.fm-upload-percent {
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 35px;
  text-align: right;
  color: var(--accent);
}

/* Animations */
@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes skeleton-pulse {
  0% { opacity: 0.35; background-color: rgba(255, 255, 255, 0.03); }
  50% { opacity: 0.7; background-color: rgba(255, 255, 255, 0.08); }
  100% { opacity: 0.35; background-color: rgba(255, 255, 255, 0.03); }
}

/* Responsive File Manager */
@media (max-width: 900px) {
  .fm-list-header {
    grid-template-columns: 2fr 1.5fr 100px;
  }
  .fm-row {
    grid-template-columns: 2fr 1.5fr 100px;
  }
  .fm-date-col {
    display: none;
  }
}

@media (max-width: 600px) {
  .fm-list-header {
    display: none;
  }
  .fm-row {
    grid-template-columns: 1fr auto;
    padding: 12px 16px;
    gap: 8px;
  }
  .fm-size-col {
    display: none;
  }
  .fm-row-name-col {
    gap: 12px;
  }
  .fm-container, .explore-container, .page-container {
    padding: 80px 16px 30px;
  }
  .fm-header {
    padding: 16px;
  }
  .fm-title-section h2 {
    font-size: 1.8rem;
  }
  .btn-fm-action {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
  .fm-upload-widget {
    width: calc(100% - 32px);
    bottom: 16px;
    right: 16px;
  }
}
