/* ── Variables ─────────────────────────────────────────── */
/* Palette inspired by the "Ethereal Curator" (dark) and "Digital Atelier"
   (light) design specs: warm charcoal vs. parchment surfaces, dusty rose
   accents, soft lavender + peach as supporting tones. The "no pure black,
   no pure white" rule is intentional — every neutral is tinted toward warm
   to keep the editorial feel. --accent-rgb is exposed so rgba() callers
   can pick up the theme switch automatically. */
:root,
:root[data-theme="dark"] {
  --bg-primary: #0f0e0e;          /* warm charcoal surface */
  --bg-secondary: #161313;        /* surface-container-low */
  --bg-card: #1c1818;             /* surface-container */
  --bg-card-hover: #282525;       /* surface-container-highest */
  --text-primary: #ebe4e3;        /* warm off-white on-surface */
  --text-secondary: #a89c9b;      /* muted warm */
  --accent: #ecbbba;              /* dusty rose primary */
  --accent-hover: #f3cccb;        /* lighter rose for hover */
  --accent-rgb: 236, 187, 186;
  --accent-dim: rgba(236, 187, 186, 0.12);
  --secondary: #cec2d9;           /* soft lavender supporting tone */
  --tertiary: #fff1ea;            /* warm peach delight tone */
  --border: rgba(235, 228, 227, 0.08);
  --border-accent: rgba(236, 187, 186, 0.28);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.32);
  --shadow-glow: 0 0 40px rgba(236, 187, 186, 0.10);
  --hero-glow: rgba(236, 187, 186, 0.12);
}

:root[data-theme="light"] {
  --bg-primary: #faf9f6;          /* parchment surface */
  --bg-secondary: #f3eee9;        /* slightly darker parchment for layering */
  --bg-card: #ffffff;             /* highest tier — true white only as needed */
  --bg-card-hover: #f7f1ec;
  --text-primary: #2b2222;        /* warm charcoal text — never #000 */
  --text-secondary: #7b6e6e;
  --accent: #a26465;              /* deeper dusty rose for contrast on light */
  --accent-hover: #8a5253;
  --accent-rgb: 162, 100, 101;
  --accent-dim: rgba(162, 100, 101, 0.10);
  --secondary: #8b7aa3;           /* deeper lavender */
  --tertiary: #d99a7c;             /* deeper peach */
  --border: rgba(43, 34, 34, 0.10);
  --border-accent: rgba(162, 100, 101, 0.30);
  --shadow-card: 0 8px 32px rgba(43, 34, 34, 0.08);
  --shadow-glow: 0 0 40px rgba(162, 100, 101, 0.12);
  --hero-glow: rgba(162, 100, 101, 0.10);
}

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

/* ── Base ──────────────────────────────────────────────── */
body.app-shell {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
}

body.app-shell main {
  flex: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ── Layout container ──────────────────────────────────── */
.app-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.app-main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

@media (max-width: 900px) {
  .app-container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (max-width: 600px) {
  .app-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .app-main {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
  }
}

/* ── Navbar ────────────────────────────────────────────── */
.app-navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  backdrop-filter: blur(12px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.85rem 0.3rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  max-width: 220px;
}

.profile-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.95rem;
}

.profile-button-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 600px) {
  .profile-button-label {
    display: none;
  }
  .profile-button {
    padding: 0.3rem;
  }
}

.nav-logout-form {
  margin: 0;
  display: inline-flex;
}

.logout-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.logout-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.app-brand:hover {
  color: var(--accent);
}

.app-brand .brand-icon {
  font-size: 1.4rem;
  color: var(--accent);
}

