/* ============================================================
   WatchOrSkip — Design System
   Color tokens, typography, layout primitives
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #0d0a0f;
  --bg-2: #1a1419;
  --surface: #221a23;
  --surface-2: #2d2330;
  --border: rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.16);
  --text: #f5ecd9;
  --text-2: rgba(245,236,217,0.7);
  --text-3: rgba(245,236,217,0.45);
  --saffron: #ff7a1a;
  --saffron-2: #ff9540;
  --magenta: #e91e63;
  --gold: #ffc83d;
  --gold-2: #ffd966;
  --green: #2ecc71;
  --red: #ff4757;
  --teal: #00d9c0;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --gutter: 20px;
  --section-gap: 32px;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --section-gap: 56px; }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============================================================
   HEADER (with tagline beneath logo)
============================================================ */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13,10,15,0.95); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex; align-items: center; gap: 16px;
}
.brand {
  display: flex; flex-direction: column; gap: 0; flex-shrink: 0;
  text-decoration: none;
}
.brand .logo {
  font-family: var(--font-display);
  font-size: 26px; letter-spacing: 0.04em;
  background: linear-gradient(90deg, var(--saffron), var(--magenta));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: transparent;
  line-height: 0.9;
  display: block;
}
.brand .tagline {
  font-size: 9px;
  color: var(--text-3);
  font-style: italic;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-top: 4px;
  white-space: nowrap;
  display: block;
  padding-left: 2px;
}
@media (min-width: 768px) {
  .brand .logo { font-size: 30px; }
  .brand .tagline { font-size: 10px; margin-top: 5px; padding-left: 3px; }
}

.desktop-nav { display: none; gap: 4px; margin-left: 16px; }
@media (min-width: 1024px) { .desktop-nav { display: flex; } }
.desktop-nav a {
  color: var(--text-2); padding: 8px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
}
.desktop-nav a:hover { color: var(--text); background: var(--surface); }
.desktop-nav a.active { color: var(--text); }

.search-desktop {
  display: none;
  flex: 1; max-width: 380px; margin-left: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 14px;
  align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-3);
}
@media (min-width: 1024px) { .search-desktop { display: flex; } }
.search-desktop input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 13px; font-family: inherit;
}
.search-desktop .kbd {
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 10px;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (min-width: 1024px) { .header-actions { margin-left: 0; } }
.icon-btn {
  width: 40px; height: 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: 16px;
}
.icon-btn:hover { background: var(--surface-2); }
.region-pill {
  background: var(--surface); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  color: var(--text-2);
}
.search-toggle { display: flex; }
@media (min-width: 1024px) { .search-toggle { display: none; } }

/* ============================================================
   SEARCH OVERLAY
============================================================ */
.search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(13,10,15,0.97); backdrop-filter: blur(8px);
  display: none; flex-direction: column;
}
.search-overlay.active { display: flex; }
.search-overlay-head {
  padding: 16px var(--gutter);
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.search-overlay input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 18px; font-family: inherit;
}
.search-overlay-close {
  background: var(--surface); border: 1px solid var(--border);
  width: 36px; height: 36px; border-radius: 10px;
  color: var(--text); font-size: 20px;
}
.search-results {
  flex: 1; overflow-y: auto; padding: 16px var(--gutter);
  max-width: 1100px; margin: 0 auto; width: 100%;
}
.search-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-3);
}

/* Search type filter (All / Movies / TV) */
.search-types {
  display: flex; gap: 6px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  width: fit-content;
}
.search-type {
  background: transparent; color: var(--text-3);
  border: none;
  padding: 7px 14px; border-radius: 100px;
  font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background 0.15s, color 0.15s;
}
.search-type:hover { color: var(--text-2); }
.search-type.active {
  background: linear-gradient(90deg, var(--saffron), var(--magenta));
  color: #fff;
}

