/*
 * CineVerse — Netflix-Style UI Layer
 * netflix-ui.css
 *
 * Loaded AFTER the main style.css so every rule here
 * intentionally overrides the futuristic defaults with
 * a clean Netflix-inspired dark look.
 *
 * Design tokens used:
 *   --nf-bg       #0b0b0b   page background
 *   --nf-card     #141414   card / panel background
 *   --nf-red      #e50914   Netflix accent
 *   --nf-red-dim  rgba(229,9,20,.18)
 *   --nf-white    #ffffff
 *   --nf-gray     #808080
 */

/* ============================================================
   1. GLOBAL DESIGN TOKENS (NETFLIX PALETTE)
   ============================================================ */
:root {
  --nf-bg:         #0b0b0b;
  --nf-card:       #141414;
  --nf-elevated:   #1a1a1a;
  --nf-border:     rgba(255,255,255,0.08);
  --nf-red:        #e50914;
  --nf-red-hover:  #f40612;
  --nf-red-dim:    rgba(229,9,20,0.18);
  --nf-white:      #ffffff;
  --nf-gray:       #808080;
  --nf-gray-light: #b3b3b3;
  --nf-gold:       #f5a623;

  /* Override existing theme tokens */
  --cv-bg-primary:   var(--nf-bg);
  --cv-bg-secondary: #111111;
  --cv-bg-card:      var(--nf-card);
  --cv-bg-elevated:  var(--nf-elevated);
  --cv-accent:       var(--nf-red);
  --cv-accent-dim:   var(--nf-red-dim);
  --cv-accent-glow:  0 0 20px rgba(229,9,20,0.4);
  --cv-border:       var(--nf-border);
  --cv-border-hover: rgba(255,255,255,0.2);
  --cv-text-primary: var(--nf-white);
  --cv-text-secondary: var(--nf-gray-light);
  --cv-text-muted:   var(--nf-gray);
  --cv-purple:       var(--nf-red);
}

/* ============================================================
   2. BASE OVERRIDES
   ============================================================ */
body {
  background: var(--nf-bg);
  font-family: 'Inter', 'Roboto', 'DM Sans', sans-serif;
}

/* Scrollbar — Netflix dark */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #0b0b0b; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

a { color: var(--nf-white); }
a:hover { color: var(--nf-gray-light); }

/* ============================================================
   3. NAVBAR — Netflix black bar
   ============================================================ */
.cv-navbar {
  background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, transparent 100%);
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background 0.4s ease;
}

.cv-navbar.scrolled {
  background: #141414;
  border-bottom: none;
}

.cv-logo {
  font-family: 'Inter', 'Roboto', sans-serif;
  font-weight: 900;
  letter-spacing: -1px;
  font-size: 1.7rem;
  color: var(--nf-red) !important;
}
.cv-logo span { color: var(--nf-white); }

.cv-nav-links a {
  color: var(--nf-gray-light);
  font-size: 0.85rem;
  font-weight: 400;
}
.cv-nav-links a:hover,
.cv-nav-links .current-menu-item a {
  color: var(--nf-white);
  background: none;
}

.cv-nav-search {
  background: rgba(0,0,0,0.6);
  border-color: rgba(255,255,255,0.3);
  border-radius: 4px;
  padding: 6px 14px;
}
.cv-nav-search:focus-within {
  border-color: rgba(255,255,255,0.7);
  box-shadow: none;
}

.cv-btn-icon {
  background: transparent;
  border-color: transparent;
}
.cv-btn-icon:hover {
  border-color: transparent;
  color: var(--nf-white);
  background: rgba(255,255,255,0.1);
}

/* ============================================================
   4. BUTTONS — Netflix style
   ============================================================ */
.cv-btn-primary {
  background: var(--nf-white);
  color: #000;
  border-radius: 4px;
  font-weight: 700;
  box-shadow: none;
  letter-spacing: 0.02em;
}
.cv-btn-primary:hover {
  background: rgba(255,255,255,0.85);
  color: #000;
  transform: none;
  box-shadow: none;
}

/* The "Play" button on hero — red variant */
.cv-btn-play {
  background: var(--nf-red) !important;
  color: var(--nf-white) !important;
  border-radius: 4px;
}
.cv-btn-play:hover {
  background: var(--nf-red-hover) !important;
}

