/* ============================================================
   CLUBHUIS MOVIE NIGHT — Themed Poll
   Three visual themes (Kallisti Light → Kallisti Dark → Cyberpunk)
   communicate tone through atmosphere, not labels.

   Color palettes lifted from Kallisti Case Manager themes.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================================
   SHARED TOKENS
   ============================================================ */
:root {
  --radius: 3px;
  --radius-lg: 5px;
  --transition: 0.3s ease;
}

/* ============================================================
   THEME: LANDING (Kallisti Brand — neutral dark)
   ============================================================ */
body {
  --bg: #060e17;
  --s1: #0a1520;
  --s2: #0D1B2A;
  --s3: #111f30;
  --border: rgba(196,168,130,0.10);
  --accent: #C4A882;
  --accent-d: rgba(196,168,130,0.10);
  --accent-b: rgba(196,168,130,0.30);
  --text: rgba(255,255,255,0.85);
  --dim: rgba(255,255,255,0.55);
  --dim2: rgba(255,255,255,0.22);
  --green: #4ecb8b;
  --red: #ff5555;
}

/* ---- THEME: LIGHT SIDE (Kallisti Light) ---- */
.theme-light {
  --bg: #f2f2f0;
  --s1: #e8e8e6;
  --s2: #deded9;
  --s3: #d4d4ce;
  --border: rgba(0,0,0,0.11);
  --accent: #1a6e47;
  --accent-d: rgba(26,110,71,0.09);
  --accent-b: rgba(26,110,71,0.26);
  --accent2: #1a5fb4;
  --text: rgba(0,0,0,0.90);
  --dim: rgba(0,0,0,0.70);
  --dim2: rgba(0,0,0,0.50);
  --green: #1a6e47;
  --red: #b91c1c;
  --card-selected-border: var(--accent);
  --card-selected-glow: rgba(26,110,71,0.20);
  --card-selected-bg: rgba(26,110,71,0.06);
  --check-bg: var(--accent);
  --check-fg: #ffffff;
}

/* ---- THEME: DARK SIDE (Kallisti Brand/Dark) ---- */
.theme-dark {
  --bg: #060e17;
  --s1: #0a1520;
  --s2: #0D1B2A;
  --s3: #111f30;
  --border: rgba(196,168,130,0.10);
  --accent: #C4A882;
  --accent-d: rgba(196,168,130,0.10);
  --accent-b: rgba(196,168,130,0.30);
  --accent2: #4A9EE0;
  --text: rgba(255,255,255,0.85);
  --dim: rgba(255,255,255,0.55);
  --dim2: rgba(255,255,255,0.22);
  --green: #4ecb8b;
  --red: #ff5555;
  --card-selected-border: var(--accent);
  --card-selected-glow: rgba(196,168,130,0.25);
  --card-selected-bg: rgba(196,168,130,0.08);
  --check-bg: var(--accent);
  --check-fg: #060e17;
}

/* ---- THEME: WILD SIDE (Cyberpunk) ---- */
.theme-wild {
  --bg: #272932;
  --s1: #1c1e26;
  --s2: #31333d;
  --s3: #3a3d49;
  --border: rgba(255,255,255,0.07);
  --accent: #F5E400;
  --accent-d: rgba(245,228,0,0.12);
  --accent-b: rgba(245,228,0,0.36);
  --accent2: #E4002B;
  --text: #f2f2f5;
  --dim: rgba(242,242,245,0.65);
  --dim2: rgba(242,242,245,0.40);
  --green: #1AC5B0;
  --red: #FF3B4E;
  --amber: #37EBF3;
  --card-selected-border: var(--accent);
  --card-selected-glow: rgba(245,228,0,0.30);
  --card-selected-bg: rgba(245,228,0,0.06);
  --check-bg: var(--accent);
  --check-fg: #1c1e26;
  /* Chromatic aberration extras */
  --cyber-cyan: #37EBF3;
  --cyber-red: #E4002B;
  --cyber-yellow: #F5E400;
}

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

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

/* ============================================================
   HERO / LANDING
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.logo {
  width: min(62vw, 280px);
  aspect-ratio: 1;
  border-radius: 50%;  /* logo.svg is gold on #060e17 (landing --bg) */
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.next-up {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.75rem;
}

.next-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

.next-date {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.next-close {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid var(--accent-b);
  background: var(--accent-d);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-top: 0.3rem;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 1rem 2rem;
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background var(--transition);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--dim2);
  transition: all 0.3s;
}

.progress-step .step-label { display: none; }
@media (min-width: 640px) { .progress-step .step-label { display: inline; } }

.progress-step.current {
  color: var(--text);
  background: var(--s2);
  border: 1px solid var(--border);
}

.progress-step.done { color: var(--accent); }

