﻿/* =====================================================================
   StreamVault — Premium Design System
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-primary:     #0a0a0a;
  --bg-secondary:   #111111;
  --bg-card:        #161616;
  --bg-hover:       #1e1e1e;
  --bg-elevated:    #1a1a1a;
  --accent:         #e50914;
  --accent-hover:   #ff0a16;
  --accent-dim:     rgba(229,9,20,0.12);
  --accent-glow:    rgba(229,9,20,0.25);
  --text-primary:   #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted:     #555555;
  --border:         rgba(255,255,255,0.07);
  --border-light:   rgba(255,255,255,0.12);
  --shadow:         0 8px 32px rgba(0,0,0,0.7);
  --shadow-sm:      0 2px 12px rgba(0,0,0,0.5);
  --radius:         8px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --navbar-h:       68px;
  --transition:     0.18s ease;
  --font:           'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--navbar-h);
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 36px; gap: 36px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.5rem; font-weight: 900; letter-spacing: -0.8px;
  flex-shrink: 0;
}
.navbar-brand .logo-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1rem;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.navbar-brand .logo-text { color: var(--text-primary); }
.navbar-brand .logo-text span { color: var(--accent); }

.navbar-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.navbar-nav a {
  padding: 7px 15px; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}
.navbar-nav a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.navbar-nav a.active {
  color: var(--text-primary); background: rgba(255,255,255,0.07);
  font-weight: 600;
}
.navbar-nav a.active::after {
  content: ''; position: absolute; bottom: -1px; left: 15px; right: 15px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}

.navbar-actions { display: flex; align-items: center; gap: 10px; }

.navbar-search {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 16px;
  transition: all var(--transition);
}
.navbar-search:focus-within {
  border-color: rgba(229,9,20,0.5);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.navbar-search input {
  background: none; border: none; outline: none;
  width: 220px; font-size: 0.875rem; color: var(--text-primary);
}
.navbar-search input::placeholder { color: var(--text-muted); }
.navbar-search .search-icon { color: var(--text-muted); font-size: 0.9rem; }

.btn-upload {
  display: flex; align-items: center; gap: 7px;
  background: var(--accent); color: white;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.2px;
  transition: all var(--transition);
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-upload:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-upload span { font-size: 1.1rem; }

/* ── User menu ──────────────────────────────────────────────────────── */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 12px 6px 6px;
  cursor: pointer; transition: all var(--transition);
  font-size: 0.875rem; color: var(--text-primary);
}
.user-menu-btn:hover { border-color: var(--border-light); background: rgba(255,255,255,0.08); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #b30000 100%);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.8125rem; flex-shrink: 0;
}
.user-name { font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chevron { color: var(--text-muted); font-size: 0.7rem; }
.role-badge {
  background: rgba(229,9,20,0.15); color: var(--accent);
  border: 1px solid rgba(229,9,20,0.3);
  border-radius: 6px; padding: 1px 7px;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.3px;
}
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 2000;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); min-width: 210px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8); overflow: hidden;
  opacity: 0; transform: translateY(-8px) scale(0.97); pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
}
.user-dropdown.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.user-dropdown-header { padding: 16px; background: rgba(255,255,255,0.02); }
.user-dropdown-name { font-weight: 700; font-size: 0.9375rem; }
.user-dropdown-role { color: var(--text-muted); font-size: 0.8rem; margin-top: 3px; }
.user-dropdown-divider { height: 1px; background: var(--border); }
.user-dropdown-item {
  display: block; width: 100%; text-align: left;
  padding: 12px 16px; font-size: 0.875rem; font-weight: 500;
  color: var(--text-primary); background: none; border: none;
  cursor: pointer; transition: background var(--transition);
}
.user-dropdown-item:hover { background: rgba(255,255,255,0.04); }
.user-dropdown-item.danger { color: #ff5252; }
.user-dropdown-item.danger:hover { background: rgba(229,9,20,0.08); }

/* ── Page layout ────────────────────────────────────────────────────── */
.page { padding-top: calc(var(--navbar-h) + 28px); min-height: 100vh; }
.container { max-width: 1500px; margin: 0 auto; padding: 0 36px; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  position: relative; height: 580px;
  display: flex; align-items: flex-end;
  margin-bottom: 56px; border-radius: var(--radius-xl);
  overflow: hidden;
}
.hero-backdrop {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 20%;
  transition: all 0.6s ease;
}
.hero-backdrop::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(10,10,10,1)   0%,
    rgba(10,10,10,0.85) 25%,
    rgba(10,10,10,0.35) 55%,
    rgba(10,10,10,0.05) 100%
  );
}
.hero-content {
  position: relative; z-index: 1;
  padding: 52px; max-width: 620px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: white;
  padding: 5px 13px; border-radius: 6px;
  font-size: 0.6875rem; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 18px;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.hero-title {
  font-size: 3.25rem; font-weight: 900; line-height: 1.05;
  margin-bottom: 14px; letter-spacing: -1px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.hero-meta {
  display: flex; align-items: center; gap: 18px;
  color: var(--text-secondary); font-size: 0.875rem;
  margin-bottom: 18px;
}
.hero-meta .rating { color: #f5c518; font-weight: 700; }
.hero-overview {
  font-size: 0.9375rem; color: rgba(255,255,255,0.7); line-height: 1.65;
  margin-bottom: 30px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; }
.btn-play {
  display: flex; align-items: center; gap: 9px;
  background: #fff; color: #0a0a0a;
  padding: 13px 30px; border-radius: var(--radius);
  font-size: 1rem; font-weight: 800; letter-spacing: -0.2px;
  transition: all var(--transition);
}
.btn-play:hover { background: rgba(255,255,255,0.9); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.btn-info {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.1); color: white;
  padding: 13px 28px; border-radius: var(--radius);
  font-size: 1rem; font-weight: 700;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  transition: all var(--transition);
}
.btn-info:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); }

/* ── Sections ───────────────────────────────────────────────────────── */
.section { margin-bottom: 52px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.3px; }
.section-link { font-size: 0.8125rem; color: var(--accent); font-weight: 600; transition: all var(--transition); display: flex; align-items: center; gap: 4px; }
.section-link:hover { color: var(--accent-hover); gap: 8px; }

/* ── Media grid ─────────────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.media-card {
  position: relative; border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  background: var(--bg-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.media-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 0 1px var(--border-light);
  z-index: 2;
}
.media-card-poster {
  aspect-ratio: 2/3; width: 100%;
  object-fit: cover; background: var(--bg-hover);
  transition: transform 0.3s ease;
}
.media-card:hover .media-card-poster { transform: scale(1.02); }
.media-card-poster-placeholder {
  aspect-ratio: 2/3; width: 100%;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--text-muted);
}
.media-card-info { padding: 12px 10px 10px; }
.media-card-title {
  font-size: 0.8125rem; font-weight: 600; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
.media-card-year { font-size: 0.75rem; color: var(--text-muted); }
.media-card-rating { display: flex; align-items: center; gap: 3px; font-size: 0.75rem; color: #f5c518; font-weight: 600; }

.media-card-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.media-card:hover .media-card-overlay { background: rgba(0,0,0,0.45); }
.media-card-play {
  opacity: 0; transform: scale(0.75);
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(229,9,20,0.92); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; padding-left: 3px;
  box-shadow: 0 4px 20px rgba(229,9,20,0.5);
  transition: all 0.18s ease;
}
.media-card:hover .media-card-play { opacity: 1; transform: scale(1); }

.media-card-progress {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.12);
}
.media-card-progress-bar { height: 100%; background: var(--accent); }
.media-card-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(10,10,10,0.85); color: var(--text-secondary);
  padding: 3px 8px; border-radius: 5px;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.4px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
}

/* ── Row scroll ─────────────────────────────────────────────────────── */
.media-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.media-row::-webkit-scrollbar { height: 0; }
.media-row .media-card { flex: 0 0 150px; scroll-snap-align: start; }

/* ── Page header ────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 2rem; font-weight: 900; letter-spacing: -0.6px; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-select {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 9px 36px 9px 14px; border-radius: var(--radius);
  font-size: 0.875rem; color: var(--text-primary);
  outline: none; transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23555'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.filter-select:focus { border-color: rgba(229,9,20,0.5); }
.filter-select option { background: var(--bg-card); }

/* ── Empty state ────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 100px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 4rem; margin-bottom: 18px; opacity: 0.35; }
.empty-state h3 { font-size: 1.25rem; margin-bottom: 8px; color: var(--text-secondary); font-weight: 700; }
.empty-state p { font-size: 0.9375rem; }

/* ── Modal ──────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.88); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  transform: scale(0.94) translateY(10px);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px 18px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.125rem; font-weight: 800; }
.modal-close {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05); color: var(--text-secondary);
  font-size: 1.1rem; transition: all var(--transition);
}
.modal-close:hover { background: var(--accent); color: white; transform: rotate(90deg); }
.modal-body { padding: 24px 26px; }
.modal-footer { padding: 16px 26px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; letter-spacing: 0.2px; }
.form-control {
  width: 100%; background: #111118;
  border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius);
  padding: 11px 14px; font-size: 0.9375rem; color: var(--text-primary);
  outline: none; transition: all var(--transition);
  -webkit-appearance: none; appearance: none;
}
.form-control:focus { border-color: rgba(229,9,20,0.55); background: #16161f; box-shadow: 0 0 0 3px var(--accent-dim); }
.form-control::placeholder { color: var(--text-muted); opacity: 1; }

/* studio-input — used in auto-scan and modal search rows */
.studio-input {
  background: #111118;
  border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius);
  padding: 10px 14px; font-size: 0.9rem; color: var(--text-primary);
  outline: none; transition: all var(--transition);
  -webkit-appearance: none; appearance: none;
}
.studio-input:focus { border-color: rgba(229,9,20,0.55); background: #16161f; box-shadow: 0 0 0 3px var(--accent-dim); }
.studio-input::placeholder { color: var(--text-muted); opacity: 1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 700;
  transition: all var(--transition); border: 1px solid transparent;
  letter-spacing: 0.1px;
}
.btn-primary { background: var(--accent); color: white; box-shadow: 0 2px 12px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 20px var(--accent-glow); transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--border-light); }
.btn-danger { background: transparent; color: #ff5252; border-color: rgba(255,82,82,0.4); }
.btn-danger:hover { background: rgba(255,82,82,0.1); border-color: #ff5252; }
.btn-sm { padding: 6px 13px; font-size: 0.8rem; border-radius: 7px; }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

/* ── Upload page ────────────────────────────────────────────────────── */
.upload-container { max-width: 820px; margin: 0 auto; }
.upload-tabs {
  display: flex; gap: 4px; background: var(--bg-card);
  padding: 4px; border-radius: var(--radius-lg);
  margin-bottom: 28px; border: 1px solid var(--border);
}
.upload-tab {
  flex: 1; padding: 10px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 700; text-align: center;
  color: var(--text-muted); transition: all var(--transition);
}
.upload-tab.active { background: var(--accent); color: white; box-shadow: 0 2px 12px var(--accent-glow); }
.upload-tab:not(.active):hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.upload-panel { display: none; }
.upload-panel.active { display: block; }
.dropzone {
  border: 2px dashed rgba(255,255,255,0.1); border-radius: var(--radius-lg);
  padding: 52px; text-align: center; cursor: pointer;
  transition: all var(--transition); background: rgba(255,255,255,0.02);
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: var(--accent-dim); }
.dropzone-icon { font-size: 2.8rem; color: var(--text-muted); margin-bottom: 14px; }
.dropzone-text { font-size: 1rem; font-weight: 700; margin-bottom: 5px; }
.dropzone-hint { font-size: 0.875rem; color: var(--text-muted); }
.dropzone input[type=file] { display: none; }

.tmdb-results { margin-top: 10px; max-height: 290px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); }
.tmdb-result-item { display: flex; align-items: center; gap: 13px; padding: 11px 14px; cursor: pointer; transition: background var(--transition); border-bottom: 1px solid var(--border); }
.tmdb-result-item:last-child { border-bottom: none; }
.tmdb-result-item:hover { background: rgba(255,255,255,0.04); }
.tmdb-result-item.selected { background: var(--accent-dim); border-left: 3px solid var(--accent); }
.tmdb-result-poster { width: 40px; height: 60px; border-radius: 6px; object-fit: cover; background: var(--bg-hover); flex-shrink: 0; }
.tmdb-result-info h4 { font-size: 0.9375rem; font-weight: 700; }
.tmdb-result-info p { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
.upload-progress-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 12px; display: none; }
.upload-progress-fill { height: 100%; background: var(--accent); transition: width 0.3s ease; width: 0%; }
.upload-status { font-size: 0.875rem; color: var(--text-secondary); margin-top: 8px; text-align: center; min-height: 20px; }
.upload-status.success { color: #2ecc71; }
.upload-status.error { color: #ff5252; }

/* ── Detail modal ───────────────────────────────────────────────────── */
.detail-modal { max-width: 860px; }
.detail-backdrop-img { width: 100%; height: 260px; object-fit: cover; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.detail-body { display: flex; gap: 26px; padding: 26px; }
.detail-poster { width: 140px; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.6); }
.detail-poster img { width: 100%; border-radius: var(--radius); }
.detail-info { flex: 1; }
.detail-info h2 { font-size: 1.5rem; font-weight: 900; margin-bottom: 4px; letter-spacing: -0.4px; }
.detail-info .tagline { color: var(--text-muted); font-style: italic; margin-bottom: 14px; font-size: 0.9rem; }
.detail-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.badge {
  padding: 4px 11px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-secondary);
}
.badge-genre { background: rgba(229,9,20,0.1); border-color: rgba(229,9,20,0.25); color: #ff8080; }
.badge-rating { background: rgba(245,197,24,0.1); border-color: rgba(245,197,24,0.25); color: #f5c518; }
.detail-info .overview { color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.65; margin-bottom: 22px; }

/* ── Toast ──────────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 28px; right: 28px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 13px 18px;
  font-size: 0.875rem; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  display: flex; align-items: center; gap: 10px;
  animation: slideInRight 0.28s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 340px; backdrop-filter: blur(10px);
}
.toast.success { border-left: 3px solid #2ecc71; }
.toast.error   { border-left: 3px solid #ff5252; }
.toast.info    { border-left: 3px solid var(--accent); }
@keyframes slideInRight { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Loader ─────────────────────────────────────────────────────────── */
.loader { display: flex; align-items: center; justify-content: center; padding: 80px; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.07); border-top-color: var(--accent); animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .hero { height: 460px; }
  .hero-title { font-size: 2.5rem; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 768px) {
  .navbar { padding: 0 18px; gap: 16px; }
  .navbar-search { display: none; }
  .navbar-brand .logo-text { display: none; }
  .hero { height: 380px; }
  .hero-content { padding: 28px; }
  .hero-title { font-size: 2rem; }
  .hero-overview { display: none; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .detail-body { flex-direction: column; }
  .detail-poster { width: 110px; }
}
@media (max-width: 480px) {
  .media-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero-actions { flex-direction: column; }
}

/* ========================================================================
   Netflix-style Browse pages (movies.html / series.html)
   ======================================================================== */

/* Billboard hero */
.browse-hero {
  position: relative; width: 100%; height: 80vh; min-height: 520px;
  overflow: hidden; margin-bottom: 0;
}
.browse-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  transform: scale(1.04);
  transition: transform 8s ease;
}
.browse-hero:hover .browse-hero-bg { transform: scale(1); }
.browse-hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.55) 45%, rgba(10,10,10,0.18) 70%, transparent 100%),
              linear-gradient(to top, rgba(10,10,10,1) 0%, transparent 35%);
}
.browse-hero-content {
  position: absolute; bottom: 14%; left: 5%;
  max-width: 560px; z-index: 1;
}
.browse-hero-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.hero-chip {
  padding: 4px 11px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
}
.hero-chip.rating-chip { background: rgba(229,9,20,0.18); border-color: rgba(229,9,20,0.35); color: #ff9090; }
.browse-hero-title {
  font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 900;
  letter-spacing: -1px; line-height: 1.05; margin-bottom: 14px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.browse-hero-overview {
  font-size: 1rem; color: rgba(255,255,255,0.8); line-height: 1.6;
  margin-bottom: 24px; text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
.browse-hero-actions { display: flex; gap: 12px; }
.browse-hero-play {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 30px; border-radius: var(--radius); border: none;
  background: var(--accent); color: white;
  font-size: 1rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 24px var(--accent-glow);
  transition: all var(--transition);
}
.browse-hero-play:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 32px var(--accent-glow); }
.browse-hero-info {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 28px; border-radius: var(--radius);
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px); color: white;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: all var(--transition);
}
.browse-hero-info:hover { background: rgba(255,255,255,0.2); }

/* Browse main area */
.browse-main { padding: 0 0 60px; background: var(--bg-primary); }
.browse-filters {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  padding: 32px 5% 16px;
}
.browse-page-title { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.4px; }
.browse-filter-controls { display: flex; gap: 10px; flex-wrap: wrap; }

/* Netflix rows (browse pages) */
.nf-row { padding: 8px 0 32px; }
.nf-row-title {
  font-size: 1.125rem; font-weight: 700; letter-spacing: -0.2px;
  padding: 0 0 14px; margin-left: 6vw; color: var(--text-primary);
}
/* Netflix card (browse pages — .nf-card-poster variant) */
.nf-card-poster {
  position: relative; aspect-ratio: 2/3; background: var(--bg-card);
  border-radius: 6px; overflow: hidden;
}
.nf-card-poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter 0.22s; }
.nf-card:hover .nf-card-poster img { filter: brightness(0.45); }
.nf-card-no-poster {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 900; color: var(--text-muted);
  background: var(--bg-hover);
}
.nf-card-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 10px;
  opacity: 0; transition: opacity 0.2s;
}
.nf-card:hover .nf-card-overlay { opacity: 1; }
.nf-card-overlay-top { display: flex; justify-content: flex-end; }
.nf-card-rating {
  background: rgba(229,9,20,0.85); color: white;
  font-size: 0.75rem; font-weight: 800; padding: 3px 8px; border-radius: 4px;
}
.nf-card-overlay-bottom { display: flex; flex-direction: column; gap: 6px; }
.nf-card-actions { display: flex; gap: 7px; align-items: center; }
.nf-play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: white; color: black; border: none;
  font-size: 0.9rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-weight: 900; flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}
