/* ==========================================================================
   StreamNest - Modern Cinematic Streaming Discovery UI Styles
   Dark Theme, Responsive Design, CSS Shimmer Skeletons, Interactive Controls
   ========================================================================== */

:root {
  --bg-main: #0b0b0f;
  --bg-surface: #14141d;
  --bg-card: #191924;
  --bg-card-hover: #222233;
  --bg-overlay: rgba(11, 11, 15, 0.85);

  --accent-red: #e50914;
  --accent-red-hover: #f40612;
  --accent-crimson: #ff2a44;
  --accent-gradient: linear-gradient(135deg, #e50914 0%, #ff2a44 100%);
  --accent-gold: #f5c518;

  --text-main: #f5f5f7;
  --text-secondary: #9b9ba8;
  --text-muted: #6a6a78;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(229, 9, 20, 0.5);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --header-height: 72px;
  --card-radius: 8px;
  --transition-smooth: all 0.28s cubic-bezier(0.25, 0.8, 0.25, 1);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.7);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bg-main);
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  background: linear-gradient(to bottom, rgba(11, 11, 15, 0.9) 0%, rgba(11, 11, 15, 0) 100%);
}

.site-header.nav-scrolled {
  background-color: rgba(11, 11, 15, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 20px;
}

/* Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  text-transform: uppercase;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--accent-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.6);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.brand-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Nav Links */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  padding: 6px 0;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2.5px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.nav-badge-pill {
  display: none;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Header Right / Search / Region */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-bar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 6px 16px;
  transition: var(--transition-smooth);
}

.search-bar-wrap:focus-within {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent-red);
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.3);
}

.search-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  margin-right: 8px;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.9rem;
  width: 170px;
  transition: width 0.3s ease;
}

.search-input:focus {
  width: 250px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Region Selector */
.region-wrap {
  position: relative;
}

.region-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.region-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.region-dropdown {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 100;
}

.region-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

.region-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.88rem;
  border-radius: 6px;
  text-align: left;
  transition: background 0.15s ease;
}

.region-option:hover,
.region-option.selected {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.region-option.selected {
  font-weight: 700;
  border-left: 3px solid var(--accent-red);
}

/* Mobile Toggle */
.mobile-menu-toggle {
  display: none;
  color: var(--text-main);
  padding: 6px;
}

/* ==========================================================================
   HERO BANNER
   ========================================================================== */
.hero-banner {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  padding: 120px 32px 60px 32px;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transition: background-image 0.8s ease-in-out;
}

.hero-content {
  max-width: 780px;
  margin-left: calc((100% - 1536px) / 2);
  z-index: 10;
  animation: heroFadeIn 0.7s ease;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.badge-featured {
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.badge-type, .badge-quality {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  font-size: 1rem;
  font-weight: 600;
}

.meta-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-gold);
}

.icon-star {
  width: 18px;
  height: 18px;
}

.meta-year {
  color: var(--text-secondary);
}

.meta-cert {
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 3px;
}

.hero-overview {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #d1d1d8;
  margin-bottom: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: #fff;
  color: #0b0b0f;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: #e6e6e6;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.35);
}

.btn-secondary {
  background: rgba(109, 109, 110, 0.55);
  color: #fff;
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(109, 109, 110, 0.85);
  transform: translateY(-2px);
}

.btn-secondary.active {
  background: var(--accent-red);
  color: #fff;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.hero-dot.active {
  width: 26px;
  border-radius: 5px;
  background: var(--accent-red);
}

/* ==========================================================================
   ROWS & CAROUSEL SLIDERS
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 0 32px 60px 32px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.content-row-section {
  margin-bottom: 46px;
  position: relative;
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.row-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.row-tag {
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.3);
  color: var(--accent-crimson);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.row-controls {
  display: flex;
  gap: 8px;
}

.row-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.row-nav-btn svg {
  width: 18px;
  height: 18px;
}

.row-nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.row-slider {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 4px 18px 4px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  user-select: none;
}

.row-slider::-webkit-scrollbar {
  display: none; /* Chrome / Safari */
}

/* ==========================================================================
   MEDIA CARD (TMDB & YOUTUBE)
   ========================================================================== */
.media-card {
  flex: 0 0 calc((100% - (5 * 16px)) / 6); /* 6 cards per row on large screens */
  min-width: 180px;
  cursor: pointer;
  border-radius: var(--card-radius);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.media-card:hover {
  transform: translateY(-8px) scale(1.02);
  z-index: 20;
}

.media-card:hover .card-poster-wrap {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.8), 0 0 16px rgba(229, 9, 20, 0.2);
}

