:root {
  --color-primary: 41 128 185;
  --color-primary-dark: 30 97 140;
  --color-primary-light: 93 173 226;
  --color-secondary: 52 152 219;
  --color-accent: 46 204 113;
  --color-neutral-50: 249 250 251;
  --color-neutral-100: 243 244 246;
  --color-neutral-200: 229 231 235;
  --color-neutral-300: 209 213 219;
  --color-neutral-400: 156 163 175;
  --color-neutral-500: 107 114 128;
  --color-neutral-600: 75 85 99;
  --color-neutral-700: 55 65 81;
  --color-neutral-800: 31 41 55;
  --color-neutral-900: 17 24 39;
  --shadow-card: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 16px 36px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: rgb(var(--color-neutral-50));
  color: rgb(var(--color-neutral-900));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.container-custom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgb(var(--color-neutral-200));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgb(var(--color-primary));
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-secondary)));
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(41, 128, 185, 0.24);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: rgb(var(--color-neutral-700));
  font-weight: 600;
}

.desktop-nav a,
.dropdown-toggle {
  border: 0;
  background: transparent;
  color: rgb(var(--color-neutral-700));
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.dropdown-toggle:hover,
.desktop-nav .active {
  color: rgb(var(--color-primary));
}

.nav-dropdown {
  position: relative;
  padding: 22px 0;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  display: grid;
  min-width: 220px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid rgb(var(--color-neutral-200));
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.dropdown-menu a:hover {
  background: rgb(var(--color-neutral-100));
}

.header-search {
  position: relative;
  width: 260px;
  flex: 0 0 auto;
}

.header-search input,
.search-box input,
.catalog-search input {
  width: 100%;
  border: 1px solid rgb(var(--color-neutral-300));
  border-radius: 999px;
  outline: 0;
  background: #ffffff;
  color: rgb(var(--color-neutral-900));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
  padding: 10px 44px 10px 18px;
  font-size: 14px;
}

.header-search button {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgb(var(--color-primary));
}

.header-search input:focus,
.search-box input:focus,
.catalog-search input:focus {
  border-color: rgb(var(--color-primary));
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.14);
}

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: rgb(var(--color-neutral-700));
  background: rgb(var(--color-neutral-100));
}

.mobile-menu {
  display: none;
  border-top: 1px solid rgb(var(--color-neutral-200));
  padding: 16px 0 20px;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 10px 0;
  color: rgb(var(--color-neutral-700));
  font-weight: 600;
}

.hero-carousel {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: rgb(var(--color-neutral-900));
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.48) 48%, rgba(0, 0, 0, 0.22) 100%);
}

.hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: 76px;
  color: #ffffff;
}

.hero-panel {
  max-width: 720px;
}

.hero-badge,
.card-category,
.tag-pill,
.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.hero-badge {
  padding: 7px 14px;
  margin-bottom: 16px;
  background: rgb(var(--color-primary));
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.hero-panel h1,
.hero-panel h2 {
  margin: 0 0 16px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-panel p {
  max-width: 680px;
  margin: 0 0 28px;
  color: rgb(var(--color-neutral-100));
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.primary-btn,
.secondary-btn,
.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
  padding: 13px 28px;
  color: #ffffff;
  background: rgb(var(--color-primary));
  box-shadow: 0 14px 28px rgba(41, 128, 185, 0.32);
}

.primary-btn:hover {
  background: rgb(var(--color-primary-dark));
  transform: translateY(-2px);
}

.secondary-btn {
  padding: 12px 24px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.small-btn {
  padding: 9px 16px;
  color: #ffffff;
  background: rgb(var(--color-primary));
  font-size: 14px;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.46);
  transform: translateY(-50%);
  transition: background 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.72);
}

.hero-arrow.prev {
  left: 22px;
}

.hero-arrow.next {
  right: 22px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 4;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.hero-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
  width: 34px;
  background: #ffffff;
}

.section-spacing {
  padding: 58px 0;
}

.section-white {
  background: #ffffff;
}

.section-soft {
  background: rgb(var(--color-neutral-100));
}

.section-gradient {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-title h2,
.section-title h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.18;
}

.section-title p {
  margin: 0;
  color: rgb(var(--color-neutral-600));
  line-height: 1.7;
}

.link-more {
  color: rgb(var(--color-primary));
  font-weight: 800;
  white-space: nowrap;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.movie-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.movie-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgb(var(--color-neutral-200));
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card-poster {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgb(var(--color-neutral-900));
}

.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.movie-card:hover .card-poster img {
  transform: scale(1.06);
}

.card-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 38px;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  transition: opacity 0.25s ease, background 0.25s ease;
}

.movie-card:hover .card-play {
  opacity: 1;
  background: rgba(0, 0, 0, 0.34);
}

.card-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 8px;
  font-size: 12px;
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  margin: 0 0 10px;
  color: rgb(var(--color-neutral-900));
  font-size: 17px;
  line-height: 1.45;
  transition: color 0.2s ease;
}

