@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Oswald:wght@600&family=Inter:wght@300;400;500;600&display=swap');

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

/* ==================== CSS VARIABLES (THEMES) ==================== */
:root {
  /* LIGHT THEME (Default) */
  --bg: #ece7f6;
  --bg2: #f7f4fd;
  --bg3: #e2dbf1;
  --purple: #7c3aed;
  --purple-light: #a855f7;
  --neon: #6d28d9;
  --neon-glow: rgba(124, 58, 237, 0.15);
  --pink: #db2777;
  --text: #231d36;
  --text-dim: #6a6188;
  --border: rgba(101, 76, 177, 0.22);
  --card-bg: rgba(255, 255, 255, 0.62);
  --accent: #dc2626;
  --input-bg: rgba(255, 255, 255, 0.58);
  --overlay-gradient: linear-gradient(to top, rgba(248,249,255,0.9) 0%, transparent 50%);
  --overlay-gradient-fav: linear-gradient(to top, rgba(248,249,255,0.95) 0%, rgba(248,249,255,0.4) 50%, transparent 100%);
  --skeleton-base: #edeef5;
  --skeleton-shine: #f1f2f8;
}
[data-theme="dark"] {
  /* DARK THEME */
  --bg: #0d0d14;
  --bg2: #12121e;
  --bg3: #1a1a2e;
  --purple: #7c3aed;
  --purple-light: #a855f7;
  --neon: #c084fc;
  --neon-glow: rgba(192, 132, 252, 0.4);
  --pink: #ec4899;
  --text: #f1f0ff;
  --text-dim: #8b80a8;
  --border: rgba(124, 58, 237, 0.2);
  --card-bg: rgba(26, 26, 46, 0.8);
  --accent: #e50914;
  --input-bg: rgba(255,255,255,0.04);
  --overlay-gradient: linear-gradient(to top, rgba(13,13,20,0.85) 0%, transparent 50%);
  --overlay-gradient-fav: linear-gradient(to top, rgba(13,13,20,0.95) 0%, rgba(13,13,20,0.4) 50%, transparent 100%);
  --skeleton-base: #1a1a2e;
  --skeleton-shine: #22223a;
}