.cv-btn-secondary {
  background: rgba(109,109,110,0.7);
  color: var(--nf-white);
  border: none;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.cv-btn-secondary:hover {
  background: rgba(109,109,110,0.5);
  border: none;
  color: var(--nf-white);
}

.cv-btn-ghost {
  border-color: var(--nf-border);
  border-radius: 4px;
  color: var(--nf-gray-light);
}
.cv-btn-ghost:hover {
  border-color: rgba(255,255,255,0.4);
  color: var(--nf-white);
  background: rgba(255,255,255,0.08);
}

/* ============================================================
   5. HERO / BANNER — Netflix cinematic hero
   ============================================================ */
.cv-hero-slider {
  height: 70vh;
  min-height: 500px;
  max-height: 860px;
}

/* Full-brightness backdrop (Netflix shows full image, not dimmed) */
.cv-hero-bg img {
  opacity: 0.55;
  filter: none;
}

/* Strong left-side gradient so text is always readable */
.cv-hero-gradient {
  background: linear-gradient(
    77deg,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.4)  40%,
    rgba(0,0,0,0.0)  65%,
    rgba(0,0,0,0.0)  80%,
    rgba(0,0,0,0.7) 100%
  ),
  linear-gradient(
    180deg,
    rgba(0,0,0,0.0)  40%,
    rgba(0,0,0,0.3)  70%,
    rgba(0,0,0,0.9) 100%
  );
}

.cv-hero-content {
  padding: 0 60px 80px;
  margin-left: 0;
  max-width: 560px;
}

.cv-hero-badge {
  display: none; /* Netflix doesn't show this pill */
}

.cv-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
  letter-spacing: -0.02em;
}

.cv-hero-overview {
  font-size: 1.05rem;
  color: var(--nf-white);
  -webkit-line-clamp: 4;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.cv-hero-rating { color: var(--nf-gold); }
.cv-hero-year,
.cv-hero-runtime,
.cv-hero-genre { color: var(--nf-gray-light); }

.cv-hero-actions { gap: 10px; }

/* Slider dots — minimal Netflix style */
.cv-slider-dot {
  background: rgba(255,255,255,0.3);
  width: 10px;
  height: 3px;
  border-radius: 2px;
}
.cv-slider-dot.active,
.cv-slider-dot:hover {
  background: var(--nf-white);
  box-shadow: none;
  width: 24px;
}
.cv-slider-dots {
  background: transparent;
  backdrop-filter: none;
  gap: 4px;
}

/* Arrow buttons */
.cv-slider-btn {
  background: rgba(20,20,20,0.7);
  border-color: rgba(255,255,255,0.2);
}
.cv-slider-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  color: var(--nf-white);
  box-shadow: none;
  transform: translateY(-50%) scale(1.05);
}

/* ============================================================
   6. SECTION HEADERS — Netflix row title style
   ============================================================ */
.cv-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--nf-white);
  letter-spacing: 0.01em;
}

/* Remove the accent bar before titles */
.cv-section-title::before { display: none; }

.cv-view-all {
  color: var(--nf-gray-light);
  font-size: 0.82rem;
  font-weight: 500;
}
.cv-view-all:hover { color: var(--nf-white); gap: 4px; }

/* ============================================================
   7. POSTER CARDS — Netflix card style with hover scale
   ============================================================ */
.cv-card {
  background: var(--nf-card);
  border: none;
  border-radius: 4px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0.3s;
  cursor: pointer;
}

/* Netflix cards scale up and elevate with shadow */
.cv-card:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.8);
  border: none;
  z-index: 10;
}

.cv-card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;   /* poster aspect ratio — prevents layout shift */
  overflow: hidden;
  background: var(--nf-card, #141414);
}

.cv-card-poster picture {
  display: block;
  width: 100%;
  height: 100%;
}

.cv-card-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px 4px 0 0;
  /* image-rendering forces the browser to use high-quality downscaling,
     not pixelated nearest-neighbour, when the image is larger than display size */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transition: none;
}
.cv-card:hover .cv-card-poster img { transform: none; }

/* Overlay — only play button, dark gradient */
.cv-card-overlay {
  background: linear-gradient(0deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0) 50%);
  opacity: 0;
}
.cv-card:hover .cv-card-overlay { opacity: 1; }

/* Play button — Netflix red circle */
.cv-card-play {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.9);
  color: #000;
  border-radius: 50%;
  font-size: 1rem;
  transform: scale(0.7);
  transition: transform 0.2s ease;
}
.cv-card:hover .cv-card-play { transform: scale(1); }

/* Rating badge */
.cv-card-rating {
  background: rgba(0,0,0,0.75);
  color: var(--nf-gold);
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.72rem;
}

