:root {
  --bg: #06070b;
  --bg-2: #0c1017;
  --bg-3: #131926;
  --panel: rgba(17, 22, 32, 0.72);
  --panel-strong: rgba(14, 18, 27, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f6f8fc;
  --muted: rgba(246, 248, 252, 0.72);
  --muted-2: rgba(246, 248, 252, 0.52);
  --soft: rgba(255, 255, 255, 0.1);
  --soft-2: rgba(255, 255, 255, 0.16);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --shadow-strong: 0 28px 70px rgba(0, 0, 0, 0.56);
  --radius: 18px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --accent: #ff2b38;
  --accent-dark: #d80d18;
  --accent-glow: rgba(255, 43, 56, 0.24);
  --content-width: 1560px;
  --page-pad: clamp(14px, 2vw, 24px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 620px at 10% -10%, rgba(255, 110, 70, 0.08), transparent 60%),
    radial-gradient(900px 540px at 100% 0%, rgba(70, 100, 255, 0.08), transparent 58%),
    radial-gradient(700px 460px at 50% 20%, rgba(255, 43, 56, 0.05), transparent 70%),
    linear-gradient(180deg, #06070b 0%, #090b11 26%, #0b0f16 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.02), transparent 14%),
    radial-gradient(circle at center, rgba(255,255,255,0.02), transparent 62%);
  opacity: 0.45;
  z-index: -1;
}

/* NAV */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: min(calc(100% - (var(--page-pad) * 2)), var(--content-width));
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(9, 12, 18, 0.72);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.logo {
  position: relative;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  cursor: pointer;
  user-select: none;
  width: fit-content;
  color: #fff;
}

.logo::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 42%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.9;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.nav-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.94rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.nav-btn.active {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.search-input {
  justify-self: end;
  width: 190px;
  max-width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  outline: none;
  transition:
    width 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.44);
}

.search-input:focus {
  width: 240px;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.03);
}

/* HERO */
.hero {
  position: relative;
  z-index: 1;
  width: min(calc(100% - (var(--page-pad) * 2)), var(--content-width));
  height: min(79vh, 820px);
  min-height: 520px;
  margin: 22px auto 0;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow-strong);
  background: #0e131c;
}

.hero.hidden {
  display: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  border-radius: inherit;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  transform: scale(1.03);
  filter: brightness(0.72) saturate(1.05);
  transition: opacity 420ms ease, transform 420ms ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(5, 8, 14, 0.92) 0%, rgba(7, 10, 16, 0.68) 28%, rgba(7, 10, 16, 0.22) 56%, transparent 82%),
    linear-gradient(to top, rgba(5, 8, 14, 0.92) 0%, rgba(7, 10, 16, 0.3) 40%, transparent 75%),
    radial-gradient(circle at 20% 30%, rgba(255, 43, 56, 0.12), transparent 28%);
}

.hero-content {
  position: absolute;
  left: clamp(22px, 4vw, 52px);
  bottom: clamp(24px, 5vw, 52px);
  width: min(640px, calc(100% - 48px));
  z-index: 2;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.hero-pill {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}

.hero-content h1 {
  margin: 0 0 16px;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 950;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 10ch;
}

.hero-content p {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(0.98rem, 1.35vw, 1.08rem);
  line-height: 1.58;
  max-width: 620px;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-play-btn,
.hero-info-btn {
  appearance: none;
  border: 1px solid transparent;
  font-weight: 800;
  padding: 13px 19px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.hero-play-btn {
  background: linear-gradient(180deg, #ffffff, #e9edf7);
  color: #0c1017;
}

.hero-info-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}

.hero-play-btn:hover,
.hero-info-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-strong);
}

.hero-play-btn:active,
.hero-info-btn:active {
  transform: translateY(0);
}

/* MAIN */
#app {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.content-section {
  margin-top: 6px;
}

.section-title {
  margin: 0 0 16px;
  padding: 0 var(--page-pad);
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.row-block {
  margin-bottom: 30px;
}

.row-title {
  margin: 0 0 12px;
  padding: 0 var(--page-pad);
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
}

/* ROW */
.row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 12px var(--page-pad) 42px;
  margin-bottom: 2px;
  scroll-behavior: smooth;
  scroll-padding-inline: var(--page-pad);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.row::-webkit-scrollbar {
  height: 10px;
}

.row::-webkit-scrollbar-track {
  background: transparent;
  margin: 0 var(--page-pad);
}

.row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.row::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* CARD */
.card {
  position: relative;
  width: 172px;
  height: 258px;
  flex: 0 0 172px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: visible;
  isolation: isolate;
  transform-origin: center bottom;
  transition: transform 240ms ease, filter 240ms ease;
}

.card-shell {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #12161d;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

.card:hover {
  transform: translateY(-8px) scale(1.045);
  z-index: 50;
}

.card:hover .card-shell {
  box-shadow:
    0 28px 58px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(255,255,255,0.04);
}

.card-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.card-poster img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1);
  transition: transform 240ms ease, filter 240ms ease;
}