/* ==================== GLOBAL TRANSITIONS ==================== */
body, .movie-card, .fav-card, input, select, button, .nav-favorites, .theme-toggle {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Prevent theme color from breaking emoji rendering */
.surprise-btn, .filters-btn, .tab, .anime-toggle,
.nav-favorites, .search-icon, .region-label {
  font-family: 'Inter', "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* ==================== HOME PAGE ==================== */
.home-body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated orbs */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: orbFloat 12s ease-in-out infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.15), transparent);
  top: -100px; left: -100px;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(219, 39, 119, 0.12), transparent);
  top: 30%; right: -80px;
}
.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1), transparent);
  bottom: -80px; left: 40%;
}
[data-theme="dark"] .orb-1 { background: radial-gradient(circle, #7c3aed, transparent); opacity: 0.35; }
[data-theme="dark"] .orb-2 { background: radial-gradient(circle, #ec4899, transparent); opacity: 0.35; }
[data-theme="dark"] .orb-3 { background: radial-gradient(circle, #6366f1, transparent); opacity: 0.35; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* Noise overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px;
}
[data-theme="dark"] .noise-overlay { opacity: 0.04; }

/* NAV */
.home-nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
}
.nav-logo {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 2rem;
  letter-spacing: 3px;
  background: linear-gradient(135deg, var(--neon), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.8; }
.nav-favorites {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  background: var(--input-bg);
}
.nav-favorites:hover {
  color: var(--neon);
  border-color: var(--purple-light);
}

/* THEME TOGGLE BUTTON */
.theme-toggle {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  margin-left: 12px;
  color: var(--text-dim);
}
.theme-toggle:hover {
  border-color: var(--purple-light);
  transform: translateY(-1px);
  color: var(--text);
}
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="light"] .theme-toggle .icon-sun,
html:not([data-theme]) .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon,
html:not([data-theme]) .theme-toggle .icon-moon { display: inline; }

/* HERO */
.home-hero {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 60px 20px 40px;
}
.home-title {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: clamp(4rem, 12vw, 9rem);
  letter-spacing: 4px;
  line-height: 0.9;
  color: var(--text);
  margin-bottom: 20px;
}
.title-accent {
  background: linear-gradient(135deg, var(--neon), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px var(--neon-glow));
}
.home-subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* MAIN */
.home-main {
  position: relative;
  z-index: 2;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* SEARCH */
.search-section { margin-bottom: 40px; }
.search-container {
  display: flex;
  gap: 10px;
  max-width: 780px;
  margin: 0 auto 28px;
  position: relative; /* popup anchors here */
}
.search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 16px;
  font-size: 1rem;
  opacity: 0.5;
  pointer-events: none;
}
.mood-input {
  width: 100%;
  padding: 16px 20px 16px 44px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
}
.mood-input:focus {
  border-color: var(--purple-light);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1), 0 0 20px var(--neon-glow);
}
.mood-input::placeholder { color: var(--text-dim); }

.search-btn {
  padding: 16px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.surprise-btn {
  padding: 16px 18px;
  font-size: 1.2rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(8px);
  color: var(--text);
}
.surprise-btn:hover {
  border-color: var(--neon);
  background: rgba(124, 132, 252, 0.1);
  transform: rotate(20deg) scale(1.1);
}

/* MOOD BUTTONS (Hidden to prevent duplicates) */
.mood-buttons {
  display: none !important;
}

/* FILTERS */
.filters-btn {
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  color: var(--text-dim);
}
.filters-btn:hover, .filters-btn.active {
  border-color: var(--purple-light);
  background: rgba(124, 58, 237, 0.1);
  color: var(--text);
}

.filters-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.35s ease;
  opacity: 0;
}
.filters-panel.open { max-height: 200px; opacity: 1; }
.filters-panel-inner {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 0 8px;
  flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-group-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.content-tabs {
  display: flex;
  gap: 4px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.tab {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}
.tab.active {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: white;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.anime-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
}
.anime-toggle:hover { color: var(--text); border-color: var(--purple-light); }
.anime-toggle input { accent-color: var(--purple-light); }

/* REGION */
.region-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}
.region-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.country-select {
  padding: 9px 14px;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, rgba(26, 20, 46, 0.95), rgba(18, 18, 30, 0.95));
  border: 1px solid rgba(124, 58, 237, 0.55);
  border-radius: 10px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color-scheme: dark;
}
.country-select:focus,
.country-select:focus-visible {
  outline: none;
  border-color: var(--purple-light);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.35);
}
.country-select option {
  background: #100f1f;
  color: #f1f0ff;
}
[data-theme="light"] .country-select {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--text);
  color-scheme: light;
  box-shadow: 0 4px 14px rgba(91, 69, 148, 0.12);
}
[data-theme="light"] .country-select:hover {
  border-color: rgba(124, 58, 237, 0.58);
}
[data-theme="light"] .country-select option {
  background: #f7f3ff;
  color: #231d36;
}

/* RESULTS */
.results-section { margin-top: 40px; }
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}
.welcome-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
}
.example-text {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-style: italic;
}

/* MOVIE CARD */
.movie-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}
.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.25);
}
.movie-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--bg3);
}
.card-poster-wrapper {
  position: relative;
  overflow: hidden;
}
.card-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-gradient);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 10px;
}
.movie-card:hover .card-overlay { opacity: 1; }
.card-rating {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(0,0,0,0.6);
  padding: 3px 8px;
  border-radius: 6px;
}
.card-info {
  padding: 12px 14px;
}
.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-year {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* FAV BTN */
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(13,13,20,0.76);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
}
.movie-card:hover .fav-btn { opacity: 1; }
.fav-btn:hover {
  background: rgba(236, 72, 153, 0.3);
  border-color: var(--pink);
  transform: scale(1.1);
}

