/* ── Bytestream — app.css ─────────────────────────────── */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg:            #f9f9fb;
  --surface:       #ffffff;
  --surface-2:     #f0f0f4;
  --card-bg:       #ffffff;
  --accent:        #b4232f;
  --accent-hover:  #991924;
  --accent-dim:    rgba(180,35,47,0.10);
  --accent-glow:   rgba(180,35,47,0.20);
  --brand-start:   #7f101d;
  --brand-end:     #c92b38;
  --text-1:        #0f0f14;
  --text-2:        #60607a;
  --text-3:        #a8a8c0;
  --border:        rgba(0,0,0,0.08);
  --border-hover:  rgba(0,0,0,0.14);
  --shadow-card:   0 1px 4px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.05);
  --shadow-hover:  0 6px 24px rgba(0,0,0,0.13);
  --shadow-drop:   0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  --radius-sm:     8px;
  --radius:        12px;
  --sidebar-width: 240px;
  --transition:    0.18s ease;
  --progress-color: #e50914;
  --success-bg:    rgba(34,197,94,0.12);
  --success-text:  #16a34a;
}

[data-theme='dark'] {
  --bg:           #0c0c10;
  --surface:      #121217;
  --surface-2:    #1a1a21;
  --card-bg:      #16161d;
  --accent-dim:   rgba(180,35,47,0.18);
  --accent-glow:  rgba(180,35,47,0.28);
  --text-1:       #f3f3f7;
  --text-2:       #b2b2c2;
  --text-3:       #73738b;
  --border:       rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.14);
  --shadow-card:  0 12px 32px rgba(0,0,0,0.28);
  --shadow-hover: 0 18px 42px rgba(0,0,0,0.34);
  --shadow-drop:  0 8px 32px rgba(0,0,0,0.4);
  --success-bg:   rgba(34,197,94,0.15);
  --success-text: #4ade80;
}

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

html { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-1);
  height: 100%;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── App shell ───────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Nav progress bar ────────────────────────────────────── */
.nav-progress {
  position: fixed;
  bottom: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  z-index: 300;
  transition: none;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  z-index: 10;
}
.sidebar.collapsed { width: 68px; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sidebar.collapsed .logo { justify-content: center; padding: 0 0 24px; gap: 0; }

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  box-shadow: 0 10px 28px rgba(127,16,29,0.38), 0 2px 6px rgba(0,0,0,0.18);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.logo-text { opacity: 1; transition: opacity 0.15s ease; overflow: hidden; }
.sidebar.collapsed .logo-text { opacity: 0; width: 0; }

.nav-links {
  list-style: none;
  flex-grow: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar.collapsed .nav-links { padding: 16px 8px; }

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.sidebar.collapsed .nav-links li a { justify-content: center; padding: 10px; gap: 0; }

.nav-links li a svg { flex-shrink: 0; opacity: 0.55; transition: opacity var(--transition); }

.nav-links li.active a {
  background: linear-gradient(90deg, rgba(127,16,29,0.10), rgba(201,43,56,0.05));
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(180,35,47,0.08);
}
.nav-links li.active a svg { opacity: 1; }
.nav-links li a:hover { background-color: var(--surface-2); color: var(--text-1); }
.nav-links li a:hover svg { opacity: 0.85; }

.nav-text { opacity: 1; transition: opacity 0.1s ease; overflow: hidden; }
.sidebar.collapsed .nav-text { opacity: 0; width: 0; }

.sidebar-footer {
  padding: 12px 8px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}
.sidebar.collapsed .sidebar-footer { padding: 12px 4px 0; }
.sidebar.collapsed .theme-toggle { display: none; }

/* ── Theme switch ────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition);
}
.theme-switch {
  position: relative;
  width: 58px; height: 32px;
  border-radius: 999px;
  background: #ebebee;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  flex-shrink: 0;
  transition: background var(--transition);
}
.theme-switch-icon {
  position: absolute;
  top: 50%;
  width: 14px; height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  transition: color var(--transition), opacity var(--transition);
}
.theme-switch-icon--sun  { left: 9px;  color: #b96a12; opacity: 1; }
.theme-switch-icon--moon { right: 9px; color: rgba(86,90,122,0.72); opacity: 0.5; }
.theme-switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #f4f4f7);
  box-shadow: 0 2px 8px rgba(15,15,20,0.18);
  transition: transform 0.22s ease, background var(--transition);
}
[data-theme='dark'] .theme-switch { background: linear-gradient(180deg, rgba(69,78,122,0.92), rgba(35,39,65,0.92)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
[data-theme='dark'] .theme-switch-icon--sun  { color: rgba(255,211,120,0.55); opacity: 0.42; }
[data-theme='dark'] .theme-switch-icon--moon { color: #d6dbff; opacity: 1; }
[data-theme='dark'] .theme-switch-thumb { transform: translateX(26px); background: linear-gradient(180deg, #f5f7ff, #d8def6); }

/* ── Main content ────────────────────────────────────────── */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.12) transparent;
  min-width: 0;
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
[data-theme='dark'] .content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); }