/* Type badge */
.cv-card-badge {
  background: var(--nf-red);
  color: #fff;
  border-radius: 2px;
  font-size: 0.6rem;
  font-weight: 700;
}
.cv-card-badge.tv { background: var(--nf-red); color: #fff; }
.cv-card-badge.new { background: #46d369; color: #000; }

.cv-card-info { padding: 10px 12px 14px; }

.cv-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--nf-white);
}

.cv-card-meta {
  font-size: 0.72rem;
  color: var(--nf-gray);
}

/* ============================================================
   8. HORIZONTAL SCROLL ROWS — Netflix rows
   ============================================================ */
.cv-row-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 12px 0 16px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}

.cv-row-scroll::-webkit-scrollbar { display: none; }

.cv-row-scroll .cv-card {
  flex-shrink: 0;
  /* 6 cards @ ~1400px container: (1400 - 48px padding - 5 gaps × 8px) / 6 ≈ 216px */
  width: clamp(140px, calc((min(100vw, 1400px) - 48px - 40px) / 6), 230px);
  scroll-snap-align: start;
}

/* Make sure card hover scales don't get clipped */
.cv-section { overflow: visible; }

/* ============================================================
   9. SECTION SPACING
   ============================================================ */
.cv-section { padding: 32px 0 8px; }
.cv-section + .cv-section { padding-top: 4px; }

/* ============================================================
   10. SINGLE MOVIE/TV PAGE — Netflix cinematic detail
   ============================================================ */
.cv-single-hero {
  min-height: 65vh;
}

.cv-single-backdrop img {
  opacity: 0.3;
}

/* Left+bottom gradient (Netflix single page style) */
.cv-single-backdrop::after {
  background:
    linear-gradient(77deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 60%),
    linear-gradient(180deg, rgba(0,0,0,0) 20%, rgba(11,11,11,1) 100%);
}

.cv-single-poster {
  border-radius: 4px;
  border: none;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8);
}

.cv-genre-pill {
  border-radius: 3px;
  border-color: rgba(255,255,255,0.2);
  color: var(--nf-gray-light);
  font-size: 0.72rem;
}
.cv-genre-pill:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
  color: var(--nf-white);
}

/* ============================================================
   11. YOU MAY ALSO LIKE — horizontal row on single pages
   ============================================================ */
.cv-recs-row-section {
  padding: 32px 0 48px;
}

.cv-recs-row-section .cv-row-scroll .cv-card {
  width: clamp(140px, calc((min(100vw, 1400px) - 48px - 40px) / 6), 230px);
  max-width: 230px;
}

/* Override the grid layout from single-movie.php — use row instead */
.cv-grid.cv-grid-4.cv-recs-grid-override {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 12px;
}
.cv-grid.cv-grid-4.cv-recs-grid-override::-webkit-scrollbar { display: none; }
.cv-grid.cv-grid-4.cv-recs-grid-override .cv-card-wrap {
  flex-shrink: 0;
  width: calc((100vw - 48px - 5 * 8px) / 6);
  max-width: 220px;
  min-width: 140px;
}

/* ============================================================
   12. CONTINUE WATCHING — Netflix progress style
   ============================================================ */
.cv-cw-card { width: 170px; }

.cv-cw-poster { border-radius: 4px; }

.cv-cw-play-btn {
  background: rgba(255,255,255,0.9);
  color: #000;
}

.cv-cw-progress-fill {
  background: var(--nf-red);
}

/* ============================================================
   13. UPCOMING PAGE — Netflix upcoming banner style
   ============================================================ */
.cv-upcoming-header {
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
  border-bottom: none;
}

.cv-upcoming-eyebrow { color: var(--nf-red); }

.cv-upcoming-date-badge {
  background: rgba(229,9,20,0.12);
  border-color: rgba(229,9,20,0.25);
  color: var(--nf-red);
  border-radius: 3px;
  font-size: 0.7rem;
}
.cv-upcoming-date-badge.today {
  background: rgba(70,211,105,0.15);
  border-color: rgba(70,211,105,0.3);
  color: #46d369;
}
.cv-upcoming-date-badge.soon {
  background: rgba(229,9,20,0.15);
  border-color: rgba(229,9,20,0.35);
  color: var(--nf-red);
}
.cv-upcoming-card-wrap:hover .cv-upcoming-date-badge {
  background: rgba(229,9,20,0.22);
}

/* ============================================================
   14. RATING CIRCLE — Netflix uses text not circle
   ============================================================ */
