/* =========================================================================
   CINEFIND — DESIGN SYSTEM
   A dark, cinematic movie-discovery UI.
   Display face: Bebas Neue (marquee/poster energy, used with restraint)
   Body face:    Inter (clean, high legibility)
   Accent:       Marquee gold — evokes film reels & awards, not neon.
   ========================================================================= */

:root {
  /* ---- Color system ---- */
  --bg: #070707;
  --bg-secondary: #101010;
  --card: #151515;
  --card-hover: #1c1c1c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #ffffff;
  --text-secondary: #a5a5a5;
  --text-muted: #6f6f6f;

  --accent: #e8b34d;         /* marquee gold */
  --accent-hover: #f3c669;
  --accent-dim: rgba(232, 179, 77, 0.14);
  --accent-text: #1a1305;

  --success: #6fcf97;
  --danger: #e0625a;

  /* ---- Elevation ---- */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);

  /* ---- Radius ---- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* ---- Layout ---- */
  --nav-h: 68px;
  --container-w: 1400px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-med: 280ms;
  --t-slow: 500ms;

  /* ---- Type ---- */
  --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select {
  font-family: inherit;
  color: var(--text-primary);
}

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

::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-text);
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* =========================================================================
   CONFIG BANNER
   ========================================================================= */
.config-banner {
  background: linear-gradient(90deg, #3a2a08, #241a05);
  border-bottom: 1px solid rgba(232, 179, 77, 0.3);
  color: #f3d999;
  font-size: 13px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  position: relative;
  z-index: 500;
}
.config-banner code {
  background: rgba(0,0,0,0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.config-banner button { color: #f3d999; font-size: 16px; flex-shrink: 0; }

/* =========================================================================
   NAVBAR
   ========================================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(7, 7, 7, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 24px;
}

.logo {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--text-primary);
  flex-shrink: 0;
  transition: color var(--t-fast) var(--ease);
}
.logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--text-primary); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.country-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  white-space: nowrap;
}
.country-pill:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.06); }
.country-pill-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.chevron { color: var(--text-muted); font-size: 11px; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-primary);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); }
.icon-btn:active { transform: scale(0.92); }

.nav-burger { display: none; }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-strong); }
.btn-danger { background: rgba(224,98,90,0.15); color: #f0958d; }
.btn-danger:hover { background: rgba(224,98,90,0.25); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn svg { flex-shrink: 0; }

/* =========================================================================
   LAYOUT HELPERS
   ========================================================================= */
.page-container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-heading { margin-bottom: 28px; }
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.page-heading h1 {
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1.05;
}
.page-subtitle { color: var(--text-secondary); margin: 8px 0 0; font-size: 15px; }

.view { min-height: 60vh; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  position: relative;
  height: 82vh;
  min-height: 480px;
  max-height: 780px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg-secondary);
}

.hero-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, #0d0d0d 30%, #161616 50%, #0d0d0d 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity var(--t-slow) var(--ease), transform 6s var(--ease);
}
.hero-bg.loaded { opacity: 1; transform: scale(1); }

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7,7,7,0.15) 0%, rgba(7,7,7,0.35) 45%, var(--bg) 96%),
    linear-gradient(90deg, rgba(7,7,7,0.92) 0%, rgba(7,7,7,0.55) 35%, rgba(7,7,7,0.05) 70%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--container-w);
  margin: 0 auto;
  width: 100%;
  padding: 0 24px 64px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0.5px;
  max-width: 720px;
  margin: 0 0 14px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero-overview {
  max-width: 560px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 26px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}
.rating-badge .star { font-size: 13px; }
.rating-badge.nr { color: var(--text-muted); }

/* =========================================================================
   MOVIE ROWS
   ========================================================================= */
.movie-row-section { margin-bottom: 44px; }

.row-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.row-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.5px;
  margin: 0;
}
.row-see-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.row-see-all:hover { color: var(--accent); }

.movie-row-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 16px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.movie-row-scroll::-webkit-scrollbar { height: 6px; }