/* ── Top bar ─────────────────────────────────────────────── */
.top-bar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  transition: transform 0.24s ease, opacity 0.24s ease;
  will-change: transform;
  flex-shrink: 0;
}
.top-bar.top-bar--hidden { transform: translateY(calc(-100% - 8px)); opacity: 0.92; }
.top-bar-left { flex-shrink: 0; }

.menu-toggle {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: none; border: none;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.menu-toggle:hover { background: var(--surface-2); color: var(--text-1); }

.top-bar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-right: 8px;
}

/* ── Search ──────────────────────────────────────────────── */
.search-wrapper { position: relative; width: 100%; max-width: 520px; }

.search-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15,15,20,0.05);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-shell:focus-within {
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 6%, transparent);
}

.search-icon { flex-shrink: 0; color: var(--text-3); pointer-events: none; transition: color var(--transition); }
.search-shell:focus-within .search-icon { color: var(--accent); }

.search-bar {
  flex: 1; min-width: 0;
  padding: 0 6px;
  border: none; background: transparent;
  color: var(--text-1);
  font-size: 14px;
  font-family: inherit;
}
.search-bar::placeholder { color: var(--text-3); }
.search-bar:focus { outline: none; }

.search-clear {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition), background var(--transition);
}
.search-clear.visible { opacity: 1; pointer-events: auto; }
.search-clear:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); color: var(--accent); }

.search-shortcut {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11px; font-weight: 600;
  font-family: inherit;
  transition: opacity var(--transition);
}
.search-shell:focus-within .search-shortcut { opacity: 0; pointer-events: none; }

.search-results {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-drop);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.search-results.open { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--surface-2); }
.search-result-thumb {
  width: 40px; height: 28px;
  border-radius: 4px;
  background: var(--surface-2);
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta  { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* ── Top buttons ─────────────────────────────────────────── */
.top-btn {
  position: relative;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: none; border: none;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.top-btn:hover { background: var(--surface-2); color: var(--text-1); }

.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  width: 16px; height: 16px;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

/* ── Avatar + Dropdown ───────────────────────────────────── */
.avatar-wrapper { position: relative; }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: #fff;
  cursor: pointer; border: none; flex-shrink: 0;
  transition: opacity var(--transition);
}
.user-avatar:hover { opacity: 0.88; }

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px); right: 0;
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-drop);
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.profile-dropdown.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.dropdown-header { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px; }
.dropdown-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.dropdown-user-info { display: flex; flex-direction: column; overflow: hidden; }
.dropdown-name  { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-email { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text-1);
  text-decoration: none;
  transition: background var(--transition);
}
.dropdown-item svg { color: var(--text-2); flex-shrink: 0; }
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item--danger { color: #ef4444; }
.dropdown-item--danger svg { color: #ef4444; }
.dropdown-item--danger:hover { background: rgba(239,68,68,0.06); }

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard-view { flex: 1; padding-bottom: 48px; }

/* ── Hero ────────────────────────────────────────────────── */
.hero { position: relative; height: 420px; overflow: hidden; flex-shrink: 0; }

.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-color: var(--surface-2);
  transition: background-image 0.3s ease;
}
.hero-bg--empty { background: linear-gradient(135deg, #1a0e40 0%, #2d1b5e 30%, #140a30 65%, #0c0820 100%); }

.hero::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,0.88) 35%, rgba(0,0,0,0.08) 100%),
    linear-gradient(to top, var(--bg) 0%, transparent 48%);
}

