/* =========================================================
   MOVIES INDEX PAGE
   - Dark cinematic theme
   - Fully responsive (mobile-first)
   - Cards + horizontal rows + sidebar
========================================================= */

/* ---------------------------
   ROOT WRAPPER
---------------------------- */

.movies-page {
  min-height: 100vh;
  padding: 1.5rem 1rem 3rem;
  background: radial-gradient(
    circle at top,
    #020617 0,
    #020617 40%,
    #020617 100%
  );
  color: #e5e7eb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.movies-page-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------------------------
   HERO SECTION
   - Background: 1920x1080
   - Poster: 600x900 (2:3)
---------------------------- */

.movies-hero {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  margin-bottom: 2rem;
  background: #020617;
  min-height: 260px;
  display: flex;
  align-items: stretch;
  isolation: isolate; /* ensure overlays don't bleed */
}

/* Full-bleed responsive background */
.movies-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.45) saturate(1.1);
  transform: scale(1.05);
  z-index: -2;
}

/* Gradient overlay with VAN glow */
.movies-hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at top left,
      rgba(245, 178, 0, 0.45),
      transparent 55%
    ),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.9), #020617);
  z-index: -1;
}

/* Hero inner layout (poster + copy) */
.movies-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.75rem 1.5rem;
}

/* Poster column */
.movies-hero-media {
  display: flex;
  justify-content: center;
}

/* Fixed aspect ratio container for 600x900 poster */
.movies-hero-poster {
  position: relative;
  aspect-ratio: 2 / 3; /* 600x900 */
  width: 160px;
  max-width: 45vw;
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
}

.movies-hero-poster img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Badge top-left */
.movies-hero-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(245, 178, 0, 0.7);
  background: rgba(15, 23, 42, 0.8);
  color: #fbbf24;
}

/* Rating tag top-right */
.movies-hero-rating {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.8);
}

/* Copy column */
.movies-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.movies-hero-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #9ca3af;
}

.movies-hero-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f9fafb;
}

.movies-hero-tagline {
  font-size: 0.95rem;
  color: #d1d5db;
  max-width: 32rem;
}

/* Meta row: Year • duration • region */
.movies-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #e5e7eb;
}

/* Genre chips */
.movies-hero-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.movies-hero-genre-chip {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
}

/* Hero buttons */
.movies-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.movies-hero-btn-primary,
.movies-hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease,
    background 0.15s ease, border-color 0.15s ease;
}

.movies-hero-btn-primary {
  background: linear-gradient(135deg, #f5b200, #f97316);
  color: #020617;
  border: none;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65);
}

.movies-hero-btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

.movies-hero-btn-secondary {
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.movies-hero-btn-secondary:hover {
  background: rgba(15, 23, 42, 0.95);
}

/* ---------------------------
   FILTER TOOLBAR
---------------------------- */

.movies-toolbar {
  margin-bottom: 2rem;
}

.movies-toolbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr);
  gap: 0.9rem;
  padding: 0.9rem;
  border-radius: 1rem;
  background: radial-gradient(
    circle at top left,
    rgba(15, 23, 42, 0.92),
    rgba(15, 23, 42, 0.98)
  );
  border: 1px solid rgba(31, 41, 55, 0.9);
}

/* Search input group */
.movies-toolbar-search-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Selects (genre, year, sort) */
.movies-toolbar-select-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.movies-toolbar-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9ca3af;
}

/* Common control styles */
.movies-toolbar-input,
.movies-toolbar-select {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 0.85rem;
  padding: 0.55rem 0.8rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

.movies-toolbar-input::placeholder {
  color: #6b7280;
}

.movies-toolbar-input:focus,
.movies-toolbar-select:focus {
  border-color: rgba(245, 178, 0, 0.9);
  box-shadow: 0 0 0 1px rgba(245, 178, 0, 0.4);
}

/* ---------------------------
   MAIN CONTENT LAYOUT
---------------------------- */

.movies-main-layout {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* Main column (left) */
.movies-main-column {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* Sidebar (right) */
.movies-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* Sticky sidebar on large screens */
@media (min-width: 1024px) {
  .movies-sidebar {
    position: sticky;
    top: 1.5rem;
  }
}

/* ---------------------------
   GENERIC SECTION LAYOUT
---------------------------- */

.movies-section {
  margin-bottom: 0; /* handled by layout gaps */
}

.movies-section--full {
  margin-top: 2.5rem;
}

.movies-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.movies-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f9fafb;
}

.movies-section-link {
  font-size: 0.8rem;
  color: #f5b200;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.movies-section-link::after {
  content: "›";
  font-size: 0.9em;
}

.movies-section-link:hover {
  text-decoration: underline;
}

/* Sidebar section card */
.movies-sidebar-section {
  padding: 1rem;
  border-radius: 1rem;
  background: radial-gradient(
    circle at top left,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.99)
  );
  border: 1px solid rgba(31, 41, 55, 0.95);
}

/* ---------------------------
   GRID LAYOUT (MOVIE CARDS)
---------------------------- */

.movies-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.movies-grid--compact {
  gap: 0.8rem;
}

/* ---------------------------
   MOVIE CARD (GRID ITEM)
---------------------------- */

.movie-card {
  background: radial-gradient(
    circle at top left,
    rgba(15, 23, 42, 0.96),
    #020617
  );
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(15, 23, 42, 0.9);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease,
    background 0.2s ease;
}

.movie-card--compact {
  border-radius: 0.9rem;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 178, 0, 0.7);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.85);
}