/* SKELETON */
.skeleton-poster, .skeleton-title {
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-poster { width: 100%; height: 260px; border-radius: 8px; }
.skeleton-title { width: 70%; height: 14px; border-radius: 4px; margin-top: 10px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* LOAD MORE */
.load-more-btn {
  display: block;
  margin: 40px auto 0;
  padding: 14px 44px;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

/* FOOTER */
.home-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ==================== MOOD PAGES (api/page.js) ==================== */
.mood-hero { padding: 40px 20px 30px; }
.mood-title { font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1; }
.mood-intro { max-width: 720px; margin: 0 auto; line-height: 1.6; }
.mood-intro a { color: var(--neon); }
a.movie-card { display: block; text-decoration: none; color: inherit; }
.mood-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 50px 0 10px;
  color: var(--text-dim);
}
.mood-cta-btn { text-decoration: none; display: inline-flex; align-items: center; }
.mood-more { margin-top: 50px; text-align: center; }
.movie-moods { padding: 0 24px 60px; }
.mood-section-title {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 20px;
}
.mood-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.mood-chip {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--input-bg);
  transition: color 0.2s, border-color 0.2s;
}
.mood-chip:hover { color: var(--neon); border-color: var(--purple-light); }
.mood-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.mood-tile {
  display: block;
  padding: 22px;
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.3s ease;
}
.mood-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.25);
}
.mood-tile-emoji { font-size: 1.8rem; }
.mood-tile-title { font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 10px 0 6px; }
.mood-tile-text { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }
.home-footer a { color: var(--text-dim); }
/* Nav links as a tidy row that wraps on phones instead of being cut off */
.home-nav > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
@media (max-width: 600px) {
  .home-nav { flex-wrap: wrap; gap: 10px; }
  .home-nav > div { justify-content: flex-start; gap: 6px; }
  .home-nav .nav-favorites { padding: 6px 10px; }
  .home-nav .theme-toggle { padding: 5px 9px; font-size: 0.95rem; }
}

/* ==================== MOVIE PAGE ==================== */
.movie-body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
}
.movie-nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}
.movie-nav .nav-logo {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 2rem;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--neon), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.movie-nav .nav-logo:hover { opacity: 0.8; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }

.movie-hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
}
.hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to right, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.1) 100%),
              linear-gradient(to top, rgba(10,10,10,1) 0%, rgba(10,10,10,0.3) 30%, transparent 60%);
}
.hero-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  padding: 60px 48px;
}
.hero-left { max-width: 600px; animation: fadeInUp 0.8s ease forwards; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-badges { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.badge {
  padding: 4px 12px;
  border: 1px solid rgba(192,132,252,0.3);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--neon);
  background: rgba(124,58,237,0.1);
  backdrop-filter: blur(4px);
}
.hero-title {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 12px;
  color: var(--text);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.hero-overview {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.btn-play {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-play:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 25px rgba(124,58,237,0.4);
}
.btn-fav {
  padding: 12px 24px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}
.btn-fav:hover { background: rgba(255,255,255,0.15); }
.btn-imdb {
  padding: 12px 20px;
  background: #f5c518;
  color: #000;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-imdb:hover { opacity: 0.9; transform: scale(1.03); }
.mute-btn {
  position: absolute;
  bottom: 48px; right: 48px;
  z-index: 4;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(192,132,252,0.4);
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}
.mute-btn:hover {
  border-color: var(--neon);
  background: rgba(124,58,237,0.3);
}
.hero-providers { margin-top: 8px; }
.providers-wrapper { display: flex; flex-direction: column; gap: 8px; }
.providers-title {
  font-size: 0.78rem;
  color: var(--text-dim);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.provider-group { display: flex; align-items: center; gap: 10px; }
.provider-label { font-size: 0.75rem; color: var(--text-dim); min-width: 55px; }
.provider-logos { display: flex; gap: 8px; flex-wrap: wrap; }
.provider-logo-img {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.provider-link { display: inline-flex; transition: transform 0.15s ease; }
.provider-link:hover { transform: translateY(-2px); }
.providers-credit { font-size: 0.68rem; color: var(--text-dim); opacity: 0.6; }

/* DETAILS */
.movie-details-section {
  padding: 60px 48px;
  background: var(--bg);
}
.details-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto 60px;
}
.details-poster img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.info-row {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.info-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 80px;
  padding-top: 2px;
}
.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124,58,237,0.1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px 4px 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.person-chip img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.person-chip:hover {
  background: rgba(124,58,237,0.2);
  border-color: var(--purple-light);
}
.cast-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.actor-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-width: 80px;
  text-align: center;
  transition: transform 0.2s;
}
.actor-card:hover { transform: translateY(-4px); }
.actor-card img {
  width: 70px; height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.actor-card:hover img { border-color: var(--neon); }
.actor-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.actor-char {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.2;
}
.genre-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-tag {
  padding: 4px 14px;
  background: rgba(124,58,237,0.12);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--neon);
}
.ratings-row { display: flex; gap: 12px; align-items: center; }
.rating-badge {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}
.tmdb-badge {
  background: rgba(1,180,228,0.1);
  border: 1px solid rgba(1,180,228,0.25);
  color: #01b4e4;
}

/* SIMILAR */
.similar-section { max-width: 1100px; margin: 0 auto; }
.section-title {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 2px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--text), var(--neon));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}
.similar-card {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
  background: var(--card-bg);
  border: 1px solid var(--border);
}
.similar-card:hover {
  transform: translateY(-4px);
  border-color: var(--purple-light);
  box-shadow: 0 8px 25px rgba(124,58,237,0.2);
}
.similar-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}
.similar-card span {
  display: block;
  padding: 10px;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* MODAL */
.trailer-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.95);
  align-items: center;
  justify-content: center;
}
.trailer-modal.active { display: flex; }
.trailer-modal-inner {
  position: relative;
  width: 90vw;
  max-width: 960px;
  aspect-ratio: 16/9;
}
.trailer-modal-inner iframe {
  width: 100%;
  height: 100%;
  border-radius: 10px;
}
.modal-close {
  position: absolute;
  top: -44px; right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.modal-close:hover { opacity: 1; }

/* ==================== FAVORITES PAGE ==================== */
.page-header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 60px 20px 20px;
}
.page-title {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: 3px;
  line-height: 1;
  color: var(--text);
}
.fav-count {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-top: 8px;
}
.fav-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.fav-empty-icon {
  font-size: 4rem;
  filter: drop-shadow(0 0 20px var(--neon-glow));
}
.fav-empty h2 {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--text);
}
.fav-empty p {
  color: var(--text-dim);
  font-size: 0.95rem;
}
.btn-discover {
  margin-top: 8px;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.btn-discover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}
