/* =========================
   ROOT
========================= */

:root {
  --text: #f5f2ff;
  --muted: rgba(245, 242, 255, 0.65);
  --glass: rgba(20, 0, 40, 0.75);
  --border: rgba(255, 255, 255, 0.08);
  --pink: #ff4fd8;
  --purple: #7c4dff;
}

/* =========================
   GLOBAL
========================= */

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  position: relative;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  overflow-x: hidden;

  background:
    radial-gradient(1000px 600px at 55% 40%, rgba(255, 0, 200, 0.35), transparent 60%),
    radial-gradient(900px 600px at 45% 55%, rgba(120, 0, 255, 0.45), transparent 65%),
    linear-gradient(180deg, #020007 0%, #070013 50%, #120027 100%);
}

/* =========================
   STAR IMAGE (REPEATS)
========================= */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;

  background-image: url("../assets/stars.png");
  background-repeat: repeat;
  background-size: 1920px 1080px;
  opacity: 0.8;
}

/* =========================
   NAVBAR (LOCKED TO TOP)
   - Always stays on top
   - Never scrolls away
========================= */

.navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;

  z-index: 999999;
  height: 72px;

  display: flex;
  align-items: center;

  background: rgba(20, 0, 40, 0.85);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.08);

  transform: none !important;
}

.navbar-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* BRAND */
.navbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.navbar .brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.navbar .brand h1 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.1;
}

.navbar .brand span {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--muted);
}

/* LINKS (HORIZONTAL LINE) */
.navlinks {
  display: flex;
  align-items: center;
  gap: 48px;
}

.navlink {
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.85;
  transition: 0.2s ease;
  position: relative;
}

.navlink:hover {
  opacity: 1;
  color: #ff7cfb;
}

/* underline */
.navlink::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  transition: width 0.25s ease;
}

.navlink:hover::after {
  width: 100%;
}

/* =========================
   PAGE LAYOUT
========================= */

.page {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;

  /* navbar height (72) + spacing */
  padding: 96px 20px 80px;
}

/* =========================
   SEARCH FLOAT
========================= */

.search-float {
  position: sticky;
  top: 88px; /* navbar height + a bit */

  z-index: 10;
  margin: 0 0 24px auto;
  width: min(520px, 100%);
  display: flex;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(25px);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7);
}

.input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  outline: none;
}

.input::placeholder { color: rgba(255, 255, 255, 0.5); }

.input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 0, 200, 0.2);
}

/* =========================
   BUTTONS
========================= */

.btn {
  border: none;
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.btn.primary {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border: none;
}

.btn.primary:hover { filter: brightness(1.1); }

/* =========================
   HERO
========================= */

.hero { margin: 18px 0 26px; }

.hero-inner {
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(20, 0, 40, 0.55);
  backdrop-filter: blur(22px);
  box-shadow: 0 25px 90px rgba(0, 0, 0, 0.75);
  padding: 26px;
}

.hero-title {
  margin: 0 0 8px;
  font-size: 2rem;
  letter-spacing: 0.2px;
}

.hero-sub {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================
   SECTION HEADER
========================= */

.section { margin-top: 30px; }

.section h2 {
  margin: 0;
  font-size: 1.2rem;
}

.section p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* =========================
   GRID (LEGACY)
========================= */

.grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

/* =========================
   GRID-6 (RESPONSIVE)
========================= */

.grid-6 {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 1200px) { .grid-6 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =========================
   CARDS
========================= */

.card {
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(15, 0, 30, 0.8);
  backdrop-filter: blur(25px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  transition: transform 0.2s ease, border-color 0.2s ease;

  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeIn 0.6s ease forwards;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--pink);
}

.poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  background: black;
}

.card-info { padding: 12px; }

.card-title {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.card:nth-child(1)  { animation-delay: 0.05s; }
.card:nth-child(2)  { animation-delay: 0.1s; }
.card:nth-child(3)  { animation-delay: 0.15s; }
.card:nth-child(4)  { animation-delay: 0.2s; }
.card:nth-child(5)  { animation-delay: 0.25s; }
.card:nth-child(6)  { animation-delay: 0.3s; }
.card:nth-child(7)  { animation-delay: 0.35s; }
.card:nth-child(8)  { animation-delay: 0.4s; }
.card:nth-child(9)  { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }

@keyframes cardFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* =========================
   MOVIE / SHOW PAGE
========================= */

.movie-wrap {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

.panel {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(25px);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.panel.pad { padding: 20px; }

.movie-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.movie-title {
  margin: 0 0 12px 0;
  font-size: 1.6rem;
}

.movie-desc {
  color: var(--muted);
  line-height: 1.6;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {
  .movie-wrap { grid-template-columns: 1fr; }
}

/* =========================
   LOADER
========================= */

#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #120027, #020007 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

.loader-inner { text-align: center; width: 300px; }

.loader-logo {
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin: 0 auto 16px auto;
  opacity: 0.9;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.4));
}

#loader h1 { margin-bottom: 15px; }

#loader-message {
  margin-bottom: 20px;
  color: rgba(255,255,255,0.7);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
}

#progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #7c4dff, #ff4fd8);
  transition: width 0.2s ease;
}

/* =========================
   SCROLLBAR
========================= */

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #0b0018; }

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c4dff, #ff4fd8);
  border-radius: 10px;
  border: 2px solid #0b0018;
  box-shadow: 0 0 12px rgba(255, 0, 200, 0.6);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9c6dff, #ff6fe8);
  box-shadow: 0 0 16px rgba(255, 0, 200, 0.9);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #7c4dff #0b0018;
}

/* =========================
   MOBILE NAV SPACING
========================= */

@media (max-width: 768px) {
  .navbar-inner { padding: 0 16px; }
  .navlinks { gap: 18px; }
  .navlink { font-size: 0.9rem; }
}