.movie-card:hover h3 {
  color: rgb(var(--color-primary));
}

.card-body p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 14px;
  overflow: hidden;
  color: rgb(var(--color-neutral-600));
  font-size: 14px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgb(var(--color-neutral-500));
  font-size: 13px;
}

.card-category {
  padding: 4px 9px;
  color: rgb(var(--color-primary));
  background: rgba(41, 128, 185, 0.1);
  font-weight: 700;
}

.horizontal-scroll {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scrollbar-width: thin;
}

.horizontal-scroll .movie-card {
  width: 310px;
  flex: 0 0 auto;
}

.category-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: 20px;
  background: rgb(var(--color-neutral-900));
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.category-card img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  opacity: 0.82;
  transition: transform 0.35s ease;
}

.category-card:hover img {
  transform: scale(1.06);
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.18));
}

.category-card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 18px;
  color: #ffffff;
}

.category-card-content h3 {
  margin: 0 0 8px;
  font-size: 21px;
}

.category-card-content p {
  margin: 0;
  color: rgb(var(--color-neutral-200));
  font-size: 14px;
  line-height: 1.6;
}

.page-hero {
  padding: 64px 0;
  color: #ffffff;
  background: linear-gradient(120deg, rgb(var(--color-primary)) 0%, rgb(var(--color-primary-light)) 100%);
}

.page-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 5vw, 48px);
}

.page-hero p {
  max-width: 800px;
  margin: 0;
  color: rgb(var(--color-neutral-100));
  font-size: 18px;
  line-height: 1.75;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid rgb(var(--color-neutral-200));
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.catalog-search {
  flex: 1 1 360px;
}

.catalog-search input {
  padding: 12px 18px;
}

.sort-buttons,
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sort-button,
.category-tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: rgb(var(--color-neutral-700));
  background: rgb(var(--color-neutral-100));
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.sort-button:hover,
.sort-button.is-active,
.category-tab:hover,
.category-tab.is-active {
  color: #ffffff;
  background: rgb(var(--color-primary));
}

.ranking-list {
  display: grid;
  gap: 16px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 72px 220px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid rgb(var(--color-neutral-200));
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.rank-number {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-primary-light)));
  border-radius: 16px;
  font-size: 20px;
  font-weight: 900;
}

.ranking-poster {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: rgb(var(--color-neutral-900));
}

.ranking-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranking-content h2,
.ranking-content h3 {
  margin: 0 0 8px;
  font-size: 21px;
}

.ranking-content p {
  margin: 0 0 10px;
  color: rgb(var(--color-neutral-600));
  line-height: 1.6;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgb(var(--color-neutral-500));
  font-size: 13px;
}

.meta-pill {
  padding: 5px 9px;
  background: rgb(var(--color-neutral-100));
}

.detail-page {
  background: rgb(var(--color-neutral-50));
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  color: rgb(var(--color-neutral-600));
  font-size: 14px;
}

.breadcrumb a {
  color: rgb(var(--color-primary));
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr);
  gap: 30px;
  align-items: start;
}