.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  position: relative;
  z-index: 2;
}
.fav-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}
.fav-card:hover {
  transform: translateY(-6px);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.25);
}
.fav-card-poster { position: relative; overflow: hidden; }
.fav-card-poster img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  background: var(--bg3);
}
.fav-card:hover .fav-card-poster img { transform: scale(1.04); }
.fav-card-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-gradient-fav);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
  opacity: 0;
  transition: opacity 0.3s;
}
.fav-card:hover .fav-card-overlay { opacity: 1; }
.fav-remove-btn {
  padding: 8px 20px;
  background: rgba(236, 72, 153, 0.2);
  border: 1px solid rgba(236, 72, 153, 0.5);
  border-radius: 20px;
  color: #f9a8d4;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.fav-remove-btn:hover {
  background: rgba(236, 72, 153, 0.4);
  border-color: var(--pink);
  color: white;
  transform: scale(1.05);
}
.fav-card-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fav-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.fav-card-meta { display: flex; gap: 8px; align-items: center; }
.fav-type, .fav-year { font-size: 0.75rem; color: var(--text-dim); }
.fav-genres { font-size: 0.72rem; color: var(--neon); opacity: 0.7; }
.fav-actions { display: flex; justify-content: center; margin-top: 40px; }
.btn-clear-all {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid rgba(236, 72, 153, 0.2);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-clear-all:hover {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(236, 72, 153, 0.05);
}
.fav-skeleton-poster {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.fav-skeleton-info { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.fav-skeleton-title, .fav-skeleton-meta {
  border-radius: 4px;
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.fav-skeleton-title { height: 14px; width: 80%; }
.fav-skeleton-meta { height: 10px; width: 50%; }
@keyframes favCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes favCardOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}


/* ==================== PERSON PAGE ==================== */
.person-hero-section {
  position: relative;
  min-height: 560px;
  border-radius: 20px;
  overflow: hidden;
  margin: 0 auto 36px;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.person-hero-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: blur(14px) saturate(0.8);
  transform: scale(1.08);
  opacity: 0.35;
}
.person-hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 32%, rgba(124, 58, 237, 0.35), transparent 45%),
    linear-gradient(to top, rgba(8, 8, 14, 0.92), rgba(8, 8, 14, 0.72) 48%, rgba(8, 8, 14, 0.55));
}
.person-hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: end;
  padding: 52px;
}
.person-photo-wrapper {
  width: 100%;
  max-width: 280px;
}
.person-photo {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg3);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.person-meta {
  max-width: 820px;
}
.person-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.person-badge {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(124, 58, 237, 0.15);
  color: var(--neon);
  font-size: 0.8rem;
}
.person-name {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  letter-spacing: 2px;
  line-height: 0.95;
  margin-bottom: 12px;
}
.person-details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.person-detail-item {
  font-size: 0.86rem;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.person-bio {
  font-size: 0.96rem;
  line-height: 1.75;
  color: var(--text);
  opacity: 0.9;
  max-width: 68ch;
}
.bio-read-more {
  border: none;
  background: none;
  color: var(--neon);
  font-weight: 600;
  cursor: pointer;
}
.person-films-section {
  margin-top: 8px;
}
.section-heading {
  font-family: 'Bebas Neue', 'Oswald', sans-serif;
  font-size: 2rem;
  letter-spacing: 2px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--text), var(--neon));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .person-hero-section { min-height: auto; }
  .person-hero-content { grid-template-columns: 1fr; padding: 20px; gap: 16px; }
  .person-photo-wrapper { max-width: 180px; margin: 0 auto; }
  .person-meta { text-align: center; }
  .person-badges, .person-details { justify-content: center; }
  .home-nav { padding: 16px 20px; }
  .nav-logo { font-size: 1.6rem; }
  .nav-favorites { font-size: 0.8rem; padding: 6px 12px; }
  .home-hero { padding: 24px 16px 20px; }
  .home-title { font-size: clamp(3.2rem, 18vw, 5.5rem); }
  .search-container {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
    max-width: 100%;
  }
  .search-input-wrapper { grid-column: 1 / -1; }
  .mood-input { font-size: 16px; }
  .movies-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .movie-nav { padding: 12px 16px; }
  .hero-content { padding: 16px; }
  .hero-title { font-size: 1.9rem; }
  .details-grid { grid-template-columns: 1fr; }
  .details-poster { max-width: 140px; margin: 0 auto; }
  .similar-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .movies-grid { grid-template-columns: repeat(2, 1fr); }
  .similar-grid { grid-template-columns: repeat(2, 1fr); }
  .home-title { font-size: clamp(2.8rem, 17vw, 4rem); }
}
@media (hover: none) {
  .fav-btn { opacity: 1 !important; }
  .card-overlay { opacity: 1 !important; }
}
@supports (padding: max(0px)) {
  .home-nav { padding-top: max(16px, env(safe-area-inset-top)); }
  .movie-nav { padding-top: max(12px, env(safe-area-inset-top)); }
  .home-footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}