/* Grid utility for search result blocks */
.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
@media (min-width: 768px) {
  .search-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* Search block head — allow flex children (for "this week" pill etc) */
.search-block-head {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-3); letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

/* Search blocks (group sections inside overlay) */
.search-block { margin-bottom: 28px; }
.search-block:last-child { margin-bottom: 0; }

/* Recent search chips */
.search-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.search-chip {
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 100px;
  font-size: 12px; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.search-chip:hover { background: var(--surface-2); color: var(--text); }
.search-chip.clear-recent { color: var(--text-3); }
.search-chip.clear-recent:hover { color: var(--red); }

/* Card badges — score, pending, new */
.card-score {
  position: absolute; top: 8px; right: 8px;
  background: linear-gradient(135deg, var(--gold), var(--saffron));
  color: #1a0a00;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.card-pending {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,200,61,0.95);
  color: #1a0a00;
  font-size: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.card-new {
  position: absolute; top: 8px; right: 8px;
  background: linear-gradient(135deg, var(--saffron), var(--magenta));
  color: #fff;
  font-size: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(233,30,99,0.4);
}
.card-tv-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,217,192,0.9);
  color: #0d0a0f;
  font-size: 9px; font-weight: 800; letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: 100px;
}

/* People cards (horizontal row) */
.people-row {
  display: grid; grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 600px) {
  .people-row { grid-template-columns: 1fr 1fr; }
}
.person-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none; color: var(--text);
  text-align: left;
  font-family: inherit; font-size: inherit;
  width: 100%;
  cursor: pointer;
  transition: background 0.15s;
}
.person-card:hover { background: var(--surface-2); }
.person-photo {
  width: 48px; height: 48px;
  border-radius: 50%; overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-photo .poster-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--saffron), var(--magenta));
  color: #fff;
  font-family: var(--font-display); font-size: 14px;
}
.person-info { flex: 1; min-width: 0; }
.person-name { font-size: 14px; font-weight: 600; }
.person-known {
  font-size: 11px; color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,122,26,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(255,122,26,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,122,26,0); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadein 0.4s ease forwards; }

/* ============================================================
   BUTTONS
============================================================ */
.btn-primary {
  background: var(--text); color: var(--bg);
  border: none; padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-secondary {
  background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
@media (min-width: 768px) {
  .btn-primary, .btn-secondary { padding: 14px 22px; font-size: 14px; }
}

/* ============================================================
   SECTIONS
============================================================ */
.section { max-width: 1400px; margin: 0 auto; padding: var(--section-gap) var(--gutter); }
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
@media (min-width: 768px) { .section-head { margin-bottom: 24px; align-items: flex-end; } }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 10px;
}
.section-head h2 .accent {
  width: 4px; height: 22px; border-radius: 2px;
  background: linear-gradient(to bottom, var(--saffron), var(--magenta));
}
@media (min-width: 768px) { .section-head h2 .accent { height: 28px; } }
.section-head h2 .flag { font-size: 22px; margin-left: 6px; }
.section-head .more { font-size: 13px; color: var(--saffron); font-weight: 600; }

/* ============================================================
   MOVIE CARDS / POSTERS
============================================================ */
.movie-row {
  display: flex; gap: 12px; overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 6px;
  scrollbar-width: none;
}
.movie-row::-webkit-scrollbar { display: none; }
.movie-card { flex-shrink: 0; width: 140px; cursor: pointer; }
@media (min-width: 640px) {
  .movie-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    overflow: visible; margin: 0; padding: 0;
  }
  .movie-card { width: auto; }
}
@media (min-width: 1024px) {
  .movie-row { grid-template-columns: repeat(6, 1fr); gap: 20px; }
}

.poster {
  aspect-ratio: 2/3;
  border-radius: 14px;
  overflow: hidden; position: relative;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.3s, box-shadow 0.3s;
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 26px);
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.5);
  text-align: center; padding: 12px;
  line-height: 1.05;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-2) 100%);
}
@media (min-width: 768px) {
  .movie-card:hover .poster {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(255,122,26,0.15);
  }
}

.poster-flag {
  position: absolute; top: 8px; left: 8px;
  background: rgba(13,10,15,0.85); backdrop-filter: blur(8px);
  padding: 3px 6px; border-radius: 6px;
  font-size: 11px;
  display: flex; align-items: center; gap: 3px;
}
.poster-flag .lang {
  font-size: 9px; color: var(--text-2);
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}

.poster-rating {
  position: absolute; top: 8px; right: 8px;
  background: rgba(13,10,15,0.92); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,200,61,0.3);
  padding: 6px 9px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
}
.poster-rating .num {
  font-family: var(--font-display);
  font-size: 18px; color: var(--gold); letter-spacing: 0.02em;
}
.poster-rating .of {
  font-family: var(--font-mono); font-size: 8px;
  color: var(--text-3); margin-top: 1px;
}