.nf-play-btn:hover { transform: scale(1.1); background: var(--accent); color: white; }
.nf-info-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 1.5px solid rgba(255,255,255,0.5);
  color: white; font-size: 0.85rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.nf-info-btn:hover { background: rgba(255,255,255,0.3); }
.nf-card-title-browse {
  font-size: 0.8125rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: white; text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.nf-card-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
  font-size: 0.7rem; color: rgba(255,255,255,0.7);
}
.nf-card-chips span::after { content: " \B7"; margin-left: 2px; }
.nf-card-chips span:last-child::after { content: ""; }

.browse-empty {
  text-align: center; padding: 100px 40px;
  color: var(--text-secondary);
}

/* Flat grid layout for movies/series browse pages */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 8px 6vw 60px;
}
.browse-grid .nf-card {
  flex: none;
  width: 100%;
}

/* ========================================================================
   Upload page redesign polish
   ======================================================================== */
.upload-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 5px; margin-bottom: 28px;
}
.upload-tab {
  flex: 1; padding: 10px 16px; border-radius: 10px;
  font-size: 0.875rem; font-weight: 600; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
  min-width: 110px; text-align: center;
}
.upload-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.upload-tab.active { background: rgba(229,9,20,0.12); color: var(--text-primary); box-shadow: 0 0 0 1px rgba(229,9,20,0.25); }

