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

:root {
  /* ── Cloud & Cornflower palette ──────────────────────────────────────
     Research-backed calm light theme (2026): a soft warm cloud-white
     base (not stark #fff — less glare), white cards, high-contrast
     slate-ink text, ONE confident blue accent (the most trusted /
     best-converting CTA color in A/B research), and muted sage green
     as a quiet secondary for save/positive touches. */

  --bg:         #f5f3ee;   /* warm cloud-white background */
  --bg-deep:    #eae7de;   /* deeper cloud edge */
  --surface:    #ffffff;   /* white card / panel */
  --surface2:   #eef2fa;   /* faint blue-tinted raised surface */
  --border:     #dbe0e8;   /* soft cool border */

  /* primary slot — same blue family (kept for any legacy refs) */
  --magenta:    #3b82f6;
  --magenta-d:  #2563eb;
  --magenta-lt: #dbeafe;

  --cyan:       #3b82f6;   /* cornflower blue — THE accent / CTA color */
  --cyan-d:     #2457c5;   /* deep blue — labels & text on white */
  --cyan-lt:    #a5c6fb;   /* light blue */

  /* secondary highlight — muted sage green (grounding, positive) */
  --lime:       #3f7d5f;
  --lime-d:     #2f6a4f;

  --rust:       #c4653f;   /* muted terracotta — destructive actions only */
  --rust-d:     #a44f2e;
  --rust-lt:    #b25a37;

  --text:       #24303f;   /* slate ink — body text */
  --text-dim:   #55637a;   /* muted slate */
  --muted:      #7f8ca0;   /* lighter muted slate */

  --radius:     12px;
  --radius-sm:  8px;
  --sidebar-w:  280px;
  --history-w:  240px;

  --shadow-card:    0 8px 24px -8px rgba(36,48,63,0.16),
                    0 2px 6px -2px rgba(36,48,63,0.08);
  --shadow-magenta: 0 4px 16px -6px rgba(36,48,63,0.16);
  --shadow-cyan:    0 4px 18px -4px rgba(59,130,246,0.30);
  --shadow-lime:    0 4px 16px -4px rgba(63,125,95,0.28);
  --shadow-rust:    0 4px 14px -4px rgba(196,101,63,0.28);
}

html, body {
  height: 100%;
  background: var(--bg);
  /* Whisper-subtle blue and sage washes over the warm cloud base */
  background-image:
    radial-gradient(at 85% 8%,   rgba(59,130,246,0.06)  0px, transparent 50%),
    radial-gradient(at 8% 92%,   rgba(63,125,95,0.05)   0px, transparent 55%),
    radial-gradient(at 50% 50%,  rgba(255,255,255,0.55) 0px, transparent 65%),
    radial-gradient(at 95% 50%,  rgba(59,130,246,0.04)  0px, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Utilities ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Layout ───────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--history-w);
  grid-template-rows: 1fr;
  height: 100vh;
}

/* ── Scrollbars ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-inner {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 20px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header img {
  width: 44px; height: 44px; border-radius: 50%;
  box-shadow: 0 0 0 2px #fff,
              0 0 18px rgba(59,130,246,0.35);
}

.sidebar-title { flex: 1; line-height: 1.2; }
.sidebar-title .sub  {
  font-size: 10px; font-weight: 800; color: var(--cyan-d);
  letter-spacing: 1.8px; text-transform: uppercase;
}
.sidebar-title .main {
  font-size: 18px; font-weight: 800; color: var(--cyan);
  letter-spacing: 1.2px;
}

.btn-api {
  font-size: 11px; padding: 5px 10px;
  background: var(--surface2); color: var(--cyan-d);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.btn-api:hover { background: #fff; border-color: var(--cyan); }

.section { padding: 12px 16px 4px; }
.section-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  color: var(--cyan-d); letter-spacing: 1.6px; margin-bottom: 8px;
}

.sep {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--cyan), transparent);
  opacity: 0.4;
  margin: 8px 16px;
}

/* ── Media type toggle (Movies / TV) ───────────────────────────────────── */
.media-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}
.media-btn {
  padding: 8px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s;
}
.media-btn:hover  { color: var(--cyan-d); }
.media-btn.active {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-d));
  color: #fff;
  box-shadow: var(--shadow-cyan);
}