.cv-rating-circle {
  background: none;
  width: auto;
  height: auto;
  border-radius: 0;
}
.cv-rating-circle::after { display: none; }
.cv-rating-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--nf-gold);
  position: static;
}

/* ============================================================
   15. CAST SECTION
   ============================================================ */
.cv-cast-photo {
  border-color: rgba(255,255,255,0.1);
  border-radius: 50%; /* circular avatars */
}
.cv-cast-card:hover .cv-cast-photo {
  border-color: var(--cv-accent, #00D4FF);
}

/* ============================================================
   16. FOOTER
   ============================================================ */
.cv-footer {
  background: #141414;
  border-top-color: rgba(255,255,255,0.1);
}
.cv-footer-logo { color: var(--nf-white); }
.cv-footer-logo span { color: var(--nf-red); }
.cv-social-link:hover {
  border-color: rgba(255,255,255,0.3);
  color: var(--nf-white);
}

/* ============================================================
   17. TOAST / NOTIFICATIONS
   ============================================================ */
.cv-toast {
  background: var(--nf-elevated);
  border-color: rgba(255,255,255,0.1);
}
.cv-toast.success .cv-toast-icon { color: #46d369; }

/* ============================================================
   18. WATCHLIST BUTTON
   ============================================================ */
.cv-watchlist-btn {
  background: rgba(42,42,42,0.9);
  border-color: rgba(255,255,255,0.4);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  font-size: 0;
  gap: 0;
}
.cv-watchlist-btn svg { width: 18px; height: 18px; }
.cv-watchlist-btn:hover,
.cv-watchlist-btn.active {
  background: rgba(255,255,255,0.2);
  border-color: var(--nf-white);
  color: var(--nf-white);
}

/* ============================================================
   19. PAGINATION
   ============================================================ */
.cv-pagination .page-numbers {
  background: var(--nf-card);
  border-color: rgba(255,255,255,0.15);
  border-radius: 4px;
  color: var(--nf-gray-light);
}
.cv-pagination .page-numbers:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
  color: var(--nf-white);
}
.cv-pagination .page-numbers.current {
  background: var(--nf-red);
  border-color: var(--nf-red);
  color: #fff;
  box-shadow: none;
}

/* ============================================================
   FIX: Keep 6-column grids at 6 columns (base theme downgrades at 1200px)
   ============================================================ */
.cv-grid-6 {
  grid-template-columns: repeat(6, 1fr) !important;
}

@media (max-width: 1200px) {
  .cv-grid-6 { grid-template-columns: repeat(6, 1fr) !important; }
}

@media (max-width: 1024px) {
  .cv-grid-6 { grid-template-columns: repeat(4, 1fr) !important; }
}

@media (max-width: 768px) {
  .cv-grid-6 { grid-template-columns: repeat(3, 1fr) !important; gap: 12px !important; }
}

@media (max-width: 480px) {
  .cv-grid-6 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  /* Enforce column equality — grid children must be able to shrink */
  .cv-grid-6 > * { min-width: 0; width: 100%; }
}

/* ============================================================
   21. MOBILE RESPONSIVENESS
   ============================================================ */
@media (max-width: 768px) {
  .cv-hero-slider {
    height: 45vh;
    min-height: 360px;
    max-height: 520px;
  }

  .cv-hero-content {
    padding: 0 20px 48px;
  }

  .cv-hero h1 { font-size: 1.6rem; }

  .cv-hero-overview { font-size: 0.9rem; -webkit-line-clamp: 3; }

  /* Mobile: ~3 cards visible */
  .cv-row-scroll .cv-card { width: calc((100vw - 32px - 2 * 8px) / 3); min-width: 120px; max-width: 160px; }
  .cv-cw-card { width: 130px; }

  /* Mobile nav hamburger menu */
  .cv-mobile-menu {
    background: rgba(0,0,0,0.97);
  }
  .cv-mobile-menu a { color: var(--nf-white); font-size: 1.3rem; }

  /* Mobile Sign In button — red CTA, not the white desktop button */
  .cv-mobile-signin-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 14px 32px;
    background: var(--nf-red);
    color: var(--nf-white) !important;
    font-size: 1rem !important;
    font-weight: 700;
    border-radius: 4px;
    text-align: center;
    letter-spacing: 0.03em;
    transition: background 0.2s ease;
  }
  .cv-mobile-signin-btn:hover {
    background: var(--nf-red-hover);
    color: var(--nf-white) !important;
  }
}

