/* Classic TV Pakistan — WebView-safe cinema background and complete programme artwork. */
:root { --ctp-gold: #e0bd67; }
html {
  min-height: 100%;
  background: #090704 !important;
}
body {
  min-height: 100vh;
  background-color: #090704 !important;
  background-image:
    radial-gradient(ellipse 110% 48% at 50% 0%, rgba(205,157,57,.30) 0%, rgba(115,72,24,.19) 38%, transparent 75%),
    radial-gradient(ellipse 70% 55% at 0% 38%, rgba(115,25,38,.23) 0%, transparent 78%),
    radial-gradient(ellipse 72% 58% at 100% 72%, rgba(172,116,31,.18) 0%, transparent 78%),
    linear-gradient(180deg,#171108 0%,#0d0a07 36%,#100907 72%,#070605 100%) !important;
  background-repeat: no-repeat !important;
  background-attachment: scroll !important;
}
/* Prevent opaque app wrappers from masking the cinematic background. */
#app, main, .rows-container, .carousel-row, .browse-view, .browse-grid,
.page-content, .content-container { background-color: transparent !important; }
.topbar {
  background: linear-gradient(90deg,rgba(5,5,5,.98),rgba(30,21,9,.98),rgba(5,5,5,.98)) !important;
  border-bottom: 1px solid rgba(224,189,103,.5) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.36),0 1px 0 rgba(224,189,103,.1) !important;
}
/* Full image is the priority: do not crop programme thumbnails in carousels or grids. */
.card-media {
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  overflow: hidden !important;
  background: #100d08 !important;
}
.card-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform: none;
}
.netflix-card:hover .card-media img { transform: none !important; }
@media (max-width: 850px) {
  html, body { width: 100%; min-width: 0; overflow-x: hidden; }
  .topbar {
    box-sizing: border-box;
    width: 100%;
    min-height: 74px;
    gap: 9px;
    padding: 8px 12px;
  }
  .brand-group { flex: 1 1 auto; min-width: 0; gap: 8px; }
  .brand { gap: 8px; min-width: 0; }
  .brand-logo { width: 42px !important; height: 42px !important; flex: 0 0 42px; }
  .brand-titles { min-width: 0; }
  .brand-name {
    font-family: var(--font-sans,"Outfit",sans-serif);
    font-size: clamp(14px,4.1vw,19px) !important;
    font-weight: 900;
    letter-spacing: .35px;
    line-height: 1.15;
    color: #f3d58b !important;
    text-shadow: 0 1px 18px rgba(216,179,90,.32);
    white-space: normal;
  }
  .brand-sub { font-size: 9px; line-height: 1.2; }
  /* Hide injected account/admin controls from the compact public WebView header. */
  #topbarAuthArea, #topbarAuthArea *, .topbar-right > #topbarAuthArea {
    display: none !important;
    visibility: hidden !important;
  }
  .topbar-right { flex: 0 0 auto; min-width: 0 !important; }
  .hero-billboard { min-height: 320px !important; max-height: 400px !important; }
  .hero-slides { min-height: 320px !important; }
  .netflix-card { flex: 0 0 190px; width: 190px; min-width: 190px; max-width: 190px; }
  .carousel-track { gap: 10px; }
  .rows-container { gap: 28px; }
}
/* Desktop cards are larger without changing mobile carousel sizing. */
@media (min-width: 851px) {
  .brand-name { font-size: clamp(22px,2vw,30px); font-weight: 900; letter-spacing: 1px; color: #f3d58b; text-shadow: 0 1px 22px rgba(216,179,90,.3); }
  .brand-logo { width: 54px; height: 54px; }
  .rows-container { max-width: 1800px; margin-inline: auto; }
  .carousel-track { gap: clamp(14px,1.5vw,24px) !important; }
  .netflix-card {
    flex: 0 0 clamp(280px,24vw,380px) !important;
    width: clamp(280px,24vw,380px) !important;
    min-width: clamp(280px,24vw,380px) !important;
    max-width: clamp(280px,24vw,380px) !important;
  }
  .card-title { font-size: 15px; }
  .card-info { padding: 10px 4px 12px; }
  .browse-view { max-width: 1800px; }
  .browse-grid { grid-template-columns: repeat(auto-fill,minmax(280px,1fr)) !important; gap: clamp(16px,1.8vw,28px) !important; }
  .browse-grid .netflix-card { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
}


/* Final visual correction: cooler near-black palette and uncropped featured artwork. */
body {
  background-color: #050505 !important;
  background-image:
    radial-gradient(ellipse 82% 34% at 50% 0%, rgba(184,143,49,.13) 0%, transparent 72%),
    radial-gradient(ellipse 48% 44% at 0% 42%, rgba(105,18,35,.15) 0%, transparent 78%),
    radial-gradient(ellipse 48% 46% at 100% 72%, rgba(105,20,34,.10) 0%, transparent 80%),
    linear-gradient(180deg,#090909 0%,#050505 44%,#080607 76%,#040404 100%) !important;
}
/* The hero artwork is a thumbnail too: fit the entire source image in its frame. */
.hero-backdrop {
  background-size: contain !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-color: #050505 !important;
}
.hero-slide.active .hero-backdrop {
  animation: none !important;
  transform: none !important;
}
.hero-vignette {
  background:
    linear-gradient(0deg,rgba(0,0,0,.92) 0%,rgba(0,0,0,.55) 22%,rgba(0,0,0,.10) 58%,rgba(0,0,0,.06) 100%),
    linear-gradient(90deg,rgba(0,0,0,.48) 0%,rgba(0,0,0,.12) 42%,transparent 76%) !important;
}
@media (max-width: 850px) {
  .hero-billboard { background: #050505 !important; }
  .hero-backdrop { background-size: contain !important; background-position: center center !important; }
}


/* Hero redesign: image first, then actions, then readable English/Urdu titles below. */
.hero-billboard {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  background: #050505 !important;
}
.hero-slides {
  height: auto !important;
  min-height: 0 !important;
  position: relative !important;
}
.hero-slide {
  display: none !important;
  position: relative !important;
  inset: auto !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.hero-slide.active { display: flex !important; flex-direction: column !important; }
.hero-backdrop {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  flex: 0 0 auto !important;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #050505 !important;
}
.hero-vignette { display: none !important; }
.hero-foreground {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  padding: 12px clamp(16px,4vw,52px) 22px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 7px !important;
  background: linear-gradient(180deg,#080808 0%,#050505 100%) !important;
  transform: none !important;
}
.hero-actions { order: 1 !important; margin: 0 0 5px !important; }
.hero-title { order: 2 !important; max-width: 100% !important; font-size: clamp(21px,2.5vw,34px) !important; line-height: 1.25 !important; }
.hero-urdu { order: 3 !important; max-width: 100% !important; font-size: clamp(17px,2vw,25px) !important; line-height: 1.8 !important; }
.hero-dots { top: 12px !important; bottom: auto !important; right: 12px !important; }
@media (max-width: 850px) {
  .hero-billboard { height: auto !important; min-height: 0 !important; max-height: none !important; }
  .hero-slides { min-height: 0 !important; }
  .hero-backdrop { aspect-ratio: 16 / 9 !important; width: 100% !important; }
  .hero-foreground { padding: 10px 16px 18px !important; gap: 6px !important; }
  .hero-actions { order: 1 !important; display: flex !important; flex-wrap: wrap !important; gap: 8px !important; }
  .hero-title { order: 2 !important; font-size: clamp(19px,5.2vw,27px) !important; }
  .hero-urdu { order: 3 !important; font-size: clamp(16px,4.2vw,21px) !important; }
}


/* Hero title block stays opposite the Play/My List controls, never underneath them. */
.hero-foreground {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto !important;
  grid-template-areas: "title actions" "urdu actions" !important;
  align-items: center !important;
  column-gap: clamp(10px, 2vw, 24px) !important;
  row-gap: 3px !important;
}
.hero-title {
  grid-area: title !important;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  margin: 0 !important;
}
.hero-urdu {
  grid-area: urdu !important;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  margin: 0 !important;
}
.hero-actions {
  grid-area: actions !important;
  justify-self: end !important;
  align-self: center !important;
  display: flex !important;
  flex: 0 0 auto !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  gap: 8px !important;
  margin: 0 !important;
}
.hero-btn-play, .hero-btn-mylist { flex: 0 0 auto !important; white-space: nowrap !important; }
@media (max-width: 520px) {
  .hero-foreground {
    grid-template-columns: minmax(0, 1fr) auto !important;
    column-gap: 8px !important;
    padding: 10px 12px 16px !important;
  }
  .hero-title { font-size: clamp(15px, 4.2vw, 21px) !important; line-height: 1.2 !important; }
  .hero-urdu { font-size: clamp(13px, 3.6vw, 17px) !important; line-height: 1.65 !important; }
  .hero-actions { gap: 5px !important; }
  .hero-btn-play, .hero-btn-mylist { padding-inline: 9px !important; font-size: 12px !important; }
}


/* Correct hero detail row: Play/Save on the left, titles to their right. */
.hero-foreground {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  grid-template-areas: "actions title" "actions urdu" !important;
  align-items: center !important;
  justify-items: start !important;
  column-gap: clamp(10px, 2.4vw, 26px) !important;
  row-gap: 2px !important;
}
.hero-actions {
  grid-area: actions !important;
  justify-self: start !important;
  align-self: center !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  gap: 8px !important;
  margin: 0 !important;
}
.hero-title {
  grid-area: title !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow-wrap: anywhere !important;
  line-height: 1.25 !important;
}
.hero-urdu {
  grid-area: urdu !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow-wrap: anywhere !important;
  line-height: 1.65 !important;
}
.hero-btn-play, .hero-btn-mylist {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}
@media (max-width: 520px) {
  .hero-foreground {
    grid-template-columns: auto minmax(0, 1fr) !important;
    column-gap: 8px !important;
    padding: 10px 12px 16px !important;
  }
  .hero-actions { gap: 5px !important; }
  .hero-btn-play, .hero-btn-mylist {
    padding-inline: 8px !important;
    font-size: 11px !important;
  }
  .hero-title { font-size: clamp(14px, 3.8vw, 20px) !important; }
  .hero-urdu { font-size: clamp(12px, 3.3vw, 16px) !important; }
}


/* Keep the hero details row anchored to the right edge of the content area. */
.hero-foreground {
  width: 100% !important;
  box-sizing: border-box !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  justify-content: stretch !important;
  padding-right: clamp(16px, 4vw, 52px) !important;
}
.hero-title, .hero-urdu {
  justify-self: stretch !important;
  text-align: right !important;
}
@media (max-width: 520px) {
  .hero-foreground { padding-right: 12px !important; }
}


/* Responsive recovery: keep hero artwork filling the same frame at every viewport. */
.hero-billboard { position: relative !important; }
.hero-slides { width: 100% !important; }
.hero-backdrop {
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}
.hero-dots {
  position: absolute !important;
  z-index: 30 !important;
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.hero-dot { flex: 0 0 auto !important; cursor: pointer !important; }
.carousel-track { min-width: 0; max-width: 100%; touch-action: pan-x pan-y; }
.card-media, .card-media img { box-sizing: border-box; }
.netflix-card .card-media img { object-fit: cover !important; object-position: center !important; }
.browse-search-status {
  margin: 10px 0 0;
  min-height: 22px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}
.browse-search-status:empty { display: none; }