/* ── Form controls ────────────────────────────────────────────────────── */
select, input[type="text"], input[type="number"] {
  width: 100%; padding: 8px 12px;
  background: #fff; border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); outline: none;
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus, input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.20);
}
select option { background: #fff; }

input[type="range"] {
  width: 100%; accent-color: var(--cyan); cursor: pointer;
}

.range-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.range-val { min-width: 56px; text-align: right; color: var(--cyan-d); font-size: 13px; font-weight: 700; }

.year-row { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 8px; align-items: center; }
.year-row label { color: var(--muted); font-size: 12px; }
.year-row input { padding: 6px 10px; }

/* ── Radio group ──────────────────────────────────────────────────────── */
.radio-group { display: flex; gap: 14px; }
.radio-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.radio-group input[type="radio"] { accent-color: var(--cyan); width: 14px; height: 14px; }

/* ── Mood grid ────────────────────────────────────────────────────────── */
.mood-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 5px; margin-top: 4px;
}
.mood-btn {
  padding: 7px 4px; font-size: 11px; font-weight: 700;
  background: #fff; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; text-align: center; transition: all .15s;
}
.mood-btn:hover  { background: var(--surface2); color: var(--cyan-d); border-color: var(--cyan); }
.mood-btn.active {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-d));
  color: #fff; border-color: var(--cyan-d);
  box-shadow: var(--shadow-cyan);
}

/* The Maxx Inspired mood gets an accent border in the idle state so it
   stands out as the signature mood, even when not selected. */
.mood-btn[data-mood="maxx"] {
  border-color: var(--cyan);
  color: var(--cyan-d);
}
.mood-btn[data-mood="maxx"]:hover {
  background: var(--surface2);
  color: var(--cyan-d);
  border-color: var(--cyan);
}
.mood-btn[data-mood="maxx"].active {
  background: linear-gradient(135deg, var(--cyan-d), var(--cyan));
  color: #fff;
  border-color: var(--cyan-d);
  box-shadow: var(--shadow-cyan);
}

/* ── Actor search ─────────────────────────────────────────────────────── */
.actor-wrap { position: relative; }
.actor-row  { display: flex; gap: 6px; }
.actor-row input { flex: 1; }
.btn-clear-actor {
  padding: 6px 12px; background: var(--surface2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
}
.btn-clear-actor:hover { background: var(--rust-d); color: #fff; border-color: var(--rust); }
.actor-status { font-size: 11px; color: var(--cyan-d); margin-top: 6px; min-height: 16px; }

.actor-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 999;
  background: #fff; border: 1px solid var(--cyan);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); max-height: 280px; overflow-y: auto;
  box-shadow: 0 8px 22px -4px rgba(59,130,246,0.25);
  display: none;
}
.actor-dropdown.open { display: block; }
.actor-option {
  padding: 9px 14px; cursor: pointer; font-size: 12px; line-height: 1.4;
  border-bottom: 1px solid var(--border);
}
.actor-option:last-child { border-bottom: none; }
.actor-option:hover { background: var(--surface2); }
.actor-option .name  { font-weight: 600; color: var(--text); }
.actor-option .known { color: var(--muted); font-size: 11px; }

/* ── Checkboxes ───────────────────────────────────────────────────────── */
.check-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px 6px;
}
.check-grid label {
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; font-size: 12px; padding: 3px 0;
}
.check-grid label:hover { color: var(--cyan-d); }
.check-grid input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: var(--cyan);
  flex-shrink: 0;
}

/* Special genre items (e.g. Indie, Bad Ass Dad) — keyword/curated filters
   that aren't real TMDB genres. Accent them to set them apart. */
.check-grid label.genre-special {
  color: var(--lime-d);
  font-weight: 700;
  letter-spacing: 0.3px;
}
.check-grid label.genre-special:hover { color: var(--lime); }
.check-grid label.genre-special input[type="checkbox"] {
  accent-color: var(--lime-d);
}