.upload-panel { display: none; }
.upload-panel.active { display: block; }

.upload-container { max-width: 860px; }

.dropzone {
  border: 2px dashed var(--border-light); border-radius: var(--radius-lg);
  padding: 40px 24px; text-align: center; cursor: pointer;
  position: relative; transition: all var(--transition);
  background: rgba(255,255,255,0.015);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent); background: rgba(229,9,20,0.04);
}
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone-icon { font-size: 2.5rem; margin-bottom: 12px; }
.dropzone-text { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.dropzone-hint { font-size: 0.8125rem; color: var(--text-muted); }

.upload-progress-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 14px; display: none; overflow: hidden; }
.upload-progress-bar.active { display: block; }
.upload-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; transition: width 0.3s; box-shadow: 0 0 8px var(--accent-glow); }

.upload-status { font-size: 0.875rem; margin-top: 10px; min-height: 20px; }
.upload-status.success { color: #5ddb8e; }
.upload-status.error { color: #ff7070; }

.tmdb-results {
  margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elevated); max-height: 240px; overflow-y: auto;
}
.tmdb-result-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  cursor: pointer; border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.tmdb-result-item:last-child { border-bottom: none; }
.tmdb-result-item:hover { background: var(--bg-hover); }
.tmdb-result-item img { width: 36px; height: 54px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.tmdb-result-info { flex: 1; min-width: 0; }
.tmdb-result-title { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmdb-result-year { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════════
   Netflix-style Home Page
   ═══════════════════════════════════════════════════════════════════════ */

/* Body: no top padding — hero bleeds under navbar */
.home-body { overflow-x: hidden; }
.home-body .page { padding-top: 0; }

/* ── Navbar transparent on home, solid on scroll ────────────────────── */
.navbar-home {
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}
.navbar-home.navbar-solid {
  background: rgba(10,10,10,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

/* ── Full-bleed hero ────────────────────────────────────────────────── */
.nf-hero {
  position: relative;
  width: 100%; height: 92vh; min-height: 560px; max-height: 900px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.nf-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 15%;
  transform: scale(1.04);
  transition: background-image 0.8s ease, transform 12s linear;
  animation: heroKenBurns 20s ease-in-out infinite alternate;
}
@keyframes heroKenBurns {
  from { transform: scale(1.0); }
  to   { transform: scale(1.08); }
}
.nf-hero-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top,  #0a0a0a 0%, rgba(10,10,10,0.7) 30%, transparent 60%),
    linear-gradient(to right, rgba(10,10,10,0.65) 0%, transparent 55%),
    linear-gradient(to bottom, rgba(10,10,10,0.5) 0%, transparent 20%);
}

/* ── Hero content ───────────────────────────────────────────────────── */
.nf-hero-body {
  position: relative; z-index: 2;
  padding: 0 6vw 9vh;
  max-width: 680px;
}
.nf-hero-label {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  padding: 4px 13px; border-radius: 5px;
  font-size: 0.6875rem; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; margin-bottom: 18px;
  box-shadow: 0 4px 18px var(--accent-glow);
}
.nf-hero-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900; line-height: 1.03;
  letter-spacing: -1.5px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
  margin-bottom: 14px;
}
.nf-hero-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}
.chip {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(6px);
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.8125rem; font-weight: 600; color: rgba(255,255,255,0.85);
}
.chip-star { color: #f5c518; border-color: rgba(245,197,24,0.3); background: rgba(245,197,24,0.1); }
.chip-genre { color: rgba(255,255,255,0.65); font-size: 0.75rem; font-weight: 500; }

.nf-hero-overview {
  font-size: 1rem; color: rgba(255,255,255,0.72); line-height: 1.7;
  margin-bottom: 30px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.nf-hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.nf-btn-play {
  display: inline-flex; align-items: center; gap: 9px;
  background: #fff; color: #0a0a0a;
  padding: 13px 34px; border-radius: var(--radius);
  font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.2px;
  transition: all 0.18s ease;
}
.nf-btn-play:hover { background: rgba(255,255,255,0.88); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.nf-btn-more {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.12); color: #fff;
  padding: 13px 32px; border-radius: var(--radius);
  font-size: 1.0625rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  transition: all 0.18s ease;
}
.nf-btn-more:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); }

/* ── Hero dots ──────────────────────────────────────────────────────── */
.nf-hero-dots {
  position: absolute; bottom: 24px; right: 6vw; z-index: 3;
  display: flex; gap: 8px; align-items: center;
}
.nf-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer; transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.2);
}
.nf-dot.active { width: 22px; border-radius: 4px; background: var(--accent); border-color: var(--accent); }

/* ── Hero fade-in animation ─────────────────────────────────────────── */
.nf-hero-fade .nf-hero-body { animation: heroBodFade 0.7s ease; }
.nf-hero-fade .nf-hero-bg   { animation: heroBgFade  0.6s ease; }
@keyframes heroBodFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes heroBgFade  { from { opacity: 0; } to { opacity: 1; } }

/* ── Rows wrapper ───────────────────────────────────────────────────── */
.nf-rows {
  padding: 40px 0 80px;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-primary) 80px);
}