@media (max-width: 480px) {
  .cv-hero-slider {
    height: 45vh;
    min-height: 300px;
    max-height: 420px;
  }

  /* Small phones: ~2.5 cards visible */
  .cv-row-scroll .cv-card { width: calc((100vw - 32px) / 2.5); min-width: 110px; max-width: 150px; }
  .cv-cw-card { width: 110px; }
}

/* ============================================================
   22. LAZY LOADING POSTER ANIMATION
   ============================================================ */
.cv-card-poster img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cv-card-poster img[loading="lazy"].loaded,
.cv-card-poster img:not([loading]) {
  opacity: 1;
}

/* ============================================================
   CAST / PROFILE PHOTO — circular avatar style
   ============================================================ */
.cv-cast-photo {
  width: 90px;
  height: 90px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--cv-bg-card, #1a1d29);
  margin: 0 auto 10px;
  border: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.cv-cast-card:hover .cv-cast-photo {
  border-color: var(--cv-accent, #00D4FF);
}

.cv-cast-photo picture {
  display: block;
  width: 100%;
  height: 100%;
}

.cv-cast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Cast card layout fix for circle photos */
.cv-cast-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cv-cast-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cv-text-primary, #F0F4FF);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cv-cast-character {
  font-size: 0.75rem;
  color: var(--cv-text-muted, #8B9DC3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Actor profile page — large hero photo */
.cv-actor-photo img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: inherit;
}

/* Episode stills — 16:9 aspect */
.cv-episode-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--cv-bg-card, #1a1d29);
}

.cv-episode-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Continue Watching card poster */
.cv-cw-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ============================================================
   23. HOVER PREVIEW INFO (Netflix info panel below card)
   ============================================================ */
.cv-card-hover-info {
  position: absolute;
  bottom: -80px;
  left: 0;
  right: 0;
  background: var(--nf-elevated);
  border-radius: 0 0 4px 4px;
  padding: 10px 12px;
  display: none;
  z-index: 20;
  box-shadow: 0 8px 20px rgba(0,0,0,0.7);
}
.cv-card:hover .cv-card-hover-info { display: block; }

.cv-card-hover-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.cv-card-hover-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--nf-white);
  margin-bottom: 3px;
}

.cv-card-hover-meta {
  font-size: 0.72rem;
  color: var(--nf-gray-light);
  display: flex;
  gap: 8px;
}

.cv-card-hover-match {
  color: #46d369;
  font-weight: 700;
}

/* ============================================================
   24. MY LIST BUTTON (Add to List)
   ============================================================ */
