* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #08080c;
  --bg-soft: #101018;
  --card: #151520;
  --card-2: #1d1d29;
  --text: #ffffff;
  --muted: #a7a7b4;
  --gold: #c9a96e;
  --gold-soft: rgba(201, 169, 110, 0.18);
  --border: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.45);
}

body.light {
  --bg: #f5f2ec;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-2: #f0ede7;
  --text: #111111;
  --muted: #666666;
  --border: rgba(0, 0, 0, 0.1);
  --shadow: rgba(0, 0, 0, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.loader {
  position: fixed;
  inset: 0;
  background: #08080c;
  z-index: 9999;
  display: grid;
  place-items: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.hide {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  color: var(--gold);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
}

.loader-line {
  position: absolute;
  bottom: 42%;
  width: 180px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: loadLine 1.2s infinite;
}

@keyframes loadLine {
  from { transform: scaleX(0.2); opacity: 0.4; }
  to { transform: scaleX(1); opacity: 1; }
}

.header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 22px 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  background: rgba(8, 8, 12, 0.72);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
}

body.light .header {
  background: rgba(245, 242, 236, 0.78);
}

.logo {
  text-decoration: none;
  color: var(--text);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -1px;
}

.logo span {
  color: var(--gold);
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: 0.3s;
}

.nav a:hover {
  color: var(--gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn,
.watchlist-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 50px;
  cursor: pointer;
  transition: 0.3s;
}

.icon-btn {
  width: 43px;
  height: 43px;
  font-size: 18px;
}

.watchlist-toggle {
  padding: 12px 18px;
  font-weight: 700;
}

.watchlist-toggle span {
  color: var(--gold);
  margin-left: 4px;
}

.icon-btn:hover,
.watchlist-toggle:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.hero {
  min-height: 92vh;
  position: relative;
  display: flex;
  align-items: center;
  padding: 160px 7% 90px;
  background:
    linear-gradient(90deg, rgba(8,8,12,0.92), rgba(8,8,12,0.45), rgba(8,8,12,0.9)),
    url("https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
}

body.light .hero {
  background:
    linear-gradient(90deg, rgba(245,242,236,0.95), rgba(245,242,236,0.6), rgba(245,242,236,0.95)),
    url("https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
}

.hero-content {
  max-width: 850px;
  position: relative;
  z-index: 2;
}

.eyebrow,
.section-label {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.9;
  letter-spacing: -5px;
  margin-bottom: 28px;
}

.hero-text {
  color: var(--muted);
  max-width: 600px;
  font-size: 19px;
  line-height: 1.7;
  margin-bottom: 34px;
}

.hero-search {
  max-width: 680px;
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 80px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
}

.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 16px 20px;
  font-size: 16px;
}

.hero-search button {
  border: none;
  border-radius: 50px;
  padding: 14px 24px;
  background: var(--gold);
  color: #08080c;
  font-weight: 900;
  cursor: pointer;
}

.hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-tags span {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 40px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(255,255,255,0.05);
}

main {
  padding: 70px 7%;
}

.stats-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-bottom: 90px;
}

.stat-card {
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 25px 70px var(--shadow);
}

.stat-card p {
  color: var(--muted);
  margin-bottom: 12px;
}

.stat-card h3 {
  font-size: 42px;
  color: var(--gold);
}

.controls-section {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
}

.controls-section h2,
.section-heading h2 {
  font-size: clamp(34px, 5vw, 64px);
  letter-spacing: -3px;
}

.sort-box select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: 40px;
  outline: none;
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 42px;
}

.filter-btn {
  padding: 12px 18px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 40px;
  cursor: pointer;
  transition: 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gold);
  color: #08080c;
  border-color: var(--gold);
}

.movie-grid,
.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
}

.movie-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  cursor: pointer;
  transition: 0.35s;
  box-shadow: 0 18px 60px var(--shadow);
}

.movie-card:hover {
  transform: translateY(-10px);
  border-color: rgba(201,169,110,0.6);
  box-shadow: 0 28px 90px rgba(201,169,110,0.13);
}

.poster-wrap {
  position: relative;
  overflow: hidden;
}

.poster-wrap img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
  transition: 0.4s;
}

.movie-card:hover img {
  transform: scale(1.06);
}

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 11px;
  border-radius: 30px;
  background: rgba(8,8,12,0.78);
  backdrop-filter: blur(10px);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.movie-info {
  padding: 20px;
}

.movie-info h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.movie-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rating {
  color: var(--gold);
  font-weight: 900;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.small-btn {
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.3s;
}

.small-btn.active,
.small-btn:hover {
  background: var(--gold);
  color: #08080c;
  border-color: var(--gold);
}

.empty-state,
.watchlist-empty {
  display: none;
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}

.empty-state h3 {
  color: var(--text);
  font-size: 34px;
  margin-bottom: 12px;
}

.watchlist-section {
  margin-top: 110px;
  padding-top: 70px;
  border-top: 1px solid var(--border);
}

.section-heading {
  margin-bottom: 40px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.84);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal.show {
  display: flex;
}

.modal-content {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 34px;
  padding: 32px;
  position: relative;
  box-shadow: 0 40px 120px rgba(0,0,0,0.55);
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 24px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 36px;
  cursor: pointer;
  z-index: 3;
}

.modal-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 34px;
}

.modal-layout img {
  width: 100%;
  border-radius: 24px;
}

.modal-text h2 {
  font-size: clamp(34px, 5vw, 60px);
  letter-spacing: -3px;
  margin-bottom: 14px;
}

.modal-details {
  color: var(--gold);
  font-weight: 800;
  margin-bottom: 22px;
}

.modal-text p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 28px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-btn,
.secondary-btn {
  padding: 14px 22px;
  border-radius: 40px;
  cursor: pointer;
  font-weight: 900;
  transition: 0.3s;
}

.primary-btn {
  border: none;
  background: var(--gold);
  color: #08080c;
}

.secondary-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-2px);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--gold);
  color: #08080c;
  padding: 14px 18px;
  border-radius: 18px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: 0.35s;
  z-index: 500;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.footer {
  padding: 40px 7%;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer p {
  color: var(--text);
  font-weight: 900;
}

@media (max-width: 920px) {
  .nav {
    display: none;
  }

  .stats-section {
    grid-template-columns: repeat(2, 1fr);
  }

  .controls-section {
    flex-direction: column;
    align-items: start;
  }

  .modal-layout {
    grid-template-columns: 1fr;
  }

  .modal-layout img {
    max-width: 320px;
  }
}

@media (max-width: 620px) {
  .header {
    padding: 18px 5%;
  }

  .logo {
    font-size: 20px;
  }

  .watchlist-toggle {
    padding: 10px 13px;
    font-size: 13px;
  }

  .hero {
    padding: 150px 5% 70px;
  }

  .hero h1 {
    letter-spacing: -3px;
  }

  .hero-search {
    flex-direction: column;
    border-radius: 28px;
  }

  main {
    padding: 55px 5%;
  }

  .stats-section {
    grid-template-columns: 1fr;
  }

  .poster-wrap img {
    height: 420px;
  }

  .footer {
    flex-direction: column;
  }
}