/* ── Sidebar action buttons ───────────────────────────────────────────── */
/* Pick CTA — cornflower blue */
.btn-pick {
  width: 100%; padding: 13px; margin: 12px 0 8px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-d));
  color: #fff;
  font-size: 15px; font-weight: 800; border: 2px solid #fff;
  border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
  box-shadow: var(--shadow-cyan);
  letter-spacing: 0.6px;
}
.btn-pick:hover    { filter: brightness(1.06); transform: translateY(-1px); }
.btn-pick:disabled { background: var(--surface2); color: var(--muted); border-color: var(--border); cursor: not-allowed; box-shadow: none; transform: none; filter: none; text-shadow: none; }

.btn-save {
  width: 100%; padding: 9px;
  background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; transition: all .15s;
}
.btn-save:hover { background: var(--surface2); border-color: var(--cyan); }

.btn-reset {
  width: 100%; padding: 9px; margin-top: 8px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; transition: all .15s;
}
.btn-reset:hover { color: var(--rust); border-color: var(--rust); }

/* ── Main area ────────────────────────────────────────────────────────── */
.main-panel {
  display: flex; flex-direction: column;
  background: transparent; overflow: hidden;
}

.status-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 24px 0; flex-shrink: 0;
}
.status-text { flex: 1; color: var(--text); font-size: 13px; font-weight: 500; }
.btn-refresh {
  padding: 6px 14px; background: #fff; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 12px;
  transition: all 0.15s;
}
.btn-refresh:hover { background: var(--surface2); color: var(--cyan-d); border-color: var(--cyan); }

.movie-card {
  flex: 1; display: flex; gap: 24px;
  padding: 20px 24px; overflow: hidden;
  min-height: 0;
}

.poster-wrap { flex-shrink: 0; width: 240px; }
.poster-wrap img {
  width: 240px; height: 360px; object-fit: cover;
  border-radius: var(--radius);
  display: block;
  box-shadow: var(--shadow-card);
}
.poster-placeholder {
  width: 240px; height: 360px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px;
}

.info-panel {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
  box-shadow: var(--shadow-card);
}

.info-scroll {
  flex: 1; overflow-y: auto; padding: 24px 24px 4px;
}

.movie-title {
  font-size: 28px; font-weight: 900; line-height: 1.2;
  margin-bottom: 6px; color: var(--cyan-d);
  letter-spacing: -0.3px;
}
.movie-meta { color: var(--text-dim); font-size: 13px; margin-bottom: 12px; font-weight: 500; }

.scores-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.badge {
  padding: 5px 14px; border-radius: 999px;
  background: var(--surface2); font-size: 12px; font-weight: 700;
  color: var(--cyan-d);
  border: 1px solid var(--border);
}
.badge.rt-fresh  { color: var(--cyan-d);  border-color: rgba(59,130,246,0.4); }
.badge.rt-ok     { color: var(--cyan-d);  border-color: rgba(59,130,246,0.4); }
.badge.rt-rotten { color: var(--rust);    border-color: rgba(196,101,63,0.4); }

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

.movie-director { font-size: 12px; font-weight: 700; color: var(--cyan-d); margin-bottom: 4px; }
.movie-cast     { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.movie-genres   { font-size: 12px; color: var(--cyan-d); margin-bottom: 6px; font-weight: 600; }
.movie-streaming{ font-size: 12px; color: var(--lime-d); margin-bottom: 18px; font-weight: 700; }

/* ── Action buttons grid ──────────────────────────────────────────────── */
.action-buttons {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 0 24px 24px;
}
.action-btn {
  padding: 11px 8px; border: none; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 800; cursor: pointer;
  transition: all .15s; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.4px;
}
.action-btn:hover    { transform: translateY(-1px); filter: brightness(1.06); }
.action-btn:disabled { opacity: .4; cursor: not-allowed; filter: none; transform: none; }

/* Action semantics:
   CYAN    = primary CTA (Pick Again) + positive engagement (Watched)
   WHITE   = neutral (Trailer / TMDB / Watchlist)
   RUST    = negative (Don't Like) */
.btn-pick-again {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-d));
  color: #fff;
  border: 2px solid #fff;
  box-shadow: var(--shadow-cyan);
}
.btn-trailer {
  background: #fff; color: var(--cyan-d);
  border: 1px solid var(--border);
}
.btn-trailer:hover { border-color: var(--cyan); }
.btn-tmdb {
  background: #fff; color: var(--cyan-d);
  border: 1px solid var(--border);
}
.btn-tmdb:hover { border-color: var(--cyan); }
.btn-watchlist {
  background: #fff;
  color: var(--lime-d);
  border: 2px solid var(--lime);
  box-shadow: var(--shadow-lime);
}
.btn-watched {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-d));
  color: #fff;
  border: 2px solid #fff;
  box-shadow: var(--shadow-cyan);
  /* Longer label needs to wrap rather than ellipsis-clip */
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
  font-size: 11px;
  padding: 9px 6px;
}
.btn-dislike {
  background: #fff;
  color: var(--rust);
  border: 2px solid var(--rust);
  box-shadow: var(--shadow-rust);
}
.btn-dislike:hover {
  background: var(--rust-d);
  color: #fff;
}