.hero-content {
  position: absolute;
  bottom: 52px; left: 48px;
  z-index: 2;
  max-width: 460px;
}
.hero-meta { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.hero-badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(129,140,248,0.20);
  border: 1px solid rgba(129,140,248,0.40);
  color: #a5b4fc;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.hero-title {
  font-size: 50px; font-weight: 800;
  line-height: 1.0; letter-spacing: -1.5px;
  margin-bottom: 14px; color: #fff;
}
.hero-desc {
  font-size: 14px; line-height: 1.65;
  color: rgba(255,255,255,0.55);
  margin-bottom: 26px; max-width: 360px;
}
.hero-actions { display: flex; gap: 10px; align-items: center; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-play {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 26px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn-play:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 10px 26px rgba(127,16,29,0.24); }
.btn-play--full { width: 100%; justify-content: center; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer; backdrop-filter: blur(8px);
  transition: background var(--transition);
  text-decoration: none;
}
.btn-outline:hover { background: rgba(255,255,255,0.18); }
.btn-outline--full { width: 100%; justify-content: center; background: var(--surface-2); color: var(--text-1); border: 1px solid var(--border); backdrop-filter: none; }
.btn-outline--full:hover { background: var(--border); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(127,16,29,0.22); }
.btn-primary:active { transform: none; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
}
.btn-primary.loading .btn-spinner { display: block; }
.btn-primary.loading .btn-label  { display: none; }

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

/* ── Media rows ──────────────────────────────────────────── */
.media-row { padding: 28px 28px 4px; }
.row-header {
  display: flex; align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.media-row h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.see-all { font-size: 13px; color: var(--accent); font-weight: 500; transition: opacity var(--transition); }
.see-all:hover { opacity: 0.7; }

/* ── Carousel ────────────────────────────────────────────── */
.carousel {
  display: flex; gap: 14px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

/* ── Media cards ─────────────────────────────────────────── */
.media-card {
  flex-shrink: 0;
  width: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.media-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-hover); }

.card-link { display: block; text-decoration: none; }

.card-image {
  height: 130px;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}
.card-image--placeholder { background: linear-gradient(135deg, #1a1a38, #2d2b58); }

.card-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.38);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.18s ease;
}
.media-card:hover .card-overlay { opacity: 1; }

.card-play-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #111; padding-left: 3px;
  transition: transform 0.15s ease;
}
.card-play-btn:hover { transform: scale(1.1); }

.card-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 3px 8px; border-radius: 4px;
  background: var(--accent); color: #fff;
  z-index: 1;
}
.card-badge--state { background: rgba(0,0,0,0.6); text-transform: capitalize; }

.card-details { padding: 10px 12px 12px; }
.card-title {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta { font-size: 11px; color: var(--text-2); }

.progress-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}
.progress {
  height: 100%;
  background: var(--progress-color);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(229,9,20,0.4);
}

/* ── Media grid ──────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 0 28px 28px;
}
.media-grid .media-card { width: 100%; }

/* ── Detail view ─────────────────────────────────────────── */
.detail-view { flex: 1; }

.detail-backdrop {
  height: 320px;
  background-size: cover; background-position: center top;
  background-color: var(--surface-2);
  position: relative;
}
.detail-backdrop-fade {
  height: 120px;
  margin-top: -120px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  position: relative; z-index: 1;
}

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

.detail-poster-col { display: flex; flex-direction: column; gap: 16px; flex-shrink: 0; }

.detail-poster {
  width: 200px; height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
}
.detail-poster--empty {
  width: 200px; height: 300px;
  background: var(--surface-2);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  border: 1px solid var(--border);
}

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

.detail-btn-row { display: flex; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-1); }
.icon-btn--active { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-dim); }

.detail-info-col { flex: 1; min-width: 0; padding-top: 80px; }

.detail-meta-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.detail-badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.detail-year, .detail-runtime { font-size: 14px; color: var(--text-2); }

.detail-title { font-size: 36px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin-bottom: 8px; }
.detail-original-title { font-size: 14px; color: var(--text-2); margin-bottom: 12px; font-style: italic; }

.detail-genres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.genre-tag {
  font-size: 12px; padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: background var(--transition), color var(--transition);
}
.genre-tag:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-dim); }

.detail-desc { font-size: 14px; line-height: 1.7; color: var(--text-2); margin-bottom: 20px; max-width: 560px; }

.detail-credits-row { display: flex; gap: 12px; margin-bottom: 8px; font-size: 14px; }
.credits-label { color: var(--text-3); min-width: 70px; flex-shrink: 0; }
.credits-names { color: var(--text-1); flex: 1; }
.credits-link { color: var(--accent); }
.credits-link:hover { text-decoration: underline; }

.detail-section { margin-top: 24px; }
.detail-section-title {
  font-size: 15px; font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-1);
}

/* ── Ratings ─────────────────────────────────────────────── */
.star-rating { display: flex; align-items: center; gap: 4px; }

.star {
  background: none; border: none; cursor: pointer;
  color: var(--text-3);
  transition: color 0.1s ease, transform 0.1s ease;
  padding: 0;
}
.star:hover, .star--filled { color: #f59e0b; }
.star:hover { transform: scale(1.15); }
.rating-avg { font-size: 13px; color: var(--text-2); margin-left: 8px; }
.rating-cnt { color: var(--text-3); }

/* ── Comments ────────────────────────────────────────────── */
.detail-comments { padding: 0 40px 48px; max-width: 680px; }

.comment-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.comment-input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-1);
  font-size: 14px; font-family: inherit;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.comment-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 6%, transparent);
}

.comment { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.comment-author { font-size: 13px; font-weight: 600; }
.comment-time   { font-size: 11px; color: var(--text-3); }
.comment-edited { font-size: 11px; color: var(--text-3); font-style: italic; }
.comment-text   { font-size: 14px; line-height: 1.6; color: var(--text-1); }
.comment-reply-btn { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--text-3); margin-top: 6px; padding: 0; transition: color var(--transition); }
.comment-reply-btn:hover { color: var(--accent); }
.count-badge { font-size: 13px; font-weight: 500; color: var(--text-3); }

