/* ============================================================
   DESIGN TOKENS — CineVerse (Netflix Aesthetic)
   ============================================================ */
:root {
  --bg-primary:    #141414; /* Netflix Browse Page Background */
  --bg-secondary:  #181818; /* Netflix Card/Modal Background */
  --bg-card:       #181818;
  --bg-card-hover: #2f2f2f;
  --bg-overlay:    rgba(20, 20, 20, 0.95);

  --border:        rgba(255, 255, 255, 0.08);
  --border-hover:  rgba(255, 255, 255, 0.25);

  --text-primary:   #ffffff;
  --text-secondary: #e5e5e5;
  --text-muted:     #808080;

  --accent:        #e50914; /* Netflix Signature Red */
  --accent-hover:  #b20710;
  --accent-dim:    rgba(229, 9, 20, 0.15);
  --accent-glow:   rgba(229, 9, 20, 0.4);

  --gold:          #46d369; /* Netflix uses Green for matches, gold for stars */

  --navbar-h: 4.25rem;

  --r-sm:  4px;
  --r-md:  4px;
  --r-lg:  6px;
  --r-xl:  8px;
  --r-2xl: 8px;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 12px 50px rgba(0, 0, 0, 0.9);
  --shadow-accent: 0 4px 15px rgba(229, 9, 20, 0.4);

  --glass:        rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
  --bg-primary:    #f5f5f7;
  --bg-secondary:  #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hover: #e5e5e5;
  --bg-overlay:    rgba(245, 245, 247, 0.95);
  --border:        rgba(0, 0, 0, 0.1);
  --border-hover:  rgba(0, 0, 0, 0.2);
  --text-primary:  #141414;
  --text-secondary:#333333;
  --text-muted:    #666666;
  --glass:         rgba(0, 0, 0, 0.03);
  --glass-border:  rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #333333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555555; }

/* ── Focus Ring ────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   NAVBAR (Netflix Browse Bar Style)
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--navbar-h);
  transition: background-color 0.5s ease;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
  border-bottom: none;
}
.navbar.scrolled {
  background-color: #141414;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.nav-container {
  max-width: 100%;
  padding: 0 4%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-family: 'Impact', 'Arial Black', sans-serif;
  cursor: pointer;
}
.logo-icon { display: none; } /* Hide icon for authentic wordmark look */
.logo-text {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--accent);
  text-transform: uppercase;
}
.logo-text span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-right: auto;
}

.nav-link {
  text-decoration: none;
  color: #e5e5e5;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.3s ease;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-link:hover, .nav-link.active {
  color: #ffffff;
}
.nav-link::after { display: none; } /* Remove underlines for Netflix look */
.nav-link.active { font-weight: 700; }

.watchlist-badge {
  background: var(--accent);
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 99px;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Search Wrapper */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #ffffff;
  color: var(--text-primary);
  border-radius: 0;
  padding: 0.35rem 2rem 0.35rem 0.5rem;
  font-size: 0.8rem;
  outline: none;
  width: 0px;
  opacity: 0;
  pointer-events: none;
  transition: width 0.3s ease, opacity 0.3s ease;
}
.search-input:focus, .search-input.active {
  width: 200px;
  opacity: 1;
  pointer-events: auto;
}

.search-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
}

.theme-toggle, .hamburger {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: absolute;
  top: var(--navbar-h);
  left: 0;
  right: 0;
  background: #141414;
  border-bottom: 1px solid #333333;
  padding: 1.25rem;
  flex-direction: column;
  gap: 1rem;
}
.mobile-menu.active { display: flex; }

.mobile-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}
.mobile-link.active { color: var(--accent); }

/* ============================================================
   VIEWS
   ============================================================ */