.card-poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--card-radius);
  overflow: hidden;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease;
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Card Overlays & Badges */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 11, 15, 0.9) 0%, rgba(11, 11, 15, 0.2) 50%, rgba(11, 11, 15, 0) 100%);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: opacity 0.25s ease;
}

.media-card:hover .card-overlay {
  opacity: 1;
}

.card-quick-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #0b0b0f;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.card-quick-btn:hover {
  background: var(--accent-red);
  color: #fff;
  transform: scale(1.15);
}

.card-quick-btn.active {
  background: var(--accent-red);
  color: #fff;
}

.card-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(11, 11, 15, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  letter-spacing: 0.4px;
}

.card-rating-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(11, 11, 15, 0.85);
  backdrop-filter: blur(6px);
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-info {
  padding: 10px 4px 0 4px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-sub-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.card-dot {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* YouTube Specific Card Styling */
.media-card.yt-card {
  flex: 0 0 calc((100% - (3 * 16px)) / 4); /* 4 cards per row for 16:9 thumbnails */
  min-width: 240px;
}

.yt-thumb-wrap {
  aspect-ratio: 16 / 9;
}

.yt-badge {
  background: rgba(229, 9, 20, 0.85);
}

.yt-ep-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
}

/* ==========================================================================
   SHIMMER SKELETON LOADERS
   ========================================================================== */
.media-card-skeleton {
  flex: 0 0 calc((100% - (5 * 16px)) / 6);
  min-width: 180px;
}

.shimmer {
  background: linear-gradient(90deg, #181824 0%, #29293d 50%, #181824 100%);
  background-size: 200% 100%;
  animation: shimmerAnim 1.6s infinite ease-in-out;
  border-radius: 6px;
}

@keyframes shimmerAnim {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-poster {
  aspect-ratio: 2 / 3;
  margin-bottom: 10px;
}

.skeleton-text-short {
  height: 14px;
  width: 75%;
  margin-bottom: 6px;
}

.skeleton-text-tiny {
  height: 10px;
  width: 45%;
}

/* ==========================================================================
   CATEGORY & SEARCH GRID VIEWS
   ========================================================================== */
.view-section {
  padding-top: calc(var(--header-height) + 24px);
  min-height: 80vh;
}

.view-header {
  margin-bottom: 28px;
}

.view-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 30px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.genre-filter-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  max-width: 75%;
  scrollbar-width: none;
}

.genre-filter-scroll::-webkit-scrollbar {
  display: none;
}

.genre-chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.genre-chip:hover,
.genre-chip.active {
  background: #fff;
  color: #0b0b0f;
  border-color: #fff;
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  outline: none;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.media-grid .media-card {
  flex: none;
  min-width: 0;
}

.load-more-wrap {
  text-align: center;
  padding: 20px 0 60px 0;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  grid-column: 1 / -1;
}

.empty-state h3 {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 10px;
}

.empty-state p {
  max-width: 500px;
  margin: 0 auto 20px auto;
  line-height: 1.6;
}

.api-notice-box {
  background: rgba(229, 9, 20, 0.08);
  border: 1px dashed rgba(229, 9, 20, 0.4);
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #ffadb3;
  margin-bottom: 20px;
}

/* ==========================================================================
   MODALS (DETAIL & VIDEO PLAYER)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.modal-overlay.modal-open {
  display: flex;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.detail-modal-card {
  background: var(--bg-surface);
  border-radius: 12px;
  max-width: 950px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  border: 1px solid var(--border-subtle);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(11, 11, 15, 0.8);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  background: var(--accent-red);
  transform: rotate(90deg);
}

/* Detail Modal Header */
.detail-header {
  position: relative;
  min-height: 380px;
  background-size: cover;
  background-position: center top;
  display: flex;
  align-items: flex-end;
  padding: 40px 36px;
}

.detail-hero-content {
  z-index: 10;
  max-width: 680px;
}

.detail-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 6px;
}

.detail-tagline {
  font-size: 1.05rem;
  color: #d0d0dc;
  font-style: italic;
  margin-bottom: 14px;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.meta-votes {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.meta-lang {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}

.detail-btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Detail Body */
.detail-body-container {
  padding: 30px 36px 40px 36px;
}

.detail-columns {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  margin-bottom: 36px;
}

.detail-poster {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.genres-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.genre-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
}

.detail-section {
  margin-bottom: 28px;
}

.section-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.detail-overview {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #ccc;
}

/* Where to Watch */
.watch-providers-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 18px 20px;
}

.providers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.region-flag-pill {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.link-highlight {
  color: var(--accent-crimson);
  text-decoration: underline;
}

.provider-group {
  margin-bottom: 12px;
}

.provider-type-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.provider-badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.provider-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px 5px 6px;
  border-radius: 6px;
}

.provider-logo {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}

.provider-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #eee;
}

.provider-empty-note {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.provider-footer-link {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.provider-attribution-link {
  font-size: 0.8rem;
  color: var(--accent-crimson);
}

.provider-attribution-link:hover {
  text-decoration: underline;
}

/* Cast Grid */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.cast-card {
  text-align: center;
  background: var(--bg-card);
  padding: 10px;
  border-radius: 8px;
}

.cast-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px auto;
  display: block;
  border: 2px solid var(--border-subtle);
}

.cast-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-character {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Similar Titles in Modal */
.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

/* ==========================================================================
   VIDEO PLAYER MODAL
   ========================================================================== */
.video-modal-card {
  background: #000;
  border-radius: 12px;
  max-width: 1000px;
  width: 100%;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95);
}

.video-modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111116;
  border-bottom: 1px solid var(--border-subtle);
}

.video-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.video-modal-subtitle {
  font-size: 0.8rem;
  color: var(--accent-gold);
}

.video-responsive-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
}

.video-responsive-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-player-footer {
  padding: 14px 20px;
  background: #111116;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.video-legal-notice {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-yt-fallback {
  background: #c4302b;
  color: #fff;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
}

.btn-yt-fallback:hover {
  background: #e62117;
}

/* ==========================================================================
   LEGAL / STATIC PAGES
   ========================================================================== */
.legal-doc {
  max-width: 860px;
  margin: 0 auto;
  line-height: 1.8;
  color: #d0d0d8;
}

.legal-doc h1 {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 18px;
}

.legal-doc .lead {
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 30px;
}

.legal-doc h2 {
  font-size: 1.4rem;
  color: #fff;
  margin: 30px 0 12px 0;
}

.legal-doc ul, .legal-doc ol {
  margin: 12px 0 20px 24px;
}

.legal-doc code {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-crimson);
}