.player-shell {
  position: relative;
  overflow: hidden;
  background: #000000;
  border-radius: 20px;
  box-shadow: var(--shadow-hover);
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  color: #ffffff;
  background: #000000;
  opacity: 1;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.player-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.72));
}

.player-cover.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.play-circle {
  position: relative;
  z-index: 2;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 50%;
  background: rgba(41, 128, 185, 0.94);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  font-size: 38px;
  transform: translateZ(0);
}

.detail-title-block {
  margin: 26px 0;
}

.detail-title-block h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.25;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: rgb(var(--color-neutral-600));
}

.content-card,
.side-card {
  padding: 24px;
  background: #ffffff;
  border: 1px solid rgb(var(--color-neutral-200));
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.content-card + .content-card {
  margin-top: 20px;
}

.content-card h2,
.side-card h2,
.side-card h3 {
  margin: 0 0 16px;
  font-size: 22px;
}

.content-card p {
  margin: 0 0 14px;
  color: rgb(var(--color-neutral-700));
  line-height: 1.9;
}

.info-line {
  color: rgb(var(--color-neutral-600));
  font-size: 14px;
}

.side-card {
  position: sticky;
  top: 94px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tag-pill {
  padding: 7px 12px;
  color: rgb(var(--color-neutral-700));
  background: rgb(var(--color-neutral-100));
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease;
}

.tag-pill:hover {
  color: #ffffff;
  background: rgb(var(--color-primary));
}

.score-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
  margin-top: 20px;
  border-top: 1px solid rgb(var(--color-neutral-200));
}

.score-number {
  color: rgb(var(--color-primary));
  font-size: 42px;
  font-weight: 900;
}

.related-section {
  margin-top: 46px;
}

.search-box {
  display: flex;
  max-width: 760px;
  gap: 12px;
  margin-top: 28px;
}

.search-box input {
  padding: 14px 20px;
}

.search-box button {
  flex: 0 0 auto;
  border: 0;
}

.search-summary {
  margin: 0 0 22px;
  color: rgb(var(--color-neutral-600));
}

.site-footer {
  color: rgb(var(--color-neutral-300));
  background: rgb(var(--color-neutral-800));
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 32px;
  padding: 42px 0;
}

.site-footer h3,
.site-footer h4 {
  margin: 0 0 14px;
  color: #ffffff;
}

.site-footer p,
.site-footer a {
  color: rgb(var(--color-neutral-400));
  line-height: 1.8;
  font-size: 14px;
}

.site-footer a:hover {
  color: rgb(var(--color-primary-light));
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgb(var(--color-neutral-400));
  font-size: 14px;
}

.hidden-by-filter {
  display: none !important;
}

@media (max-width: 1100px) {
  .movie-grid,
  .movie-grid.three,
  .category-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ranking-item {
    grid-template-columns: 56px 180px 1fr;
  }

  .ranking-item .small-btn {
    grid-column: 3;
    width: max-content;
  }
}

@media (max-width: 900px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

  .mobile-toggle {
    display: inline-grid;
    place-items: center;
  }

  .hero-carousel {
    height: 520px;
  }

  .movie-grid,
  .movie-grid.three,
  .category-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .side-card {
    position: static;
  }

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

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .container-custom {
    width: min(100% - 24px, 1280px);
  }

  .brand {
    font-size: 18px;
  }

  .hero-carousel {
    height: 480px;
  }

  .hero-content {
    padding-bottom: 60px;
  }

  .hero-panel p {
    font-size: 16px;
  }

  .hero-arrow {
    display: none;
  }

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

  .movie-grid,
  .movie-grid.three,
  .category-card-grid {
    grid-template-columns: 1fr;
  }

  .ranking-item {
    grid-template-columns: 48px 1fr;
  }

  .ranking-poster {
    grid-column: 1 / -1;
    order: -1;
  }

  .ranking-content,
  .ranking-item .small-btn {
    grid-column: 1 / -1;
  }

  .search-box {
    flex-direction: column;
  }

  .footer-grid,
  .footer-bottom {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }
}