/* Movie hero video layer */
.hero-video-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  /* lets the iframe size itself against this box (cqw / cqh below) */
  container-type: size;
}
.hero-video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  transform: scale(1.08);
  filter: saturate(1.05);
}
/* Cover the whole hero like a background video instead of YouTube's black letterbox bars */
@supports (width: 1cqw) {
  .hero-video-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100cqw, 177.78cqh);
    height: max(100cqh, 56.25cqw);
    transform: translate(-50%, -50%) scale(1.02);
  }
}

/* Keep hero text readable in light theme over backdrop */
[data-theme="light"] .movie-hero-section .hero-title,
[data-theme="light"] .movie-hero-section .hero-meta,
[data-theme="light"] .movie-hero-section .hero-overview,
[data-theme="light"] .movie-hero-section .providers-title,
[data-theme="light"] .movie-hero-section .provider-label,
[data-theme="light"] .movie-hero-section .hero-badges .badge {
  color: #f7f7fb !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8) !important;
}
[data-theme="light"] .movie-hero-section .btn-fav {
  color: #f7f7fb !important;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
}











.tmdb-mini-score {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #f7fbff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

.fav-rating {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #f7fbff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

.card-score {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}




.similar-poster-wrap {
  position: relative;
}

.similar-fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(13,13,20,0.72);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
}
.similar-card:hover .similar-fav-btn { opacity: 1; }
.similar-fav-btn:hover {
  background: rgba(236, 72, 153, 0.3);
  border-color: var(--pink);
  transform: scale(1.08);
}
@media (hover: none) {
  .similar-fav-btn { opacity: 1 !important; }
}








/* ==================== TRAILER FEED (reels) ==================== */
/* Always dark and full-screen: one trailer per swipe, see feed.js */
.reels-body {
  margin: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: 'Inter', sans-serif;
}
.reels-feed {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.reels-feed::-webkit-scrollbar { display: none; }
.reel {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
}
/* Blurred poster fills the sides on wide screens */
.reel-backdrop {
  position: absolute;
  inset: -60px;
  background-size: cover;
  background-position: center;
  filter: blur(50px) brightness(0.35);
}
/* The phone-shaped column the trailer plays in */
.reel-stage {
  position: relative;
  height: 100%;
  width: min(100vw, calc(100vh * 9 / 16));
  width: min(100vw, calc(100dvh * 9 / 16));
  overflow: hidden;
  background: #000;
}
.reel-poster, .reel-player, .reel-shade, .reel-tap { position: absolute; inset: 0; }
.reel-poster { width: 100%; height: 100%; object-fit: cover; }
/* A wide trailer cropped to the tall screen: as tall as the stage, centred */
.reel-video {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 100%;
  width: calc(100vh * 16 / 9);
  width: calc(100dvh * 16 / 9);
  transform: translate(-50%, -50%);
  border: 0;
  /* touches go to .reel-tap, otherwise the video would swallow the swipe */
  pointer-events: none;
}
/* "Whole frame" mode: nothing cropped, poster blurred behind */
.reels-fit .reel-video { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.reels-fit .reel.active .reel-poster { filter: blur(30px) brightness(0.4); transform: scale(1.2); }
.reel-shade {
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, transparent 18%, transparent 52%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}
.reel-tap { z-index: 2; background: none; border: 0; padding: 0; cursor: pointer; }
.reel-paused {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 76px;
  height: 76px;
  display: none;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  font-size: 1.8rem;
  pointer-events: none;
}
.reel.paused .reel-paused { display: flex; }
.reel-info {
  position: absolute;
  left: 16px;
  right: 84px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 3;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}
.reel-title { font-size: 1.25rem; font-weight: 600; line-height: 1.2; margin: 0 0 6px; }
.reel-sub { font-size: 0.85rem; color: rgba(255, 255, 255, 0.85); margin: 0 0 8px; }
.reel-overview {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
}
.reel-overview.expanded { -webkit-line-clamp: 12; }
.reel-actions {
  position: absolute;
  right: 8px;
  bottom: calc(26px + env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.reel-action {
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: none;
  border: 0;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
}
.reel-action-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  font-size: 1.25rem;
  transition: transform 0.15s ease;
}
.reel-action:active .reel-action-icon { transform: scale(0.88); }
.reel-action-label { font-size: 0.66rem; line-height: 1.1; text-align: center; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9); }
.reels-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  pointer-events: none;
}
.reels-top > * { pointer-events: auto; }
.reels-logo { font-size: 1.5rem; }
.reels-close {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
}
.reels-status {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}
.reels-status[hidden] { display: none; }
.reels-toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 20;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 20, 30, 0.92);
  font-size: 0.85rem;
}
/* Up / down buttons for mouse users; phones swipe */
.reels-arrows {
  position: fixed;
  right: 24px;
  top: 50%;
  z-index: 10;
  display: none;
  flex-direction: column;
  gap: 12px;
  transform: translateY(-50%);
}
.reels-arrow {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 20, 30, 0.7);
  color: #fff;
  cursor: pointer;
}
.reels-arrow:hover { border-color: var(--purple-light); }
@media (hover: hover) and (min-width: 900px) {
  .reels-arrows { display: flex; }
}