.contact-form-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 30px;
  margin-top: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent-red);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: #07070a;
  border-top: 1px solid var(--border-subtle);
  padding: 50px 32px 30px 32px;
  margin-top: auto;
}

.footer-container {
  max-width: 1600px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand-p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 12px;
  max-width: 380px;
}

.footer-col-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #fff;
}

.footer-attribution {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 30px;
}

.tmdb-notice {
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 800px;
  line-height: 1.5;
}

.tmdb-logo-img {
  height: 20px;
  opacity: 0.85;
}

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #1f1f2e;
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success .toast-icon { color: #2ecc71; font-weight: bold; }
.toast-error .toast-icon { color: #e74c3c; font-weight: bold; }
.toast-info .toast-icon { color: #3498db; }

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 1200px) {
  .media-card {
    flex: 0 0 calc((100% - (4 * 16px)) / 5);
  }
  .media-card.yt-card {
    flex: 0 0 calc((100% - (2 * 16px)) / 3);
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .media-card {
    flex: 0 0 calc((100% - (3 * 14px)) / 4);
    min-width: 150px;
  }
  .media-card.yt-card {
    flex: 0 0 calc((100% - 14px) / 2);
  }
  .detail-columns {
    grid-template-columns: 1fr;
  }
  .detail-poster-col {
    display: none;
  }
  .nav-menu {
    display: none;
  }
  .nav-menu.nav-mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 16px;
    align-items: flex-start;
  }
  .mobile-menu-toggle {
    display: block;
  }
}

@media (max-width: 600px) {
  .header-container {
    padding: 0 16px;
  }
  .main-content {
    padding: 0 16px 40px 16px;
  }
  .hero-banner {
    min-height: 70vh;
    padding: 100px 16px 40px 16px;
  }
  .media-card {
    flex: 0 0 calc((100% - 12px) / 2.3);
    min-width: 135px;
  }
  .media-card.yt-card {
    flex: 0 0 calc(100% - 30px);
  }
  .search-input {
    width: 110px;
  }
  .search-input:focus {
    width: 160px;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2rem;
  }
}