.movie-row-scroll .movie-card,
.movie-row-scroll .skeleton-card {
  flex: 0 0 170px;
  scroll-snap-align: start;
}

/* =========================================================================
   MOVIE GRID (discover / search / genre / watchlist)
   ========================================================================= */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

/* =========================================================================
   MOVIE CARD
   ========================================================================= */
.movie-card {
  position: relative;
  background: var(--card);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
  border: 1px solid var(--border);
}
.movie-card:hover, .movie-card:focus-within {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
  z-index: 3;
}

.movie-card-poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--bg-secondary);
  overflow: hidden;
}
.movie-card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}
.movie-card:hover .movie-card-poster { transform: scale(1.06); }

.movie-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
  padding-bottom: 12px;
}
.movie-card:hover .movie-card-overlay,
.movie-card:focus-within .movie-card-overlay { opacity: 1; }

.movie-card-view-btn {
  background: var(--accent);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  transform: translateY(6px);
  transition: transform var(--t-fast) var(--ease);
}
.movie-card:hover .movie-card-view-btn { transform: translateY(0); }

.watchlist-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(7,7,7,0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  z-index: 2;
}
.watchlist-toggle:hover { background: rgba(0,0,0,0.85); transform: scale(1.1); }
.watchlist-toggle.active { color: var(--accent); }
.watchlist-toggle:active { transform: scale(0.85); }

.movie-card-body { padding: 12px 12px 14px; }
.movie-card-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.movie-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  background: linear-gradient(160deg, #161616, #0e0e0e);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
  padding: 12px;
}
.poster-placeholder svg { opacity: 0.5; }

/* =========================================================================
   SKELETON LOADERS
   ========================================================================= */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
}
.skeleton-poster {
  aspect-ratio: 2 / 3;
  background: linear-gradient(110deg, #151515 30%, #1e1e1e 50%, #151515 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.skeleton-lines { padding: 12px; }
.skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(110deg, #151515 30%, #1e1e1e 50%, #151515 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  margin-bottom: 8px;
}
.skeleton-line.short { width: 50%; }

/* =========================================================================
   FILTER PANEL (Discover)
   ========================================================================= */
.filter-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 32px;
}
.filter-group { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 160px; }
.filter-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.filter-row {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.year-range { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.year-range input { width: 90px; }

.select-input, .year-range input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--t-fast) var(--ease);
}
.select-input:focus, .year-range input:focus { border-color: var(--accent); }
.select-input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a5a5a5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.select-input option {
  background: var(--card);
  color: var(--text-primary);
}
.select-input option:checked,
.select-input option:hover,
.select-input option:focus {
  background: var(--accent);
  color: var(--accent-text);
}

.filter-actions { display: flex; gap: 12px; margin-top: 24px; }

.load-more-wrap { display: flex; justify-content: center; margin-top: 32px; }

/* =========================================================================
   GENRES PAGE
   ========================================================================= */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.genre-tile {
  position: relative;
  height: 140px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--card), #0c0c0c);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.genre-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, var(--accent-dim), transparent 60%);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.genre-tile:hover { transform: translateY(-4px); border-color: var(--accent); }
.genre-tile:hover::before { opacity: 1; }
.genre-tile span { position: relative; z-index: 1; }

/* =========================================================================
   EMPTY / ERROR STATES
   ========================================================================= */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto;
}
.empty-icon { font-size: 44px; margin-bottom: 16px; }
.empty-state h3 { color: var(--text-primary); font-size: 20px; margin: 0 0 8px; }
.empty-state p { margin: 0 0 20px; font-size: 14px; line-height: 1.6; }

/* =========================================================================
   SEARCH OVERLAY
   ========================================================================= */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(7,7,7,0.97);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  overflow-y: auto;
  animation: fadeIn var(--t-med) var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.search-overlay-inner {
  width: 100%;
  max-width: 720px;
  padding: 90px 24px 40px;
  position: relative;
}

.search-close { position: absolute; top: 24px; right: 24px; }