/* ── Individual row section ─────────────────────────────────────────── */
.nf-row-section { margin-bottom: 44px; }
.nf-row-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6vw; margin-bottom: 14px;
}
.nf-row-label {
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.4px;
  color: var(--text-primary);
  padding-left: 6vw;
}
.nf-row-section:has(.nf-row-hd) .nf-row-label { padding-left: 0; }
.nf-row-more {
  font-size: 0.8125rem; color: var(--accent); font-weight: 700;
  transition: color var(--transition), gap var(--transition);
  display: flex; align-items: center; gap: 3px;
}
.nf-row-more:hover { color: var(--accent-hover); gap: 7px; }

.nf-row-track {
  display: flex; gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 8px 0 16px;
  scroll-padding-left: 6vw;
  scrollbar-width: none;
}
.nf-row-track::-webkit-scrollbar { display: none; }
.nf-row-track > .nf-card:first-child { margin-left: 6vw; }
.nf-row-track > .nf-card:last-child  { margin-right: 6vw; }

/* ── Netflix card ───────────────────────────────────────────────────── */
.nf-card {
  position: relative; flex: 0 0 160px;
  border-radius: 6px; overflow: hidden;
  cursor: pointer; background: #1a1a1a;
  scroll-snap-align: start;
  transition: transform 0.18s ease, box-shadow 0.18s ease, z-index 0s 0.18s;
  transform-origin: center bottom;
}
.nf-card:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.7);
  z-index: 10;
  transition: transform 0.18s ease, box-shadow 0.18s ease, z-index 0s;
}
.nf-card-img {
  aspect-ratio: 2/3; width: 100%; object-fit: cover;
  display: block; background: var(--bg-hover);
  transition: filter 0.26s ease;
}
.nf-card:hover .nf-card-img { filter: brightness(0.55); }
.nf-card-placeholder {
  aspect-ratio: 2/3; width: 100%;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--text-muted);
}

