@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #0c0e13;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f8fafc;
  --muted: #b8c0cc;
  --cyan: #4ddbd4;
  --coral: #ff765f;
  --gold: #f4bf4f;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 15% 12%, rgba(77, 219, 212, 0.22), transparent 27rem),
    radial-gradient(circle at 80% 6%, rgba(255, 118, 95, 0.16), transparent 25rem),
    linear-gradient(135deg, #0c0e13 0%, #161a22 60%, #0f1117 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.movie-hero {
  position: relative;
  min-height: 72vh;
  display: grid;
  align-items: center;
  padding: 6rem clamp(1rem, 4vw, 4rem) 4rem;
  overflow: hidden;
}

.movie-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

.movie-hero::after {
  content: "";
  position: absolute;
  right: clamp(1rem, 6vw, 6rem);
  bottom: 1rem;
  width: min(42vw, 520px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    linear-gradient(115deg, rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.05)),
    repeating-radial-gradient(circle, rgba(255, 255, 255, 0.15) 0 2px, transparent 2px 28px);
  opacity: 0.34;
  animation: slowSpin 24s linear infinite;
}

.movie-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(12, 14, 19, 0.68);
  backdrop-filter: blur(14px);
}

.brand {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(77, 219, 212, 0.24), rgba(255, 118, 95, 0.23));
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  animation: heroIn 760ms ease both;
}

.kicker {
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 600px;
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.search-panel {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: 1fr 120px 160px 130px;
  gap: 0.75rem;
  margin-top: 2rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.filter-panel {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.form-control,
.form-select,
.btn {
  min-height: 48px;
  border-radius: 6px;
}

.form-control,
.form-select {
  border-color: var(--line);
  background-color: rgba(0, 0, 0, 0.28);
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(77, 219, 212, 0.7);
  box-shadow: 0 0 0 0.2rem rgba(77, 219, 212, 0.16);
}

main {
  width: min(1480px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 5rem;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.toolbar h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
}

.status-message {
  min-height: 44px;
  color: var(--muted);
}

.browse-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
}

.source-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1rem;
}

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

.movie-card {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(22px);
  animation: cardIn 580ms ease forwards;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.movie-card:hover,
.movie-card:focus-visible {
  border-color: rgba(77, 219, 212, 0.72);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.26);
  transform: translateY(-5px);
  outline: none;
}

.poster-wrap {
  position: absolute;
  inset: 0;
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) brightness(0.82);
  transition: transform 440ms ease, filter 440ms ease;
}

.movie-card:hover img {
  transform: scale(1.06);
  filter: saturate(1.16) brightness(0.96);
}

.movie-meta {
  position: absolute;
  inset: auto 0 0;
  padding: 4rem 0.95rem 0.95rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.92));
}

.movie-detail-line {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.rating-pill {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  border: 1px solid rgba(244, 191, 79, 0.45);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  background: rgba(0, 0, 0, 0.52);
  color: #ffe39b;
  font-size: 0.72rem;
  font-weight: 800;
}

.movie-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.movie-type {
  display: inline-flex;
  margin-bottom: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.player-shell {
  display: none;
}

.player-shell.active {
  display: block;
  animation: cardIn 500ms ease both;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.video-frame-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.video-frame-wrap iframe {
  display: block;
  width: 100%;
  height: min(76vh, 820px);
  min-height: 420px;
  border: 0;
}

.player-fallback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.player-fallback p {
  margin: 0;
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slowSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 820px) {
  .movie-hero {
    min-height: auto;
    padding-top: 5.5rem;
  }

  .movie-hero::after {
    width: 82vw;
    right: -20vw;
    bottom: -16vw;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: start;
    flex-direction: column;
  }

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

@media (max-width: 520px) {
  main {
    width: min(100% - 1rem, 1480px);
  }

  .movie-card {
    min-height: 300px;
  }

  .video-frame-wrap iframe {
    min-height: 300px;
  }
}