/* Poster wrapper with fixed 2:3 aspect ratio (600x900) */
.movie-card-poster-wrapper {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.movie-card-poster-wrapper img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.movie-card:hover .movie-card-poster-wrapper img {
  transform: scale(1.06);
  filter: saturate(1.15);
}

/* Badge (New, Trending, Coming Soon) */
.movie-card-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.9);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.9);
}

/* Rating tag (e.g. 16+) */
.movie-card-rating {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.9);
}

/* Score badge for top rated */
.movie-card-score {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(8, 47, 73, 0.95);
  color: #f9fafb;
  border: 1px solid rgba(56, 189, 248, 0.9);
}

/* Card body */
.movie-card-body {
  padding: 0.65rem 0.7rem 0.75rem;
}

.movie-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: #f9fafb;
}

.movie-card-title a {
  color: inherit;
  text-decoration: none;
}

.movie-card-title a:hover {
  text-decoration: underline;
}

.movie-card-meta {
  font-size: 0.75rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.movie-card-meta--subtle {
  margin-top: 0.2rem;
  color: #6b7280;
}

/* ---------------------------
   HORIZONTAL ROWS (SCROLL)
---------------------------- */

.movies-row-scroll {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scroll-snap-type: x mandatory;
}

.movies-row-scroll > * {
  scroll-snap-align: start;
}

/* Custom scrollbar for rows */
.movies-row-scroll::-webkit-scrollbar {
  height: 6px;
}

.movies-row-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.movies-row-scroll::-webkit-scrollbar-thumb {
  background: rgba(55, 65, 81, 0.75);
  border-radius: 999px;
}

/* Horizontal movie card (used in sidebar & genre rows) */
.movie-row-card {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  padding: 0.5rem;
  border-radius: 0.9rem;
  background: radial-gradient(
    circle at top left,
    rgba(15, 23, 42, 0.94),
    #020617
  );
  border: 1px solid rgba(31, 41, 55, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  min-width: 230px;
  max-width: 260px;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.movie-row-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 178, 0, 0.8);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
}

/* Small poster in row card (still 2:3 aspect ratio) */
.movie-row-poster-wrapper {
  position: relative;
  flex: 0 0 30%;
  aspect-ratio: 2 / 3;
  border-radius: 0.75rem;
  overflow: hidden;
}

.movie-row-poster-wrapper img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Rating badge on row card */
.movie-row-rating {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.7rem;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.9);
}

/* Text column for row card */
.movie-row-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
}

.movie-row-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f9fafb;
}

.movie-row-title a {
  color: inherit;
  text-decoration: none;
}

.movie-row-title a:hover {
  text-decoration: underline;
}

.movie-row-meta {
  font-size: 0.75rem;
  color: #9ca3af;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.movie-row-meta--subtle {
  color: #6b7280;
}

/* ---------------------------
   SIDEBAR CTA (SUBSCRIPTION)
---------------------------- */

.movies-subscribe-text {
  font-size: 0.85rem;
  color: #d1d5db;
  margin-bottom: 0.8rem;
}

.movies-subscribe-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(135deg, #f5b200, #f97316);
  color: #020617;
  border: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.movies-subscribe-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.85);
}

.movies-subscribe-note {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* ---------------------------
   GENRE ROWS (FULL WIDTH)
---------------------------- */

.movies-genre-row {
  margin-bottom: 1.75rem;
}

.movies-genre-row-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* ---------------------------
   RESPONSIVE BREAKPOINTS
---------------------------- */

@media (min-width: 640px) {
  .movies-page {
    padding: 2rem 1.5rem 3.5rem;
  }

  .movies-hero-inner {
    padding: 2.2rem 2rem;
  }

  /* Toolbar: search + filters on separate columns */
  .movies-toolbar-inner {
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    align-items: flex-end;
  }

  .movies-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .movies-hero {
    min-height: 320px;
  }

  /* Hero: poster + copy side by side */
  .movies-hero-inner {
    flex-direction: row;
    align-items: stretch;
    padding: 2.5rem 2.4rem;
  }

  .movies-hero-media {
    align-items: center;
  }

  .movies-hero-poster {
    width: 210px;
    max-width: none;
  }

  .movies-hero-copy {
    flex: 1;
    padding-left: 1.5rem;
  }

  .movies-hero-title {
    font-size: 2rem;
  }

  .movies-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .movies-page-inner {
    max-width: 1280px;
  }

  .movies-hero {
    margin-bottom: 2.5rem;
  }

  .movies-hero-title {
    font-size: 2.25rem;
  }

  /* Two-column main layout: content + sidebar */
  .movies-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.7fr) minmax(0, 1.3fr);
    align-items: flex-start;
    gap: 2.25rem;
  }
}

@media (min-width: 1280px) {
  .movies-hero-inner {
    padding-inline: 3rem;
  }

  .movies-hero-title {
    font-size: 2.4rem;
  }
}