/* hover info panel */
.nf-card-hover {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 14px 12px 10px;
  opacity: 0; transition: opacity 0.22s ease;
}
.nf-card:hover .nf-card-hover { opacity: 1; }
.nf-card-play-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(229,9,20,0.92);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff; padding-left: 3px;
  box-shadow: 0 4px 20px rgba(229,9,20,0.6);
  transform: scale(0.8); transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
  margin-bottom: auto;
}
.nf-card:hover .nf-card-play-btn { transform: scale(1); }
.nf-card-info {
  width: 100%; margin-top: auto;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
  padding: 20px 8px 6px;
  display: flex; flex-direction: column; gap: 3px;
}
.nf-card-title {
  font-size: 0.8rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nf-card-year { font-size: 0.7rem; color: rgba(255,255,255,0.55); }
.nf-card-rat { font-size: 0.7rem; color: #f5c518; font-weight: 700; }

/* progress bar */
.nf-card-prog {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.15);
}
.nf-card-prog-bar { height: 100%; background: var(--accent); }

/* dismiss button on continue-watching cards */
.nf-card-dismiss {
  position: absolute; top: 6px; right: 6px; z-index: 20;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.75); color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.65rem; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s, background 0.15s; cursor: pointer;
}
.nf-card:hover .nf-card-dismiss { opacity: 1; }
.nf-card-dismiss:hover { background: rgba(229,9,20,0.85); border-color: var(--accent); }