/* ── Watchlist bar ────────────────────────────────────────────────────── */
.watchlist-bar {
  background: rgba(255, 255, 255, 0.6);
  border-top: 1px solid var(--border);
  padding: 10px 16px; flex-shrink: 0;
}
.watchlist-hdr {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap;
}
.watchlist-hdr strong { color: var(--cyan-d); font-size: 13px; flex: 1; letter-spacing: 0.6px; }
.watched-count { font-size: 11px; color: var(--muted); }
.btn-sm {
  padding: 4px 10px; font-size: 11px;
  background: #fff; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  transition: all 0.15s;
}
.btn-sm:hover { background: var(--surface2); color: var(--cyan-d); border-color: var(--cyan); }
.btn-sm.danger {
  background: rgba(196,101,63,0.10); color: var(--rust); border-color: rgba(196,101,63,0.4);
}
.btn-sm.danger:hover { background: var(--rust); color: #fff; border-color: var(--rust); }

/* Blue variant — for the Copy All action */
.btn-sm.gold {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-d));
  color: #fff;
  border-color: var(--cyan-d);
  font-weight: 700;
}
.btn-sm.gold:hover {
  filter: brightness(1.06);
  color: #fff;
}

.watchlist-items {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; min-height: 30px;
}

/* Watchlist split pill */
.watchlist-chip-group {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.watchlist-chip-group:hover { transform: translateY(-1px); }

.watchlist-chip {
  padding: 5px 12px; background: #fff;
  border: 1px solid var(--cyan);
  border-right: 1px solid var(--border);
  border-radius: 999px 0 0 999px;
  font-size: 12px; white-space: nowrap; color: var(--cyan-d); flex-shrink: 0;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.watchlist-chip:hover {
  background: var(--surface2);
  border-color: var(--cyan-d);
  color: var(--text);
}
.watchlist-chip.copied {
  background: var(--cyan);
  border-color: var(--cyan-d);
  color: #fff;
  box-shadow: var(--shadow-cyan);
}
.watchlist-chip.copied::after { content: "  ✓"; font-weight: 800; }

.watchlist-remove {
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--cyan);
  border-left: none;
  border-radius: 0 999px 999px 0;
  color: var(--muted);
  font-size: 11px; font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.watchlist-remove:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: #fff;
}

.watchlist-empty { color: var(--muted); font-size: 12px; line-height: 30px; }

.chip-tv-sm {
  display: inline-block; font-size: 9px; font-weight: 800;
  padding: 1px 5px; margin-left: 4px; border-radius: 4px;
  background: var(--cyan); color: #fff;
}

/* ── History panel ────────────────────────────────────────────────────── */
.history-panel {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}

.history-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.history-hdr span {
  font-size: 10px; font-weight: 800; color: var(--cyan-d);
  letter-spacing: 1.6px; text-transform: uppercase;
}

.history-list {
  flex: 1; overflow-y: auto; padding: 8px;
}

.history-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 22px 10px; }

.hist-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px; padding: 10px;
  cursor: pointer; transition: all .15s;
}
.hist-card:hover {
  background: var(--surface2);
  border-color: var(--cyan);
  transform: translateX(-2px);
}