[data-theme="light"] .home-body,
[data-theme="light"] .movie-body,
[data-theme="light"] .feed-body {
  background:
    radial-gradient(circle at 10% 10%, rgba(173, 145, 244, 0.24), transparent 42%),
    radial-gradient(circle at 90% 16%, rgba(255, 170, 212, 0.16), transparent 38%),
    radial-gradient(circle at 76% 84%, rgba(152, 171, 245, 0.14), transparent 40%),
    linear-gradient(180deg, #f7f3ff 0%, #ece7f6 45%, #e8e2f2 100%);
}

[data-theme="light"] .movie-card,
[data-theme="light"] .fav-card,
[data-theme="light"] .feed-player-card {
  box-shadow: 0 10px 26px rgba(73, 45, 122, 0.08);
}









[data-theme="light"] .search-btn,
[data-theme="light"] .feed-btn-primary {
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.18);
}

[data-theme="light"] .nav-favorites,
[data-theme="light"] .theme-toggle,
[data-theme="light"] .filters-btn,
[data-theme="light"] .surprise-btn,
[data-theme="light"] .mood-input,
[data-theme="light"] .country-select {
  border-color: rgba(124, 58, 237, 0.32);
}

[data-theme="light"] .nav-favorites:hover,
[data-theme="light"] .theme-toggle:hover,
[data-theme="light"] .filters-btn:hover,
[data-theme="light"] .surprise-btn:hover,
[data-theme="light"] .country-select:hover {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10);
}