/* ── Series seasons ──────────────────────────────────────── */
.seasons-section { padding: 0 40px 48px; }

.season-block { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }

.season-header {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--surface); border: none;
  cursor: pointer; color: var(--text-1);
  font-size: 14px; font-weight: 600;
  transition: background var(--transition);
  text-align: left;
}
.season-header:hover { background: var(--surface-2); }
.season-title { flex: 1; }
.season-count { font-size: 12px; color: var(--text-3); font-weight: 400; }
.season-chevron { color: var(--text-3); flex-shrink: 0; transition: transform 0.2s ease; }

.episode-list { display: none; border-top: 1px solid var(--border); }
.episode-list--open { display: block; }

.episode-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  color: var(--text-1);
  text-decoration: none;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.episode-row:last-child { border-bottom: none; }
.episode-row:hover { background: var(--surface-2); }

.episode-thumb {
  width: 120px; height: 68px;
  border-radius: 6px;
  background: var(--surface-2);
  background-size: cover; background-position: center;
  position: relative; flex-shrink: 0; overflow: hidden;
}
.episode-thumb--empty { background: linear-gradient(135deg, #1a1a38, #2d2b58); }

.episode-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4); opacity: 0;
  transition: opacity 0.18s ease; color: #fff;
}
.episode-row:hover .episode-play { opacity: 1; }

.episode-watched-badge {
  position: absolute; bottom: 4px; right: 4px;
  font-size: 10px; font-weight: 700;
  background: var(--accent); color: #fff;
  border-radius: 3px; padding: 1px 5px;
}

.episode-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.episode-num  { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
.episode-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.episode-desc  { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.episode-runtime { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

/* ── Collections grid ────────────────────────────────────── */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 0 28px 48px;
}
.collection-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
  display: block;
  text-decoration: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.collection-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.collection-card-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-color: var(--surface-2);
}
.collection-card-bg--empty { background: linear-gradient(135deg, #1a1a38, #2d2b58); }

.collection-card-body {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px 14px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  display: flex; flex-direction: column; gap: 2px;
}
.collection-title { font-size: 14px; font-weight: 700; color: #fff; }
.collection-count { font-size: 11px; color: rgba(255,255,255,0.6); }

.collection-hero {
  height: 260px; position: relative;
  background-size: cover; background-position: center;
  background-color: var(--surface-2);
  display: flex; align-items: flex-end;
}
.collection-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.75), transparent); }
.collection-hero-content { position: relative; z-index: 1; padding: 28px 40px; color: #fff; }
.collection-desc { font-size: 14px; color: rgba(255,255,255,0.75); margin-top: 6px; max-width: 560px; }

/* ── Person ──────────────────────────────────────────────── */
.person-header { display: flex; gap: 28px; padding: 32px 40px; align-items: flex-start; }
.person-avatar-lg {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  flex-shrink: 0;
}
.person-avatar-lg--empty {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.person-info { flex: 1; padding-top: 8px; }
.person-bio { font-size: 14px; line-height: 1.7; color: var(--text-2); margin-top: 8px; max-width: 600px; }

/* ── Page views ──────────────────────────────────────────── */
.page-view { flex: 1; padding-bottom: 48px; }
.page-header {
  display: flex; align-items: baseline; gap: 12px;
  padding: 32px 28px 20px;
}
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.page-count  { font-size: 14px; color: var(--text-3); }

.results-count { padding: 0 28px 16px; font-size: 14px; color: var(--text-2); }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 28px;
  color: var(--text-3);
  gap: 14px;
  text-align: center;
}
.empty-state p { font-size: 15px; }

/* ── Notifications ───────────────────────────────────────── */
.notif-list { padding: 0 28px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-item--unread .notif-dot { background: var(--accent); }
.notif-content { flex: 1; }
.notif-title { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.notif-body  { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.notif-time  { font-size: 11px; color: var(--text-3); }

/* ── Settings ────────────────────────────────────────────── */
.settings-sections { display: flex; flex-direction: column; gap: 20px; padding: 0 28px 48px; }
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.settings-section-title { font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row-info { display: flex; flex-direction: column; gap: 2px; }
.settings-row-label { font-size: 14px; font-weight: 500; }
.settings-row-value { font-size: 13px; color: var(--text-2); }

.theme-toggle-inline { display: flex; gap: 6px; }
.theme-chip {
  padding: 6px 14px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 20px; background: var(--surface-2);
  color: var(--text-2); cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  font-family: inherit;
}
.theme-chip:hover, .theme-chip--active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-dim); }

/* ── Form helpers ────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; }
.form-label { font-size: 13px; font-weight: 500; margin-bottom: 7px; color: var(--text-1); }
.form-row-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.form-link { font-size: 13px; color: var(--accent); font-weight: 500; transition: opacity var(--transition); }
.form-link:hover { opacity: 0.72; }
.form-hint { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-input {
  width: 100%; height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-1);
  font-size: 14px; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none; -webkit-appearance: none;
}
textarea.form-input { height: auto; padding: 12px 14px; resize: vertical; }
.form-input::placeholder { color: var(--text-3); }
.form-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent);
}
.form-input--sm { height: 34px; font-size: 13px; padding: 0 10px; }

.password-wrapper { position: relative; }
.password-wrapper .form-input { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-3); border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.password-toggle:hover { color: var(--text-2); background: var(--surface-2); }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer;
}

/* ── Error / success banners ─────────────────────────────── */
.error-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.20);
  border-radius: var(--radius-sm);
  font-size: 13px; color: #ef4444;
  margin-bottom: 18px;
}
.error-banner.visible { display: flex; }

.success-banner {
  display: none;
  padding: 11px 14px;
  background: var(--success-bg);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--success-text);
  margin-bottom: 18px;
}
.success-banner.visible { display: block; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; height: auto;
  overflow: auto; padding: 24px 16px;
  background: var(--bg);
}
.auth-shell { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 24px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.auth-brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  box-shadow: 0 8px 20px rgba(127,16,29,0.22);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding-left: 2px;
}
.auth-brand-name { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; color: var(--text-1); }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px;
}
.auth-heading { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; margin-bottom: 6px; }
.auth-subheading { font-size: 14px; color: var(--text-2); margin-bottom: 28px; line-height: 1.5; }
.auth-footer { text-align: center; font-size: 13px; color: var(--text-2); }
.auth-footer a { color: var(--accent); font-weight: 500; }