.view {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.view.active {
  display: block;
  opacity: 1;
}

/* ============================================================
   HERO SECTION (Large Netflix Banner Style)
   ============================================================ */
.hero {
  position: relative;
  height: 85vh;
  min-height: 520px;
  max-height: 800px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #000;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
}

.hero-backdrop.zoom-effect {
  animation: slowZoom 25s ease-out forwards;
}
@keyframes slowZoom {
  from { transform: scale(1.05); }
  to { transform: scale(1); }
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(to right, #141414 0%, rgba(20,20,20,0.8) 30%, rgba(20,20,20,0) 60%, transparent 100%),
    linear-gradient(to top, #141414 0%, rgba(20,20,20,0.4) 15%, transparent 40%);
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0 4%;
}

.hero-badges {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  color: white;
  margin-bottom: 1rem;
  max-width: 700px;
  letter-spacing: -0.03em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.45);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.hero-rating {
  color: #46d369; /* Netflix Match Green */
  font-weight: 800;
}

.hero-overview {
  font-size: 1.1rem;
  line-height: 1.5;
  color: #fff;
  max-width: 580px;
  margin-bottom: 1.75rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.8rem;
  border-radius: 4px; /* Hard-corner flat buttons */
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
}
.btn-primary:hover {
  background: rgba(255, 255, 255, 0.75);
  transform: scale(1.05);
}

.btn-secondary {
  background: rgba(109, 109, 110, 0.7);
  color: white;
  border: none;
}
.btn-secondary:hover {
  background: rgba(109, 109, 110, 0.4);
  transform: scale(1.05);
}

/* ============================================================
   SECTIONS CONTAINER & ROWS
   ============================================================ */
.sections-container {
  max-width: 100%;
  padding: 0 4% 3rem;
  margin-top: -4rem; /* Overlap slightly with hero */
  position: relative;
  z-index: 20;
}

.movie-section {
  margin-bottom: 3.5rem;
}

.section-header {
  margin-bottom: 0.75rem;
}
.section-accent { display: none; } /* Hide row bar for Netflix look */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #e5e5e5;
  transition: color 0.3s ease;
}
.section-title:hover {
  color: #ffffff;
}

.see-all-btn { display: none; } /* Netflix scroll controls handle browsing */

.movie-row {
  display: flex;
  gap: 0.4rem; /* Small gaps between posters */
  overflow-x: auto;
  padding: 0.75rem 0;
  scroll-behavior: smooth;
}

/* ============================================================
   NETFLIX MOVIE CARDS (Posters with Hover Zoom Detail Cards)
   ============================================================ */
.movie-card {
  flex-shrink: 0;
  width: 180px; /* Wider card profiles */
  aspect-ratio: 16/9; /* Standard Netflix Row Landscape ratio */
  background: #181818;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
  position: relative;
  border: none;
}

/* Transform card on hover */
.movie-card:hover {
  transform: scale(1.15);
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.8);
}

.card-poster-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #181818;
}

/* Load landscape layout backdrop instead of portrait poster */
.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-rating-badge {
  display: none; /* Hide default badge for pure poster row look */
}

/* Custom interactive info bar on card hover */
.card-wl-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 10;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.movie-card:hover .card-wl-btn {
  opacity: 1;
}
.card-wl-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.card-info-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 70%, transparent 100%);
  padding: 1.5rem 0.5rem 0.5rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.movie-card:hover .card-info-panel {
  opacity: 1;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.card-meta {
  font-size: 0.65rem;
  display: flex;
  justify-content: space-between;
}

.genre-chip {
  display: none; /* Keep layout clean */
}

/* ============================================================
   GRID / CATEGORY VIEW
   ============================================================ */
.view-header {
  padding: 7rem 4% 1rem;
}

.filters-bar {
  padding: 1rem 4%;
}

.movies-grid-container {
  padding: 1.5rem 4%;
}

.movie-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

/* Grid cards can use landscape too */
.movie-grid .movie-card {
  width: 100%;
}

/* ============================================================
   MODALS (Clean Netflix Backdrop Overlay style)
   ============================================================ */
.modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.modal-container {
  max-width: 850px;
  background: #181818;
  border-radius: 6px;
  border: none;
}

.modal-close {
  background: #181818;
}

.modal-backdrop {
  height: 380px;
}

.modal-body {
  padding: 2.5rem;
  margin-top: -120px;
}

.modal-poster {
  width: 180px;
  border: none;
}

.modal-title {
  font-size: 2.25rem;
}

.modal-meta-row {
  color: #46d369; /* Netflix style metadata */
  font-weight: 700;
}

.modal-overview {
  color: #ffffff;
  font-size: 0.95rem;
}

/* ============================================================
   SCROLL TO TOP & FOOTER
   ============================================================ */
footer {
  background: #141414;
  padding: 4rem 4% 2rem;
}
.footer-desc {
  color: #808080;
}

/* ============================================================
   RESPONSIVENESS
   ============================================================ */
@media (max-width: 768px) {
  .nav-container { padding: 0 1.25rem; }
  .logo-text { font-size: 1.3rem; }
  .hero-title { font-size: 2.25rem; }
  .movie-card { width: 140px; }
  .modal-body { margin-top: -60px; }
}