[data-theme="light"] .movie-card,
[data-theme="light"] .fav-card,
[data-theme="light"] .feed-player-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.74), rgba(248,243,255,0.72));
}

[data-theme="light"] .home-subtitle,
[data-theme="light"] .region-label,
[data-theme="light"] .example-text,
[data-theme="light"] .home-footer {
  color: #655a84;
}



/* LIGHT THEME BOOSTED ACCENT */
[data-theme="light"] .search-section {
  position: relative;
}
[data-theme="light"] .search-section::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  transform: translateX(-50%);
  width: min(860px, 96vw);
  height: 170px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 30%, rgba(124, 58, 237, 0.20), rgba(124, 58, 237, 0.06) 52%, transparent 74%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] .search-container,
[data-theme="light"] .region-row {
  position: relative;
  z-index: 1;
}
[data-theme="light"] .mood-input,
[data-theme="light"] .filters-btn,
[data-theme="light"] .surprise-btn,
[data-theme="light"] .country-select,
[data-theme="light"] .theme-toggle,
[data-theme="light"] .nav-favorites {
  border-color: rgba(124, 58, 237, 0.42);
  box-shadow: 0 6px 18px rgba(111, 72, 183, 0.14);
}
[data-theme="light"] .search-btn {
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.28);
}
[data-theme="light"] .mood-input:focus,
[data-theme="light"] .country-select:focus,
[data-theme="light"] .country-select:focus-visible {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18), 0 10px 26px rgba(111, 72, 183, 0.22);
}


.filters-panel-inner .filter-group:first-child {
  align-items: center;
  text-align: center;
}



.watched-btn {
  position: absolute;
  top: 46px;
  right: 8px;
  background: rgba(13,13,20,0.76);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
  z-index: 3;
}
.movie-card:hover .watched-btn { opacity: 1; }
.watched-btn:hover {
  background: rgba(251, 191, 36, 0.24);
  border-color: rgba(251, 191, 36, 0.65);
  transform: scale(1.08);
}
.movie-card.watched .movie-poster {
  filter: saturate(0.86) brightness(0.9);
}
.watched-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.24);
  border: 1px solid rgba(251, 191, 36, 0.62);
  color: #fff4cf;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  backdrop-filter: blur(2px);
}
@media (hover: none) {
  .watched-btn { opacity: 1 !important; }
}

.watched-badge-static {
  right: auto;
  left: 10px;
}



/* ==================== 2026-10 USABILITY PASS ==================== */
/* Bebas Neue has no Cyrillic letters: Oswald (see @import) covers Ukrainian and Russian headings */

/* Smaller hero: the first films are visible without scrolling */
.home-hero { padding: 28px 20px 24px; }
.home-title { font-size: clamp(2.6rem, 6.5vw, 4.6rem); line-height: 1; margin-bottom: 12px; }
.home-subtitle { font-size: 1rem; }
.results-section { margin-top: 24px; }

/* Buttons say what they do */
.surprise-btn, .filters-btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.surprise-btn { font-family: 'Inter', sans-serif; }
.surprise-btn .btn-label, .filters-btn .btn-label { font-size: 0.9rem; font-weight: 500; color: var(--text-dim); }
.surprise-btn:hover { transform: none; }