.search-overlay-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.5px;
  text-align: center;
  margin: 0 0 28px;
  color: var(--text-secondary);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 14px 22px;
  transition: border-color var(--t-fast) var(--ease);
}
.search-form:focus-within { border-color: var(--accent); }
.search-form svg { color: var(--text-muted); flex-shrink: 0; }
.search-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 17px;
  color: var(--text-primary);
}
.search-form input::placeholder { color: var(--text-muted); }
.search-clear { color: var(--text-muted); font-size: 15px; }
.search-clear:hover { color: var(--text-primary); }

.autocomplete-list {
  margin-top: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  transition: background var(--t-fast) var(--ease);
  border-bottom: 1px solid var(--border);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.highlighted { background: rgba(255,255,255,0.06); }
.autocomplete-thumb {
  width: 40px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--card);
  flex-shrink: 0;
}
.autocomplete-info { flex: 1; min-width: 0; }
.autocomplete-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.autocomplete-year { font-size: 12px; color: var(--text-muted); }
.autocomplete-loading { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

.recent-searches { margin-top: 32px; }
.recent-searches-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.recent-searches h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin: 0; }
.recent-searches-clear { font-size: 12px; color: var(--text-muted); }
.recent-searches-clear:hover { color: var(--accent); }
.recent-chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-chip {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.recent-chip:hover { color: var(--text-primary); border-color: var(--border-strong); }
.recent-chip svg { opacity: 0.5; }

/* =========================================================================
   MODALS (Country Selector)
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 90px 20px 20px;
  animation: fadeIn var(--t-fast) var(--ease);
}

.modal {
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn var(--t-med) var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
}
.modal-header h2 { font-size: 18px; margin: 0; font-family: var(--font-body); font-weight: 700; }

.country-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 16px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.country-search svg { color: var(--text-muted); flex-shrink: 0; }
.country-search input { flex: 1; background: transparent; border: none; outline: none; font-size: 14px; }

.country-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 12px;
  overflow-y: auto;
}
.country-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  transition: background var(--t-fast) var(--ease);
}
.country-item:hover { background: rgba(255,255,255,0.06); }
.country-item.selected { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.country-item .flag { font-size: 18px; }
.country-item .check { margin-left: auto; color: var(--accent); }
.country-empty { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; }

/* =========================================================================
   MOVIE DETAILS PAGE
   ========================================================================= */
.detail-backdrop {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  background: var(--bg-secondary);
  overflow: hidden;
}
.detail-backdrop-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 15%;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}
.detail-backdrop-img.loaded { opacity: 1; }
.detail-backdrop-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7,7,7,0.2) 0%, rgba(7,7,7,0.55) 60%, var(--bg) 100%),
    linear-gradient(90deg, rgba(7,7,7,0.85) 0%, rgba(7,7,7,0.2) 55%);
}

.detail-content {
  position: relative;
  z-index: 2;
  max-width: var(--container-w);
  margin: 0 auto;
  width: 100%;
  padding: 60px 24px 40px;
  display: flex;
  gap: 32px;
  align-items: flex-end;
}

.detail-poster {
  width: 220px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  aspect-ratio: 2/3;
  background: var(--card);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { flex: 1; min-width: 0; padding-bottom: 4px; }
.detail-tagline { color: var(--text-muted); font-style: italic; font-size: 14px; margin: 0 0 10px; }
.detail-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: 0.5px;
  line-height: 1;
  margin: 0 0 6px;
}
.detail-original-title { color: var(--text-muted); font-size: 14px; margin: 0 0 14px; }

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}
.detail-meta-row .dot { color: var(--text-muted); }