/* ── Spinner & empty states ─────────────────────────────────────────── */
.nf-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.nf-empty {
  color: var(--text-muted); font-size: 0.9rem;
  padding: 40px 0; text-align: center; width: 100%;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nf-hero { height: 78vh; }
  .nf-hero-body { padding: 0 5vw 8vh; }
  .nf-hero-overview { display: none; }
  .nf-card { flex: 0 0 130px; }
  .nf-row-track { padding: 8px 0 16px; scroll-padding-left: 5vw; }
  .nf-row-track > .nf-card:first-child { margin-left: 5vw; }
  .nf-row-track > .nf-card:last-child  { margin-right: 5vw; }
  .nf-row-hd { padding: 0 5vw; }
  .nf-row-label { padding-left: 5vw; }
  .nf-row-title { margin-left: 5vw; }
}
@media (max-width: 480px) {
  .nf-hero { height: 72vh; }
  .nf-hero-title { font-size: 1.9rem; }
  .nf-card { flex: 0 0 110px; }
  .nf-btn-play, .nf-btn-more { padding: 11px 20px; font-size: 0.9rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Profile Picker
   ═══════════════════════════════════════════════════════════════════════ */
.profile-picker-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: #141414;
  display: none; align-items: center; justify-content: center;
}
.profile-picker-overlay.open { display: flex; }

.profile-picker { text-align: center; }
.profile-picker-title {
  font-size: 2rem; font-weight: 700; color: #fff;
  margin-bottom: 48px; letter-spacing: -0.5px;
}
.profile-picker-grid {
  display: flex; gap: 24px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 40px;
}
.profile-tile {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  cursor: pointer;
}
.profile-tile:hover .profile-avatar { border: 3px solid #fff; transform: scale(1.06); }
.profile-tile:hover .profile-tile-name { color: #fff; }
.profile-avatar {
  width: 96px; height: 96px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 800; color: #fff;
  border: 3px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.profile-tile-name {
  font-size: 0.9375rem; color: #808080;
  transition: color 0.15s ease;
}
.profile-picker-manage {
  background: none; border: 1px solid #808080;
  color: #808080; padding: 8px 24px; border-radius: 4px;
  font-size: 0.875rem; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.profile-picker-manage:hover { color: #fff; border-color: #fff; }

/* ── Manage panel ── */
.profile-manage-panel {
  position: absolute; inset: 0;
  background: #141414;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.profile-manage-panel.open { display: flex; }
.profile-manage-panel h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 28px; }
.profile-manage-panel h3 { font-size: 1rem; font-weight: 600; margin-bottom: 14px; color: var(--text-secondary); }
.profile-manage-list { width: 100%; max-width: 480px; margin-bottom: 28px; }
.profile-manage-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.profile-manage-avatar {
  width: 44px; height: 44px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.profile-manage-name { flex: 1; font-weight: 600; }
.profile-manage-delete {
  background: rgba(229,9,20,0.12); color: var(--accent);
  border: 1px solid rgba(229,9,20,0.3); border-radius: 6px;
  padding: 5px 12px; font-size: 0.8125rem; cursor: pointer;
  transition: background 0.15s;
}
.profile-manage-delete:hover { background: rgba(229,9,20,0.25); }

.profile-add-form { width: 100%; max-width: 480px; padding: 20px; background: var(--bg-card); border-radius: var(--radius-lg); margin-bottom: 10px; }
.profile-color-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.profile-colour-swatch {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.profile-colour-swatch:hover { transform: scale(1.2); }
.profile-colour-swatch.active { border-color: #fff; transform: scale(1.15); }

/* ═══════════════════════════════════════════════════════════════════════
   Featured card in upload panel
   ═══════════════════════════════════════════════════════════════════════ */
.featured-card {
  position: relative; border-radius: 8px; overflow: hidden;
  background: var(--bg-card); cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.featured-card:hover { transform: translateY(-3px); }
.featured-card--on { border-color: var(--accent); }
.featured-star-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.65); border: none;
  border-radius: 50%; width: 30px; height: 30px;
  font-size: 1rem; cursor: pointer; color: #ccc;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.featured-card--on .featured-star-btn { color: #f5c518; background: rgba(0,0,0,0.8); }
.featured-star-btn:hover { color: #f5c518; background: rgba(0,0,0,0.9); }
.featured-order-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 12px;
  font-size: 0.8125rem; font-weight: 600;
}
.featured-order-num {
  background: var(--accent); color: #fff;
  border-radius: 50%; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; flex-shrink: 0;
}
.featured-order-chip button {
  color: var(--text-muted); font-size: 0.75rem; cursor: pointer;
  transition: color 0.15s;
}
.featured-order-chip button:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════
   Admin Studio Layout
   ═══════════════════════════════════════════════════════════════════════ */

.studio-body { background: #0a0a0f; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.studio-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 60px; background: rgba(10,10,15,0.97);
  backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center;
  padding: 0 28px; gap: 20px;
}
.studio-topbar-brand {
  display: flex; align-items: center; gap: 9px;
  font-size: 1.2rem; font-weight: 900; letter-spacing: -0.5px;
  flex-shrink: 0; text-decoration: none; color: var(--text-primary);
}
.studio-topbar-center { flex: 1; display: flex; justify-content: center; }
.studio-topbar-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 4px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
}
.studio-topbar-back {
  font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500;
  transition: color var(--transition); display: flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.studio-topbar-back:hover { color: var(--text-primary); }

/* ── Main layout ─────────────────────────────────────────────────────── */
.studio-layout { display: flex; min-height: 100vh; padding-top: 60px; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.studio-sidebar {
  width: 232px; flex-shrink: 0;
  background: rgba(255,255,255,0.018);
  border-right: 1px solid rgba(255,255,255,0.07);
  position: sticky; top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto; padding: 22px 14px 40px;
}
.studio-nav-section-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0 10px; margin-bottom: 6px;
}
.studio-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.studio-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
  width: 100%; text-align: left; transition: all 0.15s; cursor: pointer;
  border: 1px solid transparent; background: none;
}
.studio-nav-item:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.studio-nav-item.active {
  color: var(--text-primary); background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.1); font-weight: 600;
}
.studio-nav-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}

/* ── Main content area ───────────────────────────────────────────────── */
.studio-main { flex: 1; min-width: 0; padding: 36px 40px 100px; overflow-x: hidden; }

/* ── Panel ───────────────────────────────────────────────────────────── */
.studio-panel { display: none; animation: studioFadeIn 0.2s ease; }
.studio-panel.active { display: block; }
@keyframes studioFadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

.studio-panel-header {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 28px; padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.studio-panel-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.studio-panel-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.studio-panel-sub { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; }

/* ── Step indicator row ──────────────────────────────────────────────── */
.studio-steps-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 24px; padding: 14px 20px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
}
.studio-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
}
.studio-step-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800;
}
.studio-step-arrow { color: var(--text-muted); font-size: 1.1rem; opacity: 0.4; }

/* ── Studio card ─────────────────────────────────────────────────────── */
.studio-card {
  background: rgba(255,255,255,0.028);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 26px;
  transition: border-color 0.2s;
}

/* Card header row (step badge + title) */
.studio-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.studio-card-step-badge {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: rgba(229,9,20,0.15); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800;
}
.studio-card-title {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.3px;
  color: var(--text-primary); margin-bottom: 0;
}
.studio-optional-badge {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-muted); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 2px 7px; border-radius: 20px; margin-left: 6px; vertical-align: middle;
}

/* ── Grid layouts ────────────────────────────────────────────────────── */
.studio-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.studio-single-col { max-width: 620px; }

/* ── Search row ──────────────────────────────────────────────────────── */
.studio-search-row { display: flex; gap: 10px; margin-bottom: 16px; }
.studio-search-row .form-control { flex: 1; }

/* ── TMDB preview card ───────────────────────────────────────────────── */
.tmdb-preview-card {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px; border-radius: 12px;
  background: rgba(229,9,20,0.06); border: 1px solid rgba(229,9,20,0.22);
  margin-top: 16px; position: relative;
  animation: studioFadeIn 0.2s ease;
}
.tmdb-preview-poster {
  width: 56px; height: 84px; object-fit: cover;
  border-radius: 6px; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
}
.tmdb-preview-body { flex: 1; min-width: 0; }
.tmdb-preview-title { font-weight: 800; font-size: 1rem; margin-bottom: 3px; }
.tmdb-preview-year { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.tmdb-preview-overview {
  font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tmdb-preview-clear {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.07); color: var(--text-muted);
  font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); cursor: pointer; border: 1px solid var(--border);
}
.tmdb-preview-clear:hover { background: rgba(229,9,20,0.15); color: var(--accent); border-color: var(--accent); }

/* ── Manual override section ─────────────────────────────────────────── */
.studio-manual-override { margin-top: 4px; }
.studio-override-label {
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px;
}

/* ── Info banner (full-width) ────────────────────────────────────────── */
.studio-info-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(33,150,243,0.07); border: 1px solid rgba(33,150,243,0.2);
  border-radius: 12px; padding: 14px 18px;
  font-size: 0.8375rem; color: #90caf9; line-height: 1.5;
  margin-top: 16px;
}
.studio-info-banner > span { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Studio divider ──────────────────────────────────────────────────── */
.studio-divider { height: 1px; background: rgba(255,255,255,0.07); margin: 22px 0; }

/* ── Info box (inline) ───────────────────────────────────────────────── */
.studio-info-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(33,150,243,0.07); border: 1px solid rgba(33,150,243,0.18);
  border-radius: 10px; padding: 11px 14px;
  font-size: 0.8125rem; color: #90caf9; line-height: 1.5;
  margin-top: 8px;
}

/* ── File name display ───────────────────────────────────────────────── */
.file-name-display {
  font-size: 0.8125rem; color: var(--text-secondary);
  margin-top: 10px; min-height: 18px;
  display: flex; align-items: center; gap: 8px;
}

/* ── Studio actions bar ──────────────────────────────────────────────── */
.studio-actions {
  display: flex; justify-content: flex-end;
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.studio-submit-btn { min-width: 160px; }

/* ── Library card ────────────────────────────────────────────────────── */
.library-card { padding: 0; overflow: hidden; }
.library-card #libraryList { padding: 8px; }

/* ── Dropzone sub-text ───────────────────────────────────────────────── */
.dropzone-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; margin-bottom: 6px; }

/* ── Dropzone overrides for studio ──────────────────────────────────── */
.studio-card .dropzone { margin-top: 0; }

/* ════════════════════════════════════════════════════════════════════════════
   AUTO SCAN STYLES
   ════════════════════════════════════════════════════════════════════════════ */

/* Settings card */
.scan-settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem 1.8rem;
  margin-bottom: 2rem;
}
.scan-settings-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .6rem;
}
.scan-settings-icon { font-size: 1.5rem; }
.scan-settings-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.scan-settings-hint { color: var(--text-muted); font-size: .88rem; margin: 0 0 .2rem; line-height: 1.55; }
.scan-settings-actions {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

/* Folder row */
.scan-folder-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.scan-folder-row .studio-input { flex: 1; }
.scan-folder-test {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .55rem 1rem;
  border-radius: 8px;
  background: rgba(0,230,118,0.12);
  color: #00e676;
  border: 1px solid rgba(0,230,118,0.3);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, transform .12s;
  white-space: nowrap;
}
.scan-folder-test:hover { background: rgba(0,230,118,0.22); transform: translateY(-1px); }

/* Badges */
.scan-badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .65rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.scan-badge-info    { background: rgba(33,150,243,.14); color: #64b5f6; }
.scan-badge-success { background: rgba(0,230,118,.14);  color: #00e676; }
.scan-badge-warning { background: rgba(255,193,7,.14);  color: #ffd54f; }
.scan-badge-error   { background: rgba(229,57,53,.14);  color: #ef9a9a; }

/* Results tabs */
.scan-results-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .1rem;
}
.scan-results-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1.1rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
}
.scan-results-tab.active { color: #00e676; border-bottom-color: #00e676; }
.scan-results-tab:hover:not(.active) { color: var(--text-primary); }

/* Requests filter tabs — same style, independent of scan tabs */
.req-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1.1rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
}
.req-filter-tab.active { color: #66bb6a; border-bottom-color: #66bb6a; }
.req-filter-tab:hover:not(.active) { color: var(--text-primary); }
.scan-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 .35rem;
  border-radius: 99px;
  background: rgba(0,230,118,.18);
  color: #00e676;
  font-size: .72rem;
  font-weight: 800;
}

/* Results panel */
.scan-results-panel { display: none; }
.scan-results-panel.active { display: block; }
.scan-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .9rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.scan-results-info { color: var(--text-muted); font-size: .88rem; }
.scan-accept-all-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: 8px;
  background: rgba(0,230,118,.15);
  color: #00e676;
  border: 1px solid rgba(0,230,118,.3);
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
}
.scan-accept-all-btn:hover { background: rgba(0,230,118,.28); }

/* Scan cards grid */
.scan-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 1rem;
}
.scan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s, transform .18s;
}
.scan-card:hover { border-color: rgba(0,230,118,.4); transform: translateY(-2px); }
.scan-card-imported { opacity: .65; }
.scan-card-skipped  { opacity: .5; }
.scan-card-inner {
  display: flex;
  gap: 0;
}
.scan-card-poster {
  width: 90px;
  min-height: 130px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg-hover);
}
.scan-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scan-card-poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
  min-height: 130px;
}
.scan-card-imported-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,230,118,.85);
  color: #000;
  font-size: .7rem;
  font-weight: 800;
  text-align: center;
  padding: .2rem .3rem;
}
.scan-card-body {
  flex: 1;
  padding: .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .32rem;
  min-width: 0;
}
.scan-card-filename {
  font-size: .76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-card-no-match { color: var(--text-muted); }
.scan-card-meta {
  display: flex;
  gap: .6rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.scan-card-overview {
  margin: 0;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.scan-card-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: .4rem;
}
.scan-import-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .38rem .85rem;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, transform .12s;
}
.scan-import-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.scan-skip-btn, .scan-manual-btn, .scan-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .38rem .85rem;
  border-radius: 7px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s;
}
.scan-skip-btn:hover, .scan-manual-btn:hover, .scan-retry-btn:hover { background: var(--bg-card-hover, var(--bg-hover)); }
.scan-manual-btn { color: #64b5f6; border-color: rgba(33,150,243,.3); background: rgba(33,150,243,.08); }

/* Alternative match buttons */
.scan-alternatives {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .1rem;
}
.scan-alt-label { font-size: .73rem; color: var(--text-muted); white-space: nowrap; }
.scan-alt-btn {
  padding: .2rem .55rem;
  border-radius: 6px;
  background: rgba(255,193,7,.1);
  color: #ffd54f;
  border: 1px solid rgba(255,193,7,.25);
  font-size: .73rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.scan-alt-btn:hover { background: rgba(255,193,7,.22); }

/* Importing state */
.scan-importing {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text-muted);
}

/* Loading state */
.scan-loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
  color: var(--text-muted);
}
.scan-spinner {
  width: 42px; height: 42px;
  border: 3px solid var(--border);
  border-top-color: #00e676;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.scan-spinner-sm {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: #00e676;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.scan-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  gap: .6rem;
  color: #00e676;
  font-size: 2rem;
}
.scan-empty p { font-size: .95rem; color: var(--text-muted); margin: 0; }