/* Language switcher in the nav */
.lang-select {
  padding: 7px 10px;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  cursor: pointer;
  outline: none;
  color-scheme: dark;
}
[data-theme="light"] .lang-select { color-scheme: light; border-color: rgba(124, 58, 237, 0.32); }
.lang-select:hover, .lang-select:focus-visible { border-color: var(--purple-light); color: var(--text); }
.movie-nav .nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* "Showing: Comedy · 1980s · #zombie" above the results */
.understood-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 0.85rem;
}
.understood-row[hidden] { display: none; }
.understood-label { color: var(--text-dim); }
.understood-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
}

/* Favorite / watched buttons are always reachable, not only on hover */
.movie-card .fav-btn, .movie-card .watched-btn { opacity: 0.85; }
.movie-card:hover .fav-btn, .movie-card:hover .watched-btn { opacity: 1; }

@media (max-width: 768px) {
  .home-hero { padding: 12px 16px 16px; }
  .home-title { font-size: clamp(1.9rem, 9vw, 2.8rem); margin-bottom: 8px; }
  .home-subtitle { font-size: 0.9rem; }
  .search-container { grid-template-columns: 1fr 1fr 1fr; margin-bottom: 16px; }
  .search-btn, .surprise-btn, .filters-btn { justify-content: center; padding: 13px 10px; }
  .results-section { margin-top: 16px; }
}
@media (max-width: 480px) {
  .home-title { font-size: clamp(1.8rem, 9vw, 2.4rem); }
}
/* ==================== NAV: two links, favorites, menu (nav.js) ==================== */
.nav-main { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.home-nav .nav-main, .movie-nav .nav-main { justify-content: flex-end; }
.nav-text-link {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-text-link:hover, .nav-text-link.active { color: var(--text); }
.nav-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.nav-icon-btn:hover, .nav-icon-btn.active { border-color: var(--purple-light); }
.nav-favorites-btn { color: var(--pink); font-size: 1.15rem; }
.nav-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
}
.nav-menu { position: relative; }
.nav-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 240px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-family: 'Inter', sans-serif;
}
.nav-menu-panel[hidden] { display: none; }
.nav-menu-item, .nav-menu-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}
a.nav-menu-item:hover, button.nav-menu-item:hover { background: var(--input-bg); }
.nav-menu-count { color: var(--text-dim); font-size: 0.8rem; }
.nav-menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.nav-menu-row .lang-select { padding: 6px 8px; }
/* The theme button keeps its sun / moon icon and becomes a menu row */
.nav-menu-panel .theme-toggle.nav-menu-item {
  justify-content: flex-start;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transform: none;
}
.nav-menu-panel .theme-toggle.nav-menu-item:hover { background: var(--input-bg); }
.nav-theme-label { margin-left: 2px; }
.home-nav .nav-main { flex-wrap: nowrap; }
.nav-menu-mobile { display: none; }
@media (max-width: 560px) {
  .home-nav { flex-wrap: nowrap; }
  .nav-text-link { display: none; }
  .nav-menu-mobile { display: block; }
}

/* ==================== MOVIE PAGE PASS ==================== */
/* The hero grows with its content: on short screens the text no longer slides under the nav */
.movie-hero-section { height: auto; min-height: 100vh; min-height: 100svh; }
.hero-content {
  position: relative;
  inset: auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: 110px 48px 60px;
  box-sizing: border-box;
}
/* A grid item is as wide as its content by default: the cast row stretched the page on phones */
.details-grid > * { min-width: 0; }

/* Mood chips under the title: "Cozy · Nostalgic · Romantic" */
.hero-moods { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.hero-moods[hidden] { display: none; }
.mood-tag {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.8rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.mood-tag:hover { border-color: var(--purple-light); background: rgba(124, 58, 237, 0.3); }

/* Streaming services: logo and name */
.provider-link {
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  text-decoration: none;
}
.provider-link .provider-logo-img { width: 30px; height: 30px; border: 0; }
.provider-name { font-size: 0.78rem; white-space: nowrap; }

@media (max-width: 768px) {
  .hero-content { padding: 96px 16px 32px; }
  /* out of the way of the streaming services at the bottom */
  .mute-btn { top: 76px; bottom: auto; right: 16px; }
}