.progress-connector {
  width: 3rem;
  height: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.progress-connector.done { background: var(--accent); }

/* ============================================================
   STEP CONTAINERS
   ============================================================ */
.step { animation: fadeIn 0.45s ease; }

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

.step-header {
  text-align: center;
  padding: 2.5rem 2rem 1.5rem;
}

.step-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.pick-hint {
  color: var(--dim);
  font-size: 0.9rem;
  margin: -0.35rem 0 0.9rem;
}

.selection-hint {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 2rem;
  font-size: 0.78rem;
  color: var(--dim);
  font-family: 'IBM Plex Mono', monospace;
}

.selection-count { color: var(--accent); font-weight: 600; }

/* ============================================================
   MOVIE GRID
   ============================================================ */
.movie-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ============================================================
   MOVIE CARD
   ============================================================ */
.movie-card {
  display: flex;
  background: var(--s1);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  user-select: none;
}

.movie-card:hover {
  border-color: var(--dim2);
  background: var(--s2);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

/* ---- Selected state ---- */
.movie-card.selected {
  border-color: var(--card-selected-border, var(--accent));
  box-shadow: 0 0 16px var(--card-selected-glow, rgba(196,168,130,0.2)), 0 4px 20px rgba(0,0,0,0.3);
  background: var(--card-selected-bg, var(--s2));
}

/* Cyberpunk chromatic aberration on selected wild cards */
.theme-wild .movie-card.selected {
  box-shadow:
    -3px 0 12px rgba(228,0,43,0.30),
     3px 0 12px rgba(55,235,243,0.30),
     0 0 20px var(--card-selected-glow),
     0 4px 20px rgba(0,0,0,0.3);
  animation: chromatic-pulse 2.5s ease-in-out infinite;
}

@keyframes chromatic-pulse {
  0%, 100% {
    box-shadow:
      -3px 0 12px rgba(228,0,43,0.30),
       3px 0 12px rgba(55,235,243,0.30),
       0 0 20px rgba(245,228,0,0.20),
       0 4px 20px rgba(0,0,0,0.3);
  }
  50% {
    box-shadow:
      -5px 0 18px rgba(228,0,43,0.45),
       5px 0 18px rgba(55,235,243,0.45),
       0 0 28px rgba(245,228,0,0.30),
       0 4px 20px rgba(0,0,0,0.3);
  }
}

/* ---- Checkbox ---- */
.card-checkbox {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--dim2);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}

.card-checkbox svg {
  width: 13px;
  height: 13px;
  opacity: 0;
  transition: opacity 0.2s;
}

.movie-card.selected .card-checkbox {
  border-color: transparent;
  background: var(--check-bg, var(--accent));
}

.movie-card.selected .card-checkbox svg {
  opacity: 1;
  color: var(--check-fg, #fff);
}

/* ---- Poster ---- */
.movie-poster {
  width: 140px;
  min-height: 210px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--s2);
}

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

.poster-placeholder {
  width: 100%;
  height: 100%;
  min-height: 210px;
  display: flex;
  align-items: flex-end;
  padding: 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.3;
  color: rgba(255,255,255,0.75);
  background: linear-gradient(160deg, var(--s2), var(--s3));
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ---- Card info ---- */
.movie-info {
  flex: 1;
  padding: 1rem 1rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.movie-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  padding-right: 2rem;
  color: var(--text);
}

.movie-year {
  display: inline-block;
  color: var(--dim);
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 0.1rem;
  font-family: 'IBM Plex Mono', monospace;
}

.movie-summary {
  color: var(--dim);
  font-size: 0.85rem;
  line-height: 1.6;
  flex: 1;
  margin-top: 0.5rem;
}

.movie-note {
  font-size: 0.78rem;
  color: var(--dim2);
  font-style: italic;
  margin-top: 0.3rem;
}

.movie-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--s2);
  color: var(--text);
  border-color: var(--dim2);
}

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

.btn-primary:hover {
  filter: brightness(1.1);
  color: var(--bg);
}

.btn-lg {
  padding: 0.8rem 2.2rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-submit {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.btn-submit:hover {
  filter: brightness(1.1);
  color: #fff;
}

.btn-trailer {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

.btn-trailer:hover {
  background: var(--accent);
  color: var(--bg);
  filter: brightness(1.12);
}

.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 1.25rem 2rem 2.5rem;
}

/* ============================================================
   RESULTS
   ============================================================ */
.thank-you {
  text-align: center;
  padding: 3rem 2rem 1rem;
}

.thank-you h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.thank-you p { color: var(--dim); font-size: 1rem; }

.results-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem 2rem 2rem;
}

.results-container h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}

.result-title {
  width: 220px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  color: var(--dim);
}

.result-bar-container {
  flex: 1;
  height: 22px;
  background: var(--s2);
  border-radius: 2px;
  overflow: hidden;
}

.result-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2, var(--accent)));
}

.result-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dim);
  min-width: 24px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'IBM Plex Mono', monospace;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--s1);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: none;
}

.toast.show    { transform: translateX(-50%) translateY(0); }
.toast.error   { border-color: var(--red); }
.toast.success { border-color: var(--green); }
.toast.info    { border-color: var(--accent); }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .movie-card { flex-direction: column; }
  .movie-poster { width: 100%; min-height: 0; }
  .movie-poster img { height: auto; }
  .poster-placeholder { min-height: 200px; }
  .movie-info { padding: 0.85rem; }
  .movie-title { font-size: 0.95rem; }
  .step-header h2 { font-size: 1.4rem; }
  .result-title { width: 120px; font-size: 0.78rem; }
  .step-nav { padding: 1rem 1rem 2rem; }
  .movie-grid { padding: 0 1rem; }
}

@media (max-width: 480px) {
  .step-header { padding: 1.5rem 1rem 1rem; }
  .progress-bar { padding: 0.75rem; }
  .result-title { width: 90px; }
  .btn-lg { padding: 0.65rem 1.5rem; font-size: 0.9rem; }
}