/* ── Split-panel auth layout (login) ─────────────────────── */
.auth-split-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 18% 20%, rgba(201,43,56,0.34) 0%, transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(139,0,0,0.24) 0%, transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(255,70,70,0.14) 0%, transparent 34%),
    linear-gradient(140deg, #160103 0%, #050608 46%, #130104 100%);
  background-size: 44px 44px, 44px 44px, auto, auto, auto, auto;
}
@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-split-wrap {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.auth-split-left {
  display: none;
}
.auth-split-media,
.auth-split-left-overlay {
  position: absolute;
  inset: 0;
}
.auth-split-media {
  background:
    linear-gradient(180deg, rgba(8,10,15,0.18), rgba(8,10,15,0.62)),
    radial-gradient(circle at 20% 20%, rgba(255,166,96,0.16), transparent 22%),
    linear-gradient(135deg, #1c2435 0%, #0c1422 44%, #23141e 100%);
}

.auth-split-left-overlay {
  background:
    linear-gradient(90deg, rgba(4,6,10,0.58) 0%, rgba(4,6,10,0.18) 42%, rgba(4,6,10,0.34) 100%);
}

.auth-split-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; position: relative; z-index: 1;
}
.auth-split-logo-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.auth-split-logo-name { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; color: #fff; }


.auth-split-left-content {
  position: relative;
  z-index: 1;
  max-width: 420px;
}
.auth-split-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
  color: rgba(255,255,255,0.72); margin-bottom: 16px;
}
.auth-split-headline {
  font-size: clamp(2.6rem, 4.2vw, 4rem);
  font-weight: 800; letter-spacing: -1.2px; line-height: 1.02;
  color: #fff; margin-bottom: 16px;
}
.auth-split-sub {
  font-size: 15px; line-height: 1.7; color: rgba(255,255,255,0.66);
  max-width: 360px;
}

.auth-split-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.auth-split-metric {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
}
.auth-split-metric strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}
.auth-split-metric span {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,0.64);
}

.auth-split-decor { position: absolute; border-radius: 50%; pointer-events: none; }
.auth-split-decor-1 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(180,35,47,0.20) 0%, transparent 68%);
  bottom: -110px; right: -110px;
}
.auth-split-decor-2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,186,96,0.14) 0%, transparent 70%);
  top: 40px; right: 24px;
}
.auth-split-decor-3 {
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, transparent 70%);
  top: 160px; left: -20px;
}