.cv-btn-mylist {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(42,42,42,0.9);
  border: 2px solid rgba(255,255,255,0.5);
  color: var(--nf-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0;
}
.cv-btn-mylist:hover {
  border-color: var(--nf-white);
  background: rgba(255,255,255,0.15);
}

/* ============================================================
   25. SEARCH OVERLAY — Netflix style
   ============================================================ */
.cv-search-hero {
  background: linear-gradient(180deg, #141414 0%, transparent 100%);
}
.cv-search-box {
  background: var(--nf-card);
  border-color: rgba(255,255,255,0.2);
  border-radius: 4px;
}
.cv-search-box:focus-within {
  border-color: rgba(255,255,255,0.6);
  box-shadow: none;
}
.cv-search-submit {
  background: var(--nf-red);
  border-radius: 3px;
}
.cv-search-submit:hover { background: var(--nf-red-hover); }

/* ============================================================
   26. GENRE PILLS ON BROWSE / TRENDING
   ============================================================ */
.cv-filter-select {
  background: var(--nf-card);
  border-color: rgba(255,255,255,0.2);
  color: var(--nf-gray-light);
  border-radius: 4px;
}
.cv-filter-select:focus {
  border-color: rgba(255,255,255,0.6);
  color: var(--nf-white);
  outline: none;
}

.cv-trending-tab {
  color: var(--nf-gray-light);
  border-radius: 3px;
}
.cv-trending-tab.active {
  background: var(--nf-white);
  color: #000;
}

/* ============================================================
   TRENDING PAGE — Ranked grid cards
   Rank numbers sit above each card without causing unequal
   row heights (old negative-top approach broke mobile layout).
   ============================================================ */
.cv-trending-rank-wrap {
  display: flex;
  flex-direction: column;
  /* CRITICAL: without min-width:0, grid items won't shrink below
     their content size — a large rank number blows out the column */
  min-width: 0;
  width: 100%;
}

/* Ensure the card fills the wrapper and doesn't overflow */
.cv-trending-rank-wrap .cv-card {
  width: 100%;
  min-width: 0;
}

.cv-trending-rank-num {
  font-family: var(--cv-font-display, 'Inter', sans-serif);
  font-size: 2rem;
  font-weight: 900;
  opacity: .65;
  line-height: 1;
  padding: 0 0 6px 4px;
  /* Prevent the number from widening the column */
  overflow: hidden;
  white-space: nowrap;
}

/* Scale rank number down on mobile so it doesn't crowd the card */
@media (max-width: 768px) {
  .cv-trending-rank-num { font-size: 1.4rem; padding-bottom: 4px; }
}
@media (max-width: 480px) {
  .cv-trending-rank-num { font-size: 1.1rem; padding-bottom: 3px; }
}

/* ============================================================
   27. EPISODE LIST (single-tv.php)
   ============================================================ */
.cv-episode-card {
  background: var(--nf-card);
  border-color: rgba(255,255,255,0.06);
  border-radius: 4px;
}
.cv-episode-card:hover,
.cv-episode-card.active {
  background: var(--nf-elevated);
  border-color: rgba(255,255,255,0.15);
}
.cv-episode-progress-bar { background: rgba(255,255,255,0.1); }
.cv-episode-progress-bar .cv-episode-progress-fill,
.cv-episode-progress-fill { background: var(--nf-red); }

.cv-season-select {
  background: var(--nf-card);
  border-color: rgba(255,255,255,0.2);
  color: var(--nf-white);
  border-radius: 4px;
}

/* ============================================================
   28. VIDEO PLAYER PAGE
   ============================================================ */
.cv-server-btn {
  background: var(--nf-card);
  border-color: rgba(255,255,255,0.1);
  color: var(--nf-gray-light);
  border-radius: 4px;
}
.cv-server-btn:hover,
.cv-server-btn.active {
  background: var(--nf-red-dim);
  border-color: var(--nf-red);
  color: var(--nf-white);
}

/* ============================================================
   29. KEYWORD & BADGE ELEMENTS
   ============================================================ */
.cv-keyword-pill {
  background: rgba(229,9,20,0.1);
  border-color: rgba(229,9,20,0.25);
  color: #ff6b6b;
  border-radius: 3px;
}
.cv-keyword-pill:hover {
  background: rgba(229,9,20,0.22);
  border-color: rgba(229,9,20,0.5);
  color: var(--nf-white);
}

/* ============================================================
   30. SKELETON LOADERS
   ============================================================ */
.cv-skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #222 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: nf-shimmer 1.6s infinite;
}
@keyframes nf-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   31. AUTH PAGES (login / register) — Netflix style
   ============================================================ */
.cv-auth-card {
  background: rgba(0,0,0,0.75);
  border: none;
  border-radius: 4px;
  backdrop-filter: blur(0px);
}
.cv-auth-input {
  background: #333;
  border-color: #333;
  border-radius: 4px;
  color: var(--nf-white);
}
.cv-auth-input:focus {
  border-color: #aaa;
  box-shadow: none;
}
.cv-auth-submit {
  background: var(--nf-red);
  color: var(--nf-white);
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
}
.cv-auth-submit:hover {
  background: var(--nf-red-hover);
}
.cv-auth-title { font-size: 1.8rem; font-weight: 700; }

/* ============================================================
   32. HOVER: LAZY IMAGE LOADED
   ============================================================ */
img.cv-lazy { opacity: 0; transition: opacity 0.4s ease; }
img.cv-lazy.cv-loaded { opacity: 1; }

/* ============================================================
   33. COUNTRY PAGE & BROWSE FILTER PILLS  (v2.3.0)
   ============================================================ */

/* Generic filter pill — used on country page type switcher & Browse */
.cv-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--cv-border);
  background: var(--cv-bg-card);
  color: var(--cv-text-secondary);
  font-size: .8rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
  white-space: nowrap;
}
.cv-filter-pill:hover {
  background: rgba(0,212,255,.08);
  border-color: var(--cv-accent);
  color: var(--cv-accent);
}
.cv-filter-pill.active {
  background: var(--cv-accent);
  border-color: var(--cv-accent);
  color: #000;
  font-weight: 700;
}

/* Country card type badge (Movie / TV overlay) */
.cv-card-type-badge {
  display: inline-block;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.4;
}

/* Country archive pagination */
.cv-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.cv-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--cv-border);
  background: var(--cv-bg-card);
  color: var(--cv-text-primary);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s, border-color .18s;
}
.cv-page-btn:hover {
  background: rgba(0,212,255,.08);
  border-color: var(--cv-accent);
  color: var(--cv-accent);
}
.cv-page-info {
  font-size: .8rem;
  color: var(--cv-text-muted);
  padding: 0 4px;
}