.card:hover .card-poster img {
  transform: scale(1.04);
  filter: brightness(0.92);
}

.card-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(7, 9, 14, 0.92) 0%, rgba(7, 9, 14, 0.34) 42%, transparent 72%);
  pointer-events: none;
}

.card-info {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  text-align: left;
  transition: opacity 180ms ease;
}

.card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.14;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* EXPANDED HOVER PANEL */
.card-hover {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  min-height: 100%;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15, 18, 24, 0.99), rgba(12, 15, 20, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.56),
    inset 0 1px 0 rgba(255,255,255,0.03);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.card:hover .card-hover {
  opacity: 1;
  transform: translateY(0);
}

.card:hover .card-info {
  opacity: 0;
}

.card-hover-media {
  position: relative;
  height: 150px;
  background: #0d1117;
  overflow: hidden;
}

.card-hover-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-hover-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(12, 15, 20, 0.94) 0%, rgba(12, 15, 20, 0.16) 52%, transparent 76%);
}

.card-hover-body {
  padding: 12px;
}

.card-hover-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.15;
}

.card-hover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.card-chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255,255,255,0.05);
}

.card-hover-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.hover-action-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.hover-action-btn.primary {
  background: #fff;
  color: #0c1017;
}

.hover-action-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.05);
}

.hover-action-btn:hover {
  transform: translateY(-1px);
}

.card-hover-overview {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.84rem;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* DETAILS OVERLAY */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 7, 12, 0.82);
  backdrop-filter: blur(10px);
}

.overlay.active {
  display: flex;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
}

.details-container {
  position: relative;
  z-index: 2;
  width: min(1120px, 95vw);
  max-height: 90vh;
  overflow: auto;
  border-radius: 24px;
  background: #0c1017;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-strong);
}

.details-content {
  min-height: 180px;
}

.details-loading,
.details-error {
  padding: 32px;
  color: rgba(255,255,255,0.78);
  font-weight: 700;
}

.details-header {
  position: relative;
  background-size: cover;
  background-position: center;
}

.details-header-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(12, 16, 23, 0.96), rgba(12, 16, 23, 0.4)),
    linear-gradient(to right, rgba(12, 16, 23, 0.9), rgba(12, 16, 23, 0.24));
}

.details-header-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 26px;
}

.details-poster img,
.no-poster {
  width: 100%;
  border-radius: 18px;
  display: block;
  background: rgba(255,255,255,0.08);
}

.no-poster {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-weight: 700;
}

.details-info h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 2vw, 2.3rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.details-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.74);
  font-weight: 700;
}

.details-overview {
  margin: 0 0 18px;
  line-height: 1.65;
  color: rgba(255,255,255,0.84);
}

.details-actions {
  margin-bottom: 16px;
}

.details-trailer-btn {
  appearance: none;
  border: 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: #fff;
  color: #0c1017;
  font-weight: 800;
  cursor: pointer;
}

.details-cast {
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
}

/* UTIL */
.empty-state {
  padding: 30px 20px;
  color: var(--muted);
  font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .hero {
    min-height: 470px;
    height: 68vh;
  }

  .hero-content h1 {
    max-width: 12ch;
  }
}

@media (max-width: 900px) {
  .navbar {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 12px 14px;
  }

  .nav-links {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .search-input {
    width: 134px;
  }

  .hero {
    min-height: 420px;
    height: 62vh;
    border-radius: 24px;
  }

  .hero-content h1 {
    font-size: clamp(2rem, 7vw, 3.3rem);
  }

  .details-header-content {
    grid-template-columns: 1fr;
  }

  .details-poster {
    max-width: 220px;
  }

  .row {
    padding-bottom: 38px;
  }

  .card {
    width: 158px;
    height: 238px;
    flex-basis: 158px;
  }
}

@media (max-width: 640px) {
  .navbar {
    width: calc(100% - 20px);
    grid-template-columns: 1fr;
    align-items: stretch;
    margin-top: 10px;
  }

  .logo {
    margin-bottom: 2px;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .search-input {
    justify-self: stretch;
    width: 100%;
  }

  .hero {
    width: calc(100% - 20px);
    min-height: 430px;
    margin-top: 14px;
    border-radius: 22px;
  }

  .hero-content {
    width: calc(100% - 28px);
    left: 14px;
    bottom: 18px;
  }

  .hero-content p {
    font-size: 0.94rem;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-play-btn,
  .hero-info-btn {
    width: 100%;
    justify-content: center;
  }

  #app {
    padding-top: 18px;
  }

  .row,
  .row-title,
  .section-title {
    padding-left: 14px;
    padding-right: 14px;
  }

  .row {
    padding-bottom: 34px;
  }

  .card {
    width: 148px;
    height: 224px;
    flex-basis: 148px;
  }

  .card-hover-media {
    height: 122px;
  }

  .section-title {
    margin-bottom: 12px;
  }

  .row-block {
    margin-bottom: 24px;
  }
}