.auth-split-right {
  flex: 1 1 auto;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.auth-split-form-wrap {
  position: relative;
  width: 100%;
  max-width: 1080px;
  min-height: min(72vh, 680px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(145deg, rgba(27,27,31,0.94) 0%, rgba(12,12,14,0.98) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 36px;
  padding: 28px;
  box-shadow:
    0 40px 100px rgba(0,0,0,0.58),
    0 0 0 1px rgba(255,255,255,0.04),
    0 0 70px rgba(180,35,47,0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: authFadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}
.auth-split-form-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.04), transparent 34%),
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(255,255,255,0.025) 72px 73px);
  pointer-events: none;
}
[data-theme='dark'] .auth-split-form-wrap {
  background:
    linear-gradient(145deg, rgba(27,27,31,0.94) 0%, rgba(12,12,14,0.98) 100%);
}
.auth-split-form-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 24px;
  flex: 0 0 auto;
}
.auth-card-left {
  flex: 0 0 38%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 40px 36px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 24%),
    linear-gradient(155deg, rgba(144,17,28,0.98) 0%, rgba(72,8,14,0.96) 52%, rgba(14,5,7,0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), inset -1px 0 0 rgba(255,255,255,0.04);
  overflow: hidden;
}
.auth-card-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.06) 0 10px, transparent 10px 22px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 0 14px, transparent 14px calc(100% - 14px), rgba(255,255,255,0.08) calc(100% - 14px));
  opacity: 0.18;
  mix-blend-mode: screen;
  pointer-events: none;
}
.auth-card-left::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  pointer-events: none;
}
.auth-card-divider {
  display: none;
}
[data-theme='dark'] .auth-card-divider {
  background: rgba(255,255,255,0.08);
}
.auth-card-right {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 18px 18px 8px;
  position: relative;
}
.auth-card-right::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(210,46,63,0.16) 0%, transparent 62%);
  pointer-events: none;
}
.auth-split-form-brand {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.auth-split-form-brand-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  padding-left: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 42px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
}
.auth-stream-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-bottom: 24px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8,10,14,0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
}
.auth-stream-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 48%, transparent 100%);
  transform: translateX(-140%);
  animation: authStreamScan 5.8s linear infinite;
  pointer-events: none;
}
.auth-stream-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.auth-stream-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.38);
}
.auth-stream-label {
  margin-left: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.62);
}
.auth-stream-code {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.78);
}
.auth-stream-code span {
  display: block;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
}
@keyframes authStreamScan {
  from { transform: translateX(-140%); }
  to { transform: translateX(290%); }
}
.auth-split-kicker {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.58);
  margin-bottom: 14px;
}
.auth-split-heading {
  position: relative;
  z-index: 1;
  font-size: clamp(2.4rem, 3vw, 3.2rem);
  font-weight: 800; letter-spacing: -1.2px;
  color: #fff; margin-bottom: 10px; text-align: left;
  line-height: 0.98;
}
.auth-split-subheading {
  position: relative;
  z-index: 1;
  font-size: 15px; color: rgba(255,255,255,0.74); margin-bottom: 0; line-height: 1.65; text-align: left;
  max-width: 22rem;
}
.auth-film-strip {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
}
.auth-film-cell {
  min-width: 0;
  flex: 1 1 0;
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 4px, transparent 4px 18px),
    rgba(255,255,255,0.05);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  color: rgba(255,255,255,0.74);
}