/* Country browse filter: scrollable country chip container */
.cv-browse-filters .cv-country-scroll {
  max-height: 160px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--cv-border) transparent;
}
.cv-browse-filters .cv-country-scroll::-webkit-scrollbar { width: 4px; }
.cv-browse-filters .cv-country-scroll::-webkit-scrollbar-track { background: transparent; }
.cv-browse-filters .cv-country-scroll::-webkit-scrollbar-thumb { background: var(--cv-border); border-radius: 2px; }

/* ── Mobile: country page hero & filter bar ─────────────────── */
@media (max-width: 600px) {
  .cv-filter-pill { font-size: .72rem; padding: 5px 10px; }
  .cv-page-btn    { font-size: .8rem;  padding: 7px 14px; }
}

/* ============================================================
   34. WATCH PROVIDERS BADGES  (v2.3.0)
   ============================================================ */
.cv-watch-providers {
  padding-top: 4px;
}
.cv-provider-badge {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cv-bg-secondary);
  border: 1px solid var(--cv-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.cv-provider-badge:hover {
  transform: scale(1.1);
  border-color: var(--cv-accent);
  box-shadow: 0 0 0 2px rgba(0,212,255,.25);
}
.cv-provider-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}
a .cv-provider-badge { cursor: pointer; }

/* Mobile */
@media (max-width: 480px) {
  .cv-provider-badge { width: 36px; height: 36px; border-radius: 7px; }
  .cv-provider-badge img { border-radius: 6px; }
}

/* ============================================================
   35. HERO PROVIDER BADGES  (v2.4.0)
   ============================================================ */
.cv-hero-providers {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.cv-hero-providers-label {
  font-size: .7rem;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  margin-right: 2px;
}
.cv-hero-provider-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  transition: transform .15s, border-color .15s, background .15s;
  text-decoration: none;
  flex-shrink: 0;
}
a.cv-hero-provider-badge:hover {
  transform: scale(1.12);
  border-color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.15);
}
.cv-hero-provider-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}

/* Mobile: slightly smaller badges */
@media (max-width: 480px) {
  .cv-hero-provider-badge { width: 30px; height: 30px; border-radius: 6px; }
  .cv-hero-provider-badge img { border-radius: 5px; }
  .cv-hero-providers-label { font-size: .6rem; }
  .cv-hero-providers { gap: 6px; margin-top: 12px; }
}

/* ============================================================
   36. STREAMING PROVIDERS HOMEPAGE SECTION  (v2.5.2)
   Horizontal scroll row with prev/next slider buttons + auto-slide
   ============================================================ */
.cv-streaming-section { padding-top: 0; }

/* Slider wrapper — positions the nav buttons */
.cv-streaming-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Prev / Next arrow buttons */
.cv-streaming-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--cv-border);
  border-radius: 50%;
  color: var(--cv-text-primary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background .18s, border-color .18s, opacity .18s;
  z-index: 2;
  padding: 0;
}
.cv-streaming-btn:hover {
  background: var(--cv-accent, #e50914);
  border-color: var(--cv-accent, #e50914);
  color: #fff;
}
.cv-streaming-btn:disabled,
.cv-streaming-btn[data-hidden] {
  opacity: 0;
  pointer-events: none;
}

/* Horizontal scroll row — same base as .cv-row-scroll */
.cv-streaming-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 6px;
  scroll-behavior: smooth;
  flex: 1;
}
.cv-streaming-row::-webkit-scrollbar { display: none; }

/* Hide buttons on mobile — touch scroll is enough */
@media (max-width: 768px) {
  .cv-streaming-btn { display: none; }
}

/* Individual provider tile */
.cv-streaming-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  width: 130px;
  padding: 20px 12px 16px;
  background: var(--cv-bg-card);
  border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-lg, 12px);
  text-decoration: none;
  scroll-snap-align: start;
  transition: background .18s, border-color .18s, transform .18s, box-shadow .18s;
  cursor: pointer;
}
.cv-streaming-tile:hover {
  background: rgba(0,212,255,.07);
  border-color: var(--cv-accent);
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.cv-streaming-tile-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--cv-bg-secondary);
  border: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.cv-streaming-tile-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  display: block;
}
.cv-streaming-tile-name {
  font-size: .78rem;
  font-weight: 700;
  color: var(--cv-text-primary);
  text-align: center;
  line-height: 1.3;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}