.hist-title-row {
  display: flex; align-items: center; gap: 4px; margin-bottom: 3px;
}
.hist-title {
  flex: 1; font-size: 12px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hist-type {
  font-size: 9px; font-weight: 800; padding: 1px 5px;
  background: var(--cyan); color: #fff;
  border-radius: 4px;
}
.hist-play {
  flex-shrink: 0; width: 24px; height: 22px; font-size: 10px;
  background: var(--surface2); color: var(--cyan-d);
  border: 1px solid var(--border); border-radius: 5px; cursor: pointer;
  transition: all 0.15s;
}
.hist-play:hover { background: var(--cyan); color: #fff; border-color: var(--cyan-d); }

.hist-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }

.hist-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 700;
}
.chip-Suggested { background: rgba(59,130,246,0.14);  color: var(--cyan-d); }
.chip-Trailer   { background: rgba(59,130,246,0.10);  color: var(--cyan-d); }
.chip-Watchlist { background: rgba(63,125,95,0.16);   color: var(--lime-d); }
.chip-Watched   { background: rgba(63,125,95,0.22);   color: var(--lime-d); }
.chip-Disliked  { background: rgba(196,101,63,0.16);  color: var(--rust); }

/* ── API key modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(36,48,63,.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface); border: 2px solid var(--cyan);
  border-radius: var(--radius); padding: 30px 36px; width: 480px; max-width: 95vw;
  box-shadow: 0 24px 60px -16px rgba(36,48,63,0.35);
}
.modal h2 {
  font-size: 20px; color: var(--cyan-d); margin-bottom: 22px;
  text-align: center; font-weight: 800; letter-spacing: 0.8px;
}
.modal-field { margin-bottom: 16px; }
.modal-field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.modal-field label a { color: var(--cyan-d); text-decoration: none; }
.modal-field label a:hover { text-decoration: underline; }
.modal-field .hint  { font-size: 11px; color: var(--muted); margin-top: 4px; }
.modal-field .hint a { color: var(--cyan-d); text-decoration: none; }
.modal-field .hint a:hover { text-decoration: underline; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-modal-save {
  flex: 1; padding: 11px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-d));
  color: #fff;
  font-weight: 800; border: 2px solid #fff; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px;
  box-shadow: var(--shadow-cyan);
  letter-spacing: 0.3px;
}
.btn-modal-save:hover { filter: brightness(1.06); }
.btn-modal-cancel {
  padding: 11px 20px; background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 14px;
}
.btn-modal-cancel:hover { background: #fff; }
.modal-status { font-size: 12px; color: var(--rust); text-align: center; margin-top: 10px; min-height: 18px; }

/* ── Loading spinner ──────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 22px; height: 22px; border: 3px solid var(--surface2);
  border-top-color: var(--cyan); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block; vertical-align: middle;
}

/* ── Hint text ────────────────────────────────────────────────────────── */
.hint-text { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* ── Mobile toggle button (hidden on desktop) ─────────────────────────── */
.btn-filters-toggle { display: none; }

/* ── Mobile / responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {

  html, body {
    height: auto;
    overflow: auto;
  }

  .layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-inner {
    overflow: visible;
    padding-bottom: 14px;
  }

  .sidebar.collapsed .sidebar-inner {
    display: none;
  }

  .btn-filters-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: var(--surface2);
    color: var(--cyan-d);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .btn-filters-toggle:hover { background: #fff; border-color: var(--cyan); }

  .main-panel {
    overflow: visible;
    height: auto;
  }

  .movie-card {
    flex-direction: column;
    overflow: visible;
    padding: 14px;
    gap: 14px;
  }

  .poster-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
  }

  .poster-wrap img {
    width: 160px;
    height: 240px;
  }

  .poster-placeholder {
    width: 160px;
    height: 240px;
  }

  .info-panel {
    overflow: visible;
  }

  .info-scroll {
    overflow: visible;
    padding: 16px 16px 0;
  }

  .movie-title { font-size: 22px; }

  .action-buttons {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 14px 16px;
  }

  .action-btn {
    padding: 12px 6px;
    font-size: 12px;
  }

  .watchlist-bar { padding: 10px 12px; }
  .watchlist-hdr { gap: 6px; }

  .history-panel {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .history-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
    gap: 8px;
  }

  .hist-card {
    flex-shrink: 0;
    width: 165px;
    margin-bottom: 0;
  }
  .hist-card:hover { transform: none; }

  .status-bar { padding: 12px 14px 0; }
}