.auth-split-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-split-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-split-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.02em;
}
.auth-input-group {
  display: flex;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition), transform var(--transition);
}
.auth-input-group:focus-within {
  background: rgba(255,255,255,0.08);
  border-color: rgba(201,43,56,0.55);
  box-shadow: 0 0 0 4px rgba(180,35,47,0.12);
  transform: translateY(-1px);
}
.auth-input-group--password {
  padding-right: 12px;
}
.auth-input-prefix {
  width: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.48);
  flex-shrink: 0;
}
.auth-split-input {
  height: 56px;
  border: none;
  background: transparent;
  padding: 0 14px 0 0;
  font-size: 16px;
  box-shadow: none;
  color: #f7f7f9;
}
.auth-split-input:focus {
  border: none;
  box-shadow: none;
}
.auth-split-input::placeholder {
  color: rgba(255,255,255,0.34);
}
.auth-split-password-toggle {
  position: static;
  transform: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: rgba(255,255,255,0.48);
}
.auth-split-password-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.auth-split-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 6px;
}
.auth-split-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.62);
  cursor: pointer;
}
.auth-split-check input {
  accent-color: var(--accent);
}
.auth-split-link {
  font-size: 13px;
  color: #f3a2a8;
}
.auth-split-link:hover {
  color: #fff;
}
.auth-split-submit {
  width: 100%;
  height: 58px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #d22e3f 0%, #8d121f 100%);
  box-shadow: 0 18px 38px rgba(127,16,29,0.34);
  letter-spacing: 0.01em;
}
.auth-split-submit:hover {
  background: linear-gradient(135deg, #e33b4d 0%, #9f1625 100%);
  box-shadow: 0 22px 44px rgba(127,16,29,0.42);
}
.auth-split-footer-text {
  margin-top: 24px; text-align: center;
  font-size: 13px; color: rgba(255,255,255,0.52);
}
.auth-split-mobile-intro {
  display: none;
}
.auth-version {
  margin-top: 24px;
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.32);
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

@media (max-width: 960px) {
  .auth-split-body {
    padding: 24px 16px;
  }
  .auth-split-form-wrap {
    max-width: 880px;
    padding: 22px;
  }
  .auth-card-left {
    flex-basis: 34%;
    padding: 32px 28px;
  }
  .auth-card-right {
    padding: 10px 8px 10px 0;
  }
}

@media (max-width: 700px) {
  .auth-split-body {
    display: flex;
    padding: 18px 14px;
  }
  [data-theme='dark'] .auth-split-body {
    background:
      linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
      radial-gradient(circle at 18% 20%, rgba(201,43,56,0.34) 0%, transparent 28%),
      radial-gradient(circle at 82% 16%, rgba(139,0,0,0.24) 0%, transparent 24%),
      radial-gradient(circle at 50% 100%, rgba(255,70,70,0.14) 0%, transparent 34%),
      linear-gradient(140deg, #160103 0%, #050608 46%, #130104 100%);
    background-size: 44px 44px, 44px 44px, auto, auto, auto, auto;
  }
  .auth-split-wrap {
    display: flex;
    width: 100%;
  }
  .auth-split-left { display: none; }
  .auth-split-right {
    flex: 1;
    display: flex;
    padding: 0;
    background: transparent;
  }

  .auth-split-form-wrap {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    min-height: auto;
    padding: 18px;
    border-radius: 28px;
  }
  .auth-split-form-main {
    flex-direction: column;
    gap: 16px;
  }
  .auth-card-left {
    flex: 0 0 auto;
    width: 100%;
    align-items: flex-start;
    padding: 28px 24px;
  }
  .auth-stream-panel { display: none; }
  .auth-film-strip { display: none; }
  .auth-split-kicker { display: none; }
  .auth-split-subheading { display: none; }
  .auth-card-divider { display: none; }
  .auth-card-right {
    width: 100%;
    padding: 6px 8px 10px;
  }
  .auth-card-left {
    padding: 20px 24px 16px;
    justify-content: flex-start;
    gap: 12px;
  }
  .auth-split-form-brand-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }
  .auth-split-heading {
    font-size: 1.9rem;
    text-align: left;
    margin-top: 0;
    margin-bottom: 0;
  }
  .error-banner {
    margin-bottom: 16px;
    font-size: 13px;
    border-radius: 12px;
  }
  .auth-split-form { gap: 18px; }
  .auth-split-field { gap: 8px; }
  .auth-split-label {
    font-size: 14px;
    color: rgba(255,255,255,0.82);
  }
  .auth-input-group {
    min-height: 58px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.10);
  }
  [data-theme='dark'] .auth-input-group {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.10);
  }
  .auth-input-group:focus-within {
    background: rgba(255,255,255,0.08);
    border-color: rgba(180,35,47,0.45);
    box-shadow: 0 0 0 4px rgba(180,35,47,0.10);
  }
  [data-theme='dark'] .auth-input-group:focus-within {
    background: rgba(255,255,255,0.08);
    border-color: rgba(180,35,47,0.55);
  }
  .auth-input-prefix {
    width: 52px;
    color: rgba(255,255,255,0.48);
  }
  .auth-split-input {
    height: 56px;
    font-size: 16px;
    background: transparent;
  }
  [data-theme='dark'] .auth-split-input { color: #eeeef6; }
  .auth-split-password-toggle {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }
  .auth-split-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 4px;
  }
  .auth-split-check {
    font-size: 14px;
    color: rgba(255,255,255,0.62);
    gap: 9px;
  }
  [data-theme='dark'] .auth-split-check { color: #9090aa; }
  .auth-split-check input {
    width: 17px;
    height: 17px;
  }
  .auth-split-link { font-size: 14px; }
  .auth-split-submit {
    height: 58px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 14px 32px rgba(127,16,29,0.24);
    margin-top: 4px;
  }
  .auth-split-footer-text {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
  }
  .auth-version {
    margin-top: 22px;
    text-align: center;
    font-size: 10px;
    color: rgba(255,255,255,0.32);
    letter-spacing: 0.8px;
  }
  [data-theme='dark'] .auth-version { color: #4a4a60; }
}

@media (max-width: 390px) {
  .auth-split-form-wrap {
    padding-left: 14px;
    padding-right: 14px;
  }
  .auth-stream-code {
    grid-template-columns: 1fr;
  }
  .auth-film-strip {
    flex-direction: column;
  }
  .auth-split-heading { font-size: 1.75rem; }
  .auth-input-prefix { width: 46px; }
  .auth-split-input { height: 54px; }
  .auth-split-submit { height: 54px; }
}

/* ── Error page ──────────────────────────────────────────── */
.error-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; text-align: center; gap: 8px;
}
.error-code    { font-size: 96px; font-weight: 800; letter-spacing: -4px; color: var(--accent); line-height: 1; }
.error-message { font-size: 18px; color: var(--text-2); }

/* ── Player ──────────────────────────────────────────────── */
.player-body {
  background: #000; overflow: hidden;
  display: flex; flex-direction: column;
  height: 100vh;
}
.player-shell { display: flex; flex-direction: column; height: 100%; }