/* ── Manual Search Modal ─────────────────────────────────────────────── */
.scan-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.scan-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.scan-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem .8rem;
  border-bottom: 1px solid var(--border);
}
.scan-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.scan-modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; padding: .2rem .4rem;
  border-radius: 6px; transition: color .15s, background .15s;
}
.scan-modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }
.scan-modal-filepath {
  margin: .5rem 1.4rem .3rem;
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-modal-search-row {
  display: flex;
  gap: .5rem;
  padding: .5rem 1.4rem .8rem;
}
.scan-modal-search-row .studio-input { flex: 1; }
.scan-modal-results {
  overflow-y: auto;
  flex: 1;
  padding: 0 1rem .8rem;
}
.scan-modal-loading {
  display: flex; align-items: center; gap: .5rem;
  padding: 1rem; color: var(--text-muted); font-size: .88rem;
}
.scan-modal-none { padding: 1rem; color: var(--text-muted); font-size: .88rem; }
.scan-modal-result-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .4rem;
  border-radius: 8px;
  cursor: default;
  transition: background .15s;
}
.scan-modal-result-row:hover { background: var(--bg-hover); }
.scan-modal-poster {
  width: 46px; height: 68px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.scan-modal-poster-ph {
  width: 46px; height: 68px;
  border-radius: 6px;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.scan-modal-result-info {
  display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 0;
}
.scan-modal-result-info strong {
  font-size: .9rem; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scan-modal-result-info span { font-size: .78rem; color: var(--text-muted); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .studio-sidebar { display: none; }
  .studio-main { padding: 20px 18px 60px; }
  .studio-grid-2 { grid-template-columns: 1fr; }
  .scan-cards-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════════
   SUBTITLE UPLOAD ADMIN UI
   ════════════════════════════════════════════════════════════════════════ */
.subtitle-upload-card { animation: fadeInUp .3s ease; }
.studio-card-hint {
  color: var(--text-muted);
  font-size: .85rem;
  margin: -.3rem 0 .9rem;
  line-height: 1.5;
}
.subtitle-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-bottom: .9rem;
}
.subtitle-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .85rem;
}
.subtitle-row-icon { font-size: 1rem; flex-shrink: 0; }
.subtitle-row-label { flex: 1; font-size: .88rem; color: var(--text-primary); font-weight: 600; }
.subtitle-row-preview {
  font-size: .78rem; color: #64b5f6;
  text-decoration: none; padding: .15rem .5rem;
  border-radius: 5px; border: 1px solid rgba(33,150,243,.25);
  background: rgba(33,150,243,.07);
  transition: background .15s;
}
.subtitle-row-preview:hover { background: rgba(33,150,243,.18); }
.subtitle-row-delete {
  background: none; border: none; color: var(--text-muted);
  font-size: .85rem; cursor: pointer; padding: .2rem .4rem;
  border-radius: 5px; transition: color .15s, background .15s;
}
.subtitle-row-delete:hover { color: #ef9a9a; background: rgba(229,57,53,.1); }

.subtitle-add-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.subtitle-file-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem .9rem;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s;
  white-space: nowrap;
}
.subtitle-file-btn:hover { background: rgba(255,255,255,.11); }

/* ── Edit Media Panel ───────────────────────────────────────────────────── */
.edit-search-row { margin-bottom: 14px; }
.edit-search-row .form-control { width: 100%; }

.edit-media-list { display: flex; flex-direction: column; gap: 2px; }
.edit-empty { color: var(--text-muted); padding: 24px; text-align: center; }

.edit-media-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background .15s;
}
.edit-media-row:hover { background: var(--bg-hover); }
.edit-media-row-poster {
  width: 38px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.edit-media-row-poster-ph {
  width: 38px;
  height: 56px;
  background: var(--bg-hover);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.edit-media-row-info { flex: 1; min-width: 0; }
.edit-media-row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-media-row-meta  { font-size: .8125rem; color: var(--text-muted); margin-top: 2px; }

.edit-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.edit-detail-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}
.edit-detail-poster {
  width: 48px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.edit-detail-name { font-size: 1.2rem; font-weight: 700; }
.edit-detail-meta { font-size: .85rem; color: var(--text-muted); margin-top: 3px; }

.edit-section-title {
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.edit-season-section { display: none; }
.edit-season-section.active { display: block; }

.edit-ep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.edit-ep-row:last-of-type { border-bottom: none; }
.edit-ep-row-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.edit-ep-num  { font-size: .8rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.edit-ep-title { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-ep-actions { display: flex; gap: 6px; flex-shrink: 0; }
.edit-ep-subs-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.edit-ep-subs-panel {
  background: rgba(255,255,255,.03);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 12px 14px;
  margin-bottom: 6px;
}