.nav-user {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.nav-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-link-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-link-pill i {
  font-size: 1rem;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.theme-toggle i {
  transition: transform 0.3s;
}

.theme-toggle:hover i {
  transform: rotate(20deg);
}

/* ── Buttons ───────────────────────────────────────────── */
.btn-accent {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.5rem;
  transition: all 0.2s;
}

.btn-accent:hover {
  background: var(--accent-hover);
  color: var(--bg-primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.25);
}

.btn-accent:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.5rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-ghost-sm {
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
}

/* ── Cards ─────────────────────────────────────────────── */
.hero-panel,
.form-card,
.info-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

/* ── Page primitives ───────────────────────────────────── */
.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.page-lede {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
  max-width: 640px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i {
  color: var(--accent);
}

/* ── Hero / Home ───────────────────────────────────────── */
.hero-panel {
  max-width: 580px;
  margin: 5rem auto 0;
  padding: 3.5rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: '';
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--hero-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-icon {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-cta {
  min-width: 200px;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-feature {
  text-align: center;
}

.hero-feature i {
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  display: block;
}

.hero-feature span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Dashboard ─────────────────────────────────────────── */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-hero .page-title {
  font-size: 2.4rem;
}

.dashboard-cta {
  white-space: nowrap;
}

.dashboard-section {
  display: block;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.info-tile {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s;
}

.info-tile:hover {
  border-color: var(--border-accent);
}

.info-tile h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.info-tile p {
  color: var(--text-primary);
  font-size: 1rem;
}

.genre-pill {
  display: inline-block;
  margin: 0 0.5rem 0.5rem 0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border-accent);
}

/* ── Forms ──────────────────────────────────────────────── */
.form-card {
  max-width: 480px;
  margin: 0 auto;
}

.form-card--wide {
  max-width: 720px;
}

.form-card--split {
  max-width: 960px;
}

.form-card--split .form-card-header {
  margin-bottom: 1.75rem;
}

.form-card--split .form-card-col {
  display: flex;
  flex-direction: column;
}

.form-card--split .form-card-footer {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.form-card h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.form-card .text-secondary {
  color: var(--text-secondary) !important;
}

.form-card .form-label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.form-card .form-text {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.form-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  display: block;
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])::placeholder {
  color: var(--text-secondary);
}

.form-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-card ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.form-card a {
  color: var(--accent);
}

/* ── Genre selector ────────────────────────────────────── */
.genre-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.genre-field .form-label {
  margin-bottom: 0.85rem;
}

.genre-option {
  position: relative;
}

.genre-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 42px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.genre-choice:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.genre-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.genre-choice span {
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 500;
}

.genre-option input:checked + .genre-choice {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
}

.genre-option input:focus-visible + .genre-choice {
  outline: 3px solid var(--accent-dim);
  outline-offset: 2px;
}

.genre-option--collapsed {
  display: none !important;
}

.genre-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.genre-toggle:hover {
  border-color: var(--accent);
  border-style: solid;
  color: var(--accent);
}

.genre-toggle[aria-expanded="true"] {
  border-style: solid;
  border-color: var(--border-accent);
  color: var(--accent);
}

.genre-toggle i {
  font-size: 0.9rem;
  line-height: 1;
}

/* ── Info panels (activation, reset, etc.) ─────────────── */
.info-panel {
  max-width: 580px;
  text-align: center;
}

.info-panel h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.info-panel .text-secondary {
  color: var(--text-secondary) !important;
}

.info-panel .btn-dark {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
}

.info-panel .btn-dark:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.info-panel .btn-outline-dark {
  color: var(--text-primary);
  border-color: var(--border);
}

.info-panel .btn-outline-dark:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Alerts ────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
}

.alert-success {
  border-color: rgba(72, 187, 120, 0.3);
  background: rgba(72, 187, 120, 0.08);
  color: #68d391;
}

.alert-danger, .alert-error {
  border-color: rgba(245, 101, 101, 0.3);
  background: rgba(245, 101, 101, 0.08);
  color: #fc8181;
}

.alert-warning {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: var(--accent-dim);
  color: var(--accent);
}

.alert-info {
  border-color: rgba(99, 179, 237, 0.3);
  background: rgba(99, 179, 237, 0.08);
  color: #90cdf4;
}

/* ── Text helpers ──────────────────────────────────────── */
.text-danger {
  color: #fc8181 !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

.text-muted {
  color: var(--text-secondary) !important;
}

/* ── Footer ────────────────────────────────────────────── */
.app-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* ── Bootstrap overrides ───────────────────────────────── */
.btn-dark {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-dark:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg-primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.25);
}

.btn-dark:active {
  transform: translateY(0);
}

.btn-outline-dark {
  color: var(--text-primary);
  border-color: var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-outline-dark:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Movies catalog ────────────────────────────────────── */
.movies-section {
  width: 100%;
}

.movies-header {
  margin-bottom: 2rem;
}

.search-source {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 1.25rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.search-source i {
  color: var(--accent);
}

.search-source strong {
  color: var(--text-primary);
  font-weight: 600;
}

.movies-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.movies-search,
.movies-genre-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  min-width: 220px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.movies-search:focus,
.movies-genre-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.movie-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
}

.movie-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg-secondary);
}

.movie-card-score {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  background: rgba(var(--accent-rgb), 0.92);
  color: var(--bg-primary);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.movie-card-score i {
  font-size: 0.72rem;
}

.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.movie-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-secondary);
  font-size: 2.5rem;
}

.movie-poster-placeholder.large {
  font-size: 4rem;
  min-height: 360px;
}

.movie-card-body {
  padding: 0.85rem 1rem 1rem;
}

.movie-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.movies-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

.page-indicator {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.movies-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.movies-empty i {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

.movies-empty h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.movies-empty p {
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 1rem;
}

.movies-empty code {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.85em;
  color: var(--accent);
}

/* ── Movie detail ──────────────────────────────────────── */
.movie-detail {
  width: 100%;
  position: relative;
}

.movie-backdrop {
  height: 320px;
  background-size: cover;
  background-position: center top;
  border-radius: var(--radius-lg);
  margin-bottom: -180px;
}

.movie-detail-body {
  position: relative;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  padding: 0 1rem;
}

.movie-detail-poster img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: block;
}

.movie-detail-info {
  padding-top: 200px;
}

.movie-detail-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.25rem 0 0.5rem;
}

.movie-original-title {
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
}

.movie-detail-genres {
  margin: 1rem 0 1.5rem;
}

.movie-director {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.movie-overview {
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.movie-cast-heading {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.movie-cast-grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.cast-card {
  flex: 0 0 100px;
  text-align: center;
}

.cast-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.4rem;
}

.cast-photo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.4rem;
  font-size: 1.6rem;
  color: var(--text-tertiary);
}

.cast-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cast-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.cast-character {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.movie-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

/* ── "Coming soon" badge ───────────────────────────────── */
.soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-accent);
  white-space: nowrap;
}

.soon-badge--inline {
  align-self: flex-start;
}

/* ── Movie action buttons ──────────────────────────────── */
.movie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.movie-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.movie-action-btn i {
  font-size: 1.05rem;
  color: var(--accent);
}

.movie-action-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.movie-action-btn:disabled,
.movie-action-btn[aria-disabled="true"] {
  opacity: 0.65;
  cursor: not-allowed;
}

.movie-action-btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

.movie-action-btn--accent i {
  color: var(--bg-primary);
}

.movie-action-btn--accent:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.25);
}

.movie-action-btn--active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.movie-action-btn--active i {
  color: var(--accent);
}

.movie-action-form {
  margin: 0;
}

.movie-actions-guest {
  margin: 1.5rem 0 0.5rem;
  padding: 1.25rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.user-rating-display {
  font-size: 0.95rem;
}

/* ── Rating modal ──────────────────────────────────────── */
.rating-modal .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.rating-modal .modal-header,
.rating-modal .modal-footer {
  border-color: var(--border);
}

.rating-modal .modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rating-modal .modal-title i {
  color: var(--accent);
}

.rating-modal-movie {
  color: var(--text-secondary);
  font-weight: 500;
}

.btn-close-custom {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-close-custom:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.rating-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Star input — uses reverse flex so hover/checked siblings light up to the
   right. Each star is split into two labels (.rating-half = left,
   .rating-full = right) for half-star precision. Both halves render the
   full star icon but clip to 50% width; the full label shifts the icon left
   so only the right portion is visible. */
.rating-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0;
  border: none;
  padding: 0;
  margin: 0;
}

.rating-stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating-stars label {
  cursor: pointer;
  font-size: 1.85rem;
  color: var(--border);
  transition: color 0.15s;
  line-height: 1;
  display: inline-block;
  width: 0.5em;
  overflow: hidden;
}

.rating-stars label i {
  display: inline-block;
}

/* Right half of star: shift icon left so only right portion shows */
.rating-stars .rating-full i {
  margin-left: -0.5em;
}

/* Left half of star: add inter-star gap before each star group */
.rating-stars .rating-half {
  margin-left: 0.15rem;
}

.rating-stars label:hover,
.rating-stars label:hover ~ label,
.rating-stars input:checked ~ label {
  color: var(--accent);
}

.rating-stars input:focus-visible + label {
  outline: 2px solid var(--accent-dim);
  outline-offset: 4px;
  border-radius: 4px;
}

.rating-comment-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.rating-comment {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rating-comment:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.rating-comment::placeholder {
  color: var(--text-secondary);
}

.rating-soon-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.85rem;
}

/* ── Comments section ──────────────────────────────────── */
.comments-section {
  margin: 3rem 1rem 0;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.comments-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.comments-header h2 i {
  color: var(--accent);
}

.comments-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.comment-composer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.comment-composer textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-composer textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.comment-composer textarea:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.comment-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.comment-composer--guest {
  text-align: center;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-item {
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.comment-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-date {
  color: var(--text-secondary);
}

.comment-body {
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

.comment-delete-form {
  margin: 0.5rem 0 0;
  display: flex;
  justify-content: flex-end;
}

.comment-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  list-style: none;
}

.comment-empty i {
  display: block;
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.comment-empty p {
  margin: 0;
}

/* ── Profile activity tabs ─────────────────────────────── */
.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.profile-tab {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-tab i {
  font-size: 1rem;
}

.profile-tab:hover:not(.is-active) {
  color: var(--text-primary);
  background: var(--bg-card);
}

.profile-tab.is-active {
  background: var(--bg-card);
  border-color: var(--border-accent);
  color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.profile-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
}

.profile-tab.is-active .profile-tab-count {
  background: var(--accent-dim);
  border-color: var(--border-accent);
  color: var(--accent);
}

.profile-tab-panel {
  animation: fadeIn 0.2s ease-out;
}

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

.activity-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.activity-empty i {
  display: block;
  font-size: 2.25rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.activity-empty h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.activity-empty p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin: 0;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Recommendation cards ──────────────────────────────── */
.recommendation-grid {
  /* Horizontal scrolling row: always a single line of cards regardless of
     viewport width, so we never get an awkward partial second row. Inspired
     by the Netflix/Spotify "browse more" strip pattern — when the row can't
     fit all the cards, the user scrolls horizontally instead of seeing them
     wrap. Scroll-snap keeps the alignment clean after a swipe. */
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0.25rem;
  /* Breathing room for the bottom scrollbar so it doesn't hug the cards. */
  padding-bottom: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.recommendation-grid::-webkit-scrollbar {
  height: 8px;
}

.recommendation-grid::-webkit-scrollbar-track {
  background: transparent;
}

.recommendation-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.recommendation-grid::-webkit-scrollbar-thumb:hover {
  background: var(--border-accent);
}

.recommendation-grid > .movie-card {
  /* Fixed card width inside the horizontal scroll strip so cards don't
     compress; overflow is handled by the parent's overflow-x. */
  flex: 0 0 175px;
  scroll-snap-align: start;
}

.recommendation-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 175px;
  scroll-snap-align: start;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s, border-color 0.2s;
}

.recommendation-card:hover:not(.recommendation-card--placeholder) {
  transform: translateY(-3px);
  border-color: var(--border-accent);
}

.recommendation-poster {
  aspect-ratio: 2 / 3;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.75rem;
  overflow: hidden;
}

.recommendation-body {
  padding: 0.75rem 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.recommendation-card--placeholder {
  opacity: 0.6;
}

.placeholder-line {
  height: 8px;
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    var(--bg-card-hover) 50%,
    var(--bg-card) 100%
  );
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.6s ease-in-out infinite;
}

.placeholder-line--title {
  height: 12px;
  width: 85%;
}

.placeholder-line--meta {
  width: 65%;
}

.placeholder-line--meta.short {
  width: 40%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Profile page ──────────────────────────────────────── */
.profile-page {
  max-width: 1100px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.profile-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
}

.profile-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.profile-block-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.profile-block-head h2 i {
  color: var(--accent);
}

.profile-dl {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
}

.profile-dl > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.profile-dl dt {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.profile-dl dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.profile-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-genres .genre-pill {
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.status-pill--ok {
  color: #68d391;
  border-color: rgba(72, 187, 120, 0.3);
  background: rgba(72, 187, 120, 0.08);
}

.status-pill--warn {
  color: var(--accent);
  border-color: var(--border-accent);
  background: var(--accent-dim);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero-panel {
    margin-top: 2rem;
    padding: 2rem 1.5rem;
  }

  .hero-features {
    flex-direction: column;
    gap: 1rem;
  }

  .form-card,
  .info-panel {
    padding: 1.5rem;
    border-radius: var(--radius-md);
  }

  .form-card--split .form-card-footer {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
  }

  .page-title {
    font-size: 1.6rem;
  }

  .dashboard-hero .page-title {
    font-size: 1.85rem;
  }

  .dashboard {
    gap: 2rem;
  }

  .profile-grid {
    grid-template-columns: 1fr !important;
  }

  .genre-grid {
    gap: 0.5rem;
  }

  .genre-choice {
    min-width: 90px;
    padding: 0.5rem 0.75rem;
  }

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

  .movie-detail-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .movie-detail-poster {
    max-width: 220px;
    margin: 0 auto;
  }

  .movie-detail-info {
    padding-top: 1rem;
  }

  .movie-backdrop {
    height: 200px;
    margin-bottom: -120px;
  }

  .movie-detail-title {
    font-size: 1.75rem;
  }

  .nav-link-pill-label {
    display: none;
  }

  .movie-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .movie-action-btn {
    justify-content: center;
  }

  .comments-section {
    padding: 1.25rem;
    margin: 2rem 0 0;
  }

  .profile-tabs {
    flex-direction: column;
  }

  .profile-tab {
    justify-content: flex-start;
  }

  .recommendation-grid > .movie-card,
  .recommendation-card {
    /* Slightly slimmer cards on mobile so a couple peek into view at once,
       hinting that the row scrolls. */
    flex-basis: 145px;
  }
}

/* ── Bug report floating button ─────────────────────────── */
.bug-report-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  height: 3.25rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-accent);
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  cursor: pointer;
  z-index: 1050;
  transition: background 0.2s ease, transform 0.15s ease;
}

.bug-report-fab-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bug-report-fab-label {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  padding-left: 0;
  transition: max-width 0.25s ease, opacity 0.2s ease, padding-left 0.25s ease;
}

.bug-report-fab:hover,
.bug-report-fab:focus-visible {
  background: var(--accent-hover);
  transform: translateY(-2px);
  outline: none;
}

.bug-report-fab:hover .bug-report-fab-label,
.bug-report-fab:focus-visible .bug-report-fab-label {
  max-width: 12rem;
  opacity: 1;
  padding-left: 1rem;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