.poster-verdict {
  position: absolute; bottom: 8px; left: 8px;
  padding: 3px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.v-master { background: var(--gold);     color: #2a1810; }
.v-must   { background: var(--saffron);  color: #fff; }
.v-crowd  { background: var(--magenta);  color: #fff; }
.v-mixed  { background: var(--surface-2); color: var(--text-2); }
.v-skip   { background: var(--red);       color: #fff; }
.v-avoid  { background: var(--red);       color: #fff; }

.movie-card .title {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
@media (min-width: 768px) {
  .movie-card .title { font-size: 14px; margin-bottom: 4px; }
}
.movie-card .meta {
  font-size: 11px; color: var(--text-3);
  font-family: var(--font-mono);
}

/* ============================================================
   LOADERS
============================================================ */
.loader {
  display: inline-block;
  width: 22px; height: 22px;
  border: 2px solid var(--surface-2);
  border-top-color: var(--saffron);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loader-text {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-3); font-size: 13px;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   BOTTOM NAV (mobile only) — 4 items, no auth
============================================================ */
.bottom-nav {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  position: sticky; bottom: 0;
  background: rgba(13,10,15,0.95); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 10px 20px max(env(safe-area-inset-bottom, 12px), 12px);
  z-index: 50;
}
@media (min-width: 768px) { .bottom-nav { display: none; } }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text-3); font-size: 10px; font-weight: 600; padding: 4px;
}
.nav-item.active { color: var(--saffron); }
.nav-item .nav-icon { font-size: 20px; }

/* ============================================================
   FOOTER
============================================================ */
.footer {
  display: none; border-top: 1px solid var(--border);
  padding: 48px var(--gutter) 32px; margin-top: 32px;
}
@media (min-width: 768px) { .footer { display: block; } }
.footer-inner {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer-brand h4 {
  font-family: var(--font-display); font-size: 24px;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, var(--saffron), var(--magenta));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.footer-brand .tag {
  font-size: 12px; color: var(--saffron-2);
  font-style: italic; margin-bottom: 12px;
}
.footer-brand p {
  font-size: 13px; color: var(--text-3); line-height: 1.6;
  max-width: 360px;
}
.footer-col h5 {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 12px; font-weight: 700;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 13px; color: var(--text-2); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1400px; margin: 32px auto 0;
  padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-3); flex-wrap: wrap; gap: 12px;
}
.footer-bottom .ver { font-family: var(--font-mono); }
.footer-attribution {
  font-size: 10px; color: var(--text-3);
  margin-top: 8px; line-height: 1.4;
}

/* ============================================================
   UTILITY
============================================================ */
.hidden { display: none !important; }
.error-banner {
  background: rgba(255,71,87,0.1);
  border: 1px solid rgba(255,71,87,0.3);
  color: #ffaaaa;
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; margin-bottom: 16px;
}

/* ============================================================
   WATCHLIST + SHARE + SUBSCRIPTIONS
============================================================ */
.btn-action.watchlist-btn[data-id] .icon { font-weight: 700; }
.movie-card .card-watchlist {
  position: absolute; top: 8px; left: 8px;
  background: rgba(13,10,15,0.85); color: var(--gold);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; backdrop-filter: blur(8px);
}
.movie-card .card-tv-badge ~ .card-watchlist {
  top: 8px; left: auto; right: 44px;
}
.ott-chip.mine {
  border-color: var(--green);
  background: rgba(46,204,113,0.08);
}
.ott-chip.mine .ott-type { color: var(--green); font-weight: 700; }
.subs-setup-tip {
  display: flex; gap: 10px; align-items: center;
  margin-top: 14px; padding: 12px 14px;
  background: rgba(255,200,61,0.06);
  border: 1px solid rgba(255,200,61,0.25);
  border-radius: 10px;
  color: var(--text-2); font-size: 13px;
  text-decoration: none;
}
.subs-setup-tip:hover { background: rgba(255,200,61,0.1); }
.subs-setup-tip strong { color: var(--gold); }

/* ============================================================
   SKELETON LOADERS — feel-faster placeholders
============================================================ */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.8; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-poster {
  aspect-ratio: 2/3; border-radius: 12px;
}
.skeleton-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: 12px;
  overflow: hidden; padding: 8px 0;
}
@media (min-width: 768px) {
  .skeleton-row { grid-auto-columns: 180px; gap: 16px; }
}
.skeleton-bar { height: 14px; border-radius: 6px; }
.skeleton-bar.short { width: 50%; }
.skeleton-bar.medium { width: 75%; }

/* Discovery tiles row */
.discovery-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 768px) {
  .discovery-tiles { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
.discovery-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  color: var(--text); text-decoration: none;
  transition: all 0.15s;
}
.discovery-tile:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  transform: translateY(-1px);
}
.dt-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.dt-body { min-width: 0; }
.dt-title { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.03em; line-height: 1.1; }
.dt-sub { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 0.05em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   PAGE HERO — standardized across all "discovery" pages
   (Releases / Watchlist / Subscriptions / Divergence / Language / Compare)
============================================================ */
.page-hero {
  max-width: 1100px; margin: 0 auto;
  padding: 40px var(--gutter) 24px;
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  line-height: 1.05;
}
.page-sub {
  color: var(--text-2);
  font-size: 16px;
  max-width: 700px;
  line-height: 1.55;
}