.genre-tag-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.genre-tag {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.detail-overview {
  max-width: 640px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 24px;
}

.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.detail-body {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Person (actor) bio page */
.person-hero {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding-top: 8px;
  margin-bottom: 40px;
}
.person-photo {
  width: 220px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  aspect-ratio: 2/3;
  background: var(--card);
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-death { color: var(--text-muted); font-size: 14px; margin: -8px 0 16px; }
.person-bio { margin-top: 8px; }
.person-bio-text { white-space: pre-line; margin-bottom: 0; }

@media (max-width: 640px) {
  .person-hero { flex-direction: column; align-items: center; text-align: center; }
  .person-hero .detail-meta-row { justify-content: center; }
  .person-photo { width: 180px; }
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  margin: 40px 0;
}
.info-item .info-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 700;
}
.info-item .info-value { font-size: 14.5px; color: var(--text-primary); font-weight: 500; }

.section-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.5px;
  margin: 0 0 18px;
}

/* Cast */
.cast-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 16px;
}
.cast-card { flex: 0 0 130px; text-align: center; display: block; color: inherit; text-decoration: none; cursor: pointer; }
.cast-card:hover .cast-photo-wrap { border-color: var(--accent); }
.cast-card:hover .cast-name { color: var(--accent); }
.cast-photo-wrap {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  transition: border-color var(--t-fast) var(--ease);
}
.cast-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.cast-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--text-muted);
  background: linear-gradient(160deg, #1a1a1a, #0e0e0e);
}
.cast-name { font-size: 13.5px; font-weight: 600; margin: 0 0 2px; transition: color var(--t-fast) var(--ease); }
.cast-character { font-size: 12px; color: var(--text-muted); }

/* Trailer */
.trailer-wrap {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16/9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.trailer-wrap iframe { width: 100%; height: 100%; border: none; }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.gallery-thumb {
  aspect-ratio: 16/9;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.gallery-thumb:hover { transform: scale(1.03); border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Where to Watch */
.wtw-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
}
.wtw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.wtw-country-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
}
.wtw-category { margin-bottom: 22px; }
.wtw-category:last-child { margin-bottom: 0; }
.wtw-category-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 12px;
}
.provider-group { display: flex; flex-wrap: wrap; gap: 12px; }
.provider-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.provider-card:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.07); }
.provider-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
}
.provider-name { font-size: 13.5px; font-weight: 600; }
.wtw-empty { color: var(--text-secondary); font-size: 14px; padding: 8px 0; }
.wtw-link { display: inline-block; margin-top: 16px; font-size: 12.5px; color: var(--text-muted); }
.wtw-link a { color: var(--accent); }

/* =========================================================================
   TOASTS
   ========================================================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #1c1c1c;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  animation: toastIn var(--t-med) var(--ease);
}
.toast.leaving { animation: toastOut var(--t-fast) var(--ease) forwards; }
.toast .toast-icon { color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* =========================================================================
   LIGHTBOX
   ========================================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--t-fast) var(--ease);
}
.lightbox img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 6px; }
.lightbox-close { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.08); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  font-size: 26px;
  width: 48px;
  height: 48px;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
  font-size: 13px;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}
.footer-brand { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 8px; }
.footer p { margin: 4px 0; font-size: 12.5px; }
.footer-attribution { max-width: 480px; margin: 4px auto; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1180px) {
  .movie-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(7,7,7,0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: all var(--t-fast) var(--ease);
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 16px; text-align: left; border-radius: var(--r-sm); }
  .nav-burger { display: flex; }
  .country-pill-name { display: none; }
  .genre-grid { grid-template-columns: repeat(2, 1fr); }
  .movie-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-content { flex-direction: column; align-items: flex-start; }
  .detail-poster { width: 150px; }
  .filter-row { flex-direction: column; gap: 16px; }
}

@media (max-width: 600px) {
  .page-heading h1 { font-size: 32px; }
  .hero { height: 68vh; min-height: 420px; }
  .hero-title { font-size: 34px; }
  .hero-overview { -webkit-line-clamp: 2; }
  .movie-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .movie-row-scroll .movie-card, .movie-row-scroll .skeleton-card { flex: 0 0 130px; }
  .page-container { padding: 28px 16px 60px; }
  .search-overlay-inner { padding-top: 76px; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 20px; }
  .detail-content { padding-top: 40px; }
}