.cv-streaming-tile-count {
  font-size: .65rem;
  color: var(--cv-text-muted);
  text-align: center;
}

/* Mobile */
@media (max-width: 480px) {
  .cv-streaming-tile { width: 110px; padding: 16px 8px 12px; gap: 8px; }
  .cv-streaming-tile-logo { width: 58px; height: 58px; border-radius: 13px; }
  .cv-streaming-tile-logo img { border-radius: 12px; }
  .cv-streaming-tile-name { font-size: .72rem; }
  .cv-streaming-tile-count { display: none; }
}

/* ============================================================
   ACCESSIBILITY — focus-visible rings  (v2.5.4)
   Visible keyboard-focus indicator on every interactive element.
   Uses :focus-visible so mouse clicks are unaffected.
   ============================================================ */

/* Cards — poster link */
.cv-card-poster a:focus-visible,
.cv-card a:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Streaming provider tiles */
.cv-streaming-tile:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
}

/* Genre pills */
.cv-genre-pill:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
}

/* Cast cards */
.cv-cast-card:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
}

/* CW (continue watching) cards */
.cv-cw-card a:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Buttons — primary / secondary / ghost */
.cv-btn:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
}

/* Watchlist button */
.cv-watchlist-btn:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
}

/* Nav links */
.cv-nav-link:focus-visible,
.cv-nav-logo:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 4px;
  border-radius: 3px;
}

/* View-all / section links */
.cv-view-all:focus-visible,
.cv-section-link:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Hero slider buttons & dots */
.cv-slider-btn:focus-visible,
.cv-slider-dot:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
}

/* Streaming slider prev/next buttons */
.cv-streaming-btn:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
}

/* Row scroll arrow buttons */
.cv-row-arrow:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 3px;
}

/* ============================================================
   AD SLOTS — v2.5.5
   Desktop/mobile visibility + layout. Zero cost when empty.
   ============================================================ */

.cv-ad-slot {
  display: block;
  width: 100%;
  text-align: center;
  overflow: hidden;
  /* No min-height — slot collapses to nothing when empty */
}

/* Padding context — slots inside containers */
.cv-ad-slot--padded {
  padding: 16px 0;
}

/* Between-section slots get vertical breathing room */
.cv-ad-between {
  margin: 24px 0;
}

/* Sidebar ad wrapper */
.cv-ad-sidebar {
  margin-bottom: 24px;
  position: sticky;
  top: 90px; /* below fixed navbar */
}

/* Desktop-only unit */
.cv-ad-desktop {
  display: block;
}
.cv-ad-mobile {
  display: none;
}

/* Mobile: flip visibility */
@media (max-width: 767px) {
  .cv-ad-desktop { display: none; }
  .cv-ad-mobile  { display: block; }
}

/* Header ad bar — fixed position directly below the navbar.
   Always visible at the top of the viewport, below the nav.
   JS measures its height and updates --cv-ad-bar-height so all
   offset-dependent elements (mobile search bar, <main>) stay clear. */
.cv-ad-header-bar {
  position: fixed;
  top: var(--cv-nav-height, 70px);
  left: 0;
  right: 0;
  width: 100%;
  background: var(--cv-bg-primary, #070B14);
  border-bottom: 1px solid var(--cv-border);
  padding: 6px 0;
  text-align: center;
  z-index: 999; /* just below navbar z-index: 1000 */
}
/* Admin bar pushes navbar down — compensate */
.admin-bar .cv-ad-header-bar {
  top: calc(var(--cv-nav-height, 70px) + 32px);
}
@media screen and (max-width: 782px) {
  .admin-bar .cv-ad-header-bar {
    top: calc(var(--cv-nav-height, 70px) + 46px);
  }
}


/* Keep old class hidden */
.cv-ad-header-wrap { display: none; }

/* Footer ad wrap */
.cv-ad-footer-wrap {
  display: block;
  width: 100%;
  background: var(--cv-bg-primary, #070B14);
  border-top: 1px solid var(--cv-border);
  padding: 8px 0;
  text-align: center;
}

/* Watch page sidebar ad column */
.cv-watch-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .cv-watch-with-sidebar {
    grid-template-columns: 1fr;
  }
  .cv-watch-ad-sidebar { display: none; }
}

/* Single page sidebar ad column */
.cv-single-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1100px) {
  .cv-single-with-sidebar { grid-template-columns: 1fr; }
  .cv-single-ad-sidebar    { display: none; }
}