.player-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 20;
}
.player-back {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: color var(--transition);
}
.player-back:hover { color: #fff; }
.player-title { font-size: 14px; color: rgba(255,255,255,0.7); }

.player-container { position: relative; flex: 1; background: #000; }
.player-video { width: 100%; height: 100%; object-fit: contain; display: block; }

.player-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px 20px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  opacity: 0; transition: opacity 0.25s ease;
}
.player-container:hover .player-controls { opacity: 1; }

.player-progress-wrap { margin-bottom: 12px; }
.player-progress-bar {
  height: 4px; background: rgba(255,255,255,0.25);
  border-radius: 2px; cursor: pointer; position: relative;
}
.player-progress-bar:hover { height: 6px; }
.player-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; pointer-events: none; }
.player-progress-thumb {
  position: absolute; top: 50%; right: 0;
  width: 14px; height: 14px;
  background: #fff; border-radius: 50%;
  transform: translate(50%, -50%);
  pointer-events: none; opacity: 0;
}
.player-progress-bar:hover .player-progress-thumb { opacity: 1; }

.player-time { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: rgba(255,255,255,0.65); }

.player-btns {
  display: flex; align-items: center; gap: 8px;
}
.player-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.85);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background var(--transition), color var(--transition);
}
.player-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.player-btn--right { margin-left: auto; }

.player-volume { display: flex; align-items: center; gap: 4px; }
.volume-slider {
  width: 80px; accent-color: var(--accent);
  height: 4px; cursor: pointer;
}

.player-speed { margin-left: 8px; }
.speed-select {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px; cursor: pointer; font-family: inherit;
}

/* ── Admin ───────────────────────────────────────────────── */
.admin-view { display: flex; flex: 1; gap: 0; }
.admin-sidebar {
  width: 180px; flex-shrink: 0;
  padding: 24px 0;
  border-right: 1px solid var(--border);
}
.admin-nav { display: flex; flex-direction: column; }
.admin-nav-link {
  padding: 9px 20px;
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border-left: 2px solid transparent;
}
.admin-nav-link:hover { background: var(--surface-2); color: var(--text-1); }
.admin-nav-link.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); }

.admin-content { flex: 1; padding: 28px 32px 48px; min-width: 0; overflow-y: auto; }

.admin-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.admin-page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.admin-section-title { font-size: 14px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px; }

.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-num  { font-size: 32px; font-weight: 800; letter-spacing: -1px; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--text-2); }

.admin-filters { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }

.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.admin-table th {
  padding: 10px 14px;
  text-align: left; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-2); }
.row--deleted td { opacity: 0.45; }

.table-link { color: var(--accent); font-size: 13px; font-weight: 500; background: none; border: none; cursor: pointer; font-family: inherit; text-decoration: none; padding: 0; }
.table-link:hover { text-decoration: underline; }
.table-link--danger { color: #ef4444; }

.type-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.type-badge--movie   { background: rgba(59,130,246,0.12);  color: #3b82f6; }
.type-badge--series  { background: rgba(168,85,247,0.12);  color: #a855f7; }
.type-badge--episode { background: rgba(34,197,94,0.12);   color: #22c55e; }

.status-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.status-badge--published { background: rgba(34,197,94,0.12);   color: #22c55e; }
.status-badge--draft     { background: rgba(234,179,8,0.12);   color: #ca8a04; }
.status-badge--archived  { background: rgba(239,68,68,0.12);   color: #ef4444; }
.status-badge--upcoming  { background: rgba(59,130,246,0.12);  color: #3b82f6; }

.admin-form { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.admin-form-inline { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    width: 100%; height: auto;
    flex-direction: row; align-items: center;
    padding: 14px 20px;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .nav-links { display: none; }
  .logo { padding: 0; border: none; font-size: 17px; }
  .sidebar-footer { display: none; }

  .content { overflow-y: auto; }

  .hero { height: 280px; }
  .hero-title { font-size: 32px; letter-spacing: -0.8px; }
  .hero-content { left: 24px; bottom: 24px; max-width: calc(100% - 48px); }
  .hero-desc { display: none; }

  .top-bar { flex-wrap: wrap; }
  .search-wrapper { order: 3; max-width: none; }
  .search-shell { height: 40px; font-size: 16px; }
  .search-shortcut { display: none; }

  .detail-body { flex-direction: column; padding: 0 20px 24px; margin-top: -40px; }
  .detail-poster { width: 120px; height: 180px; }
  .detail-poster--empty { width: 120px; height: 180px; }
  .detail-title { font-size: 26px; }
  .detail-info-col { padding-top: 0; }
  .detail-comments { padding: 0 20px 48px; }

  .media-row { padding: 20px 16px 4px; }
  .media-card { width: 160px; }
  .card-image { height: 100px; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 0 16px 24px; }

  .admin-sidebar { width: 140px; }
  .admin-content { padding: 20px 16px 48px; }
  .form-row-split { grid-template-columns: 1fr; }

  .page-header { padding: 20px 16px 14px; }
  .seasons-section { padding: 0 16px 32px; }
}
