/* =========================================================
   ZIZ TV — BROWSE PAGE
   ---------------------------------------------------------
   Display: Bebas Neue
   UI / Body: DM Sans

   Locked brand palette:
   Gold:       #FDC830
   Orange:     #F37335
   Background: #0a0a0f
   Surfaces:   #13131a / #1c1c26 / #242433
   Text:       #f0f0f0
   Muted:      #888899

   Note: the shared site nav (layouts/app.blade.php) is
   position:fixed, top:0, height:var(--nav-h) -- not part of
   document flow. .browse-intro and .filter-sticky below are
   offset by var(--nav-h) to clear it (the original ChatGPT
   mockup assumed its own non-fixed nav, so this needed
   adjusting on integration).
========================================================= */

:root {
  --gold: #FDC830;
  --orange: #F37335;
  --gradient: linear-gradient(135deg, #FDC830, #F37335);
  --bg: #0a0a0f;
  --surface-1: #13131a;
  --surface-2: #1c1c26;
  --surface-3: #242433;
  --text: #f0f0f0;
  --muted: #888899;
  --hairline: rgba(255,255,255,0.08);
  --display: "Bebas Neue", sans-serif;
  --body: "DM Sans", sans-serif;
  --page-width: 1440px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --ease: cubic-bezier(.22,.8,.26,1);
}

.page-width {
  width: min(calc(100% - 32px), var(--page-width));
  margin-inline: auto;
}

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


/* =========================================================
   PAGE INTRO
========================================================= */

.browse-intro {
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-h) + 52px) 0 52px;
}

.browse-intro::before {
  content: "BROWSE";
  position: absolute;
  top: 20px;
  right: -18px;
  pointer-events: none;
  font-family: var(--display);
  font-size: clamp(9rem, 32vw, 24rem);
  line-height: .8;
  color: rgba(255,255,255,.018);
  letter-spacing: -.02em;
}

.browse-heading {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: rgba(240,240,240,.62);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.page-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: var(--gradient);
}

.page-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4rem, 17vw, 8.5rem);
  font-weight: 400;
  line-height: .82;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.page-subtitle {
  max-width: 630px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.65;
}


/* =========================================================
   STICKY GENRE FILTER
========================================================= */

.filter-sticky {
  position: sticky;
  z-index: 50;
  top: var(--nav-h);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: rgba(10,10,15,.88);
  backdrop-filter: blur(18px);
}

.filter-shell {
  position: relative;
  width: min(100%, var(--page-width));
  margin-inline: auto;
}

.filter-shell::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0; right: 0; bottom: 0;
  width: 42px;
  pointer-events: none;
  background: linear-gradient(to left, rgba(10,10,15,.98), transparent);
}

.genre-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 11px max(16px, calc((100vw - var(--page-width)) / 2));
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

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

.genre-chip {
  position: relative;
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)), var(--surface-1);
  color: rgba(240,240,240,.64);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  scroll-snap-align: start;
  transition: color 180ms ease, border-color 180ms ease, transform 200ms var(--ease), background 180ms ease, box-shadow 180ms ease;
}

.genre-chip::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.24);
  transition: transform 200ms var(--ease), background 180ms ease;
}

.genre-chip:hover {
  color: var(--text);
  transform: translateY(-1px);
  border-color: rgba(253,200,48,.2);
  background: var(--surface-2);
}

.genre-chip:hover::before { background: var(--gold); }

.genre-chip.is-active {
  color: #0a0a0f;
  border-color: transparent;
  background: var(--gradient);
  box-shadow: 0 6px 18px rgba(243,115,53,.16);
}

.genre-chip.is-active::before {
  background: rgba(10,10,15,.58);
  transform: scale(1.15);
}


/* =========================================================
   RESULTS AREA
========================================================= */

.catalog-section { padding: 30px 0 88px; }

.results-bar {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.results-copy {
  margin: 0;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 500;
}

.results-copy strong { color: var(--text); font-weight: 600; }

.results-divider {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--hairline), transparent);
}


/* =========================================================
   DRAMA GRID
========================================================= */

.drama-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 24px 12px;
}

.drama-card { min-width: 0; }

.poster-shell {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  transform-origin: center bottom;
  transition: transform 320ms var(--ease), border-color 220ms ease, box-shadow 320ms var(--ease);
}

.poster-shell > img {
  height: 100%;
  object-fit: cover;
  transition: transform 650ms var(--ease), filter 320ms ease;
}

.poster-shell::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 42%, rgba(10,10,15,.16) 65%, rgba(10,10,15,.96) 100%);
  opacity: .74;
  transition: opacity 260ms ease;
}

.drama-card:hover .poster-shell {
  transform: perspective(760px) translateY(-7px) rotateX(1.5deg);
  border-color: rgba(253,200,48,.23);
  box-shadow: 0 22px 52px rgba(0,0,0,.42);
}

.drama-card:hover .poster-shell > img {
  transform: scale(1.045);
  filter: saturate(1.08) contrast(1.02);
}

.drama-card:hover .poster-shell::after { opacity: 1; }

.poster-badge {
  position: absolute;
  z-index: 5;
  top: 10px; left: 10px;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(10,10,15,.67);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.card-copy { padding: 10px 3px 0; }

.card-title {
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: .83rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.card-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 500;
}

.poster-overlay {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 260ms var(--ease);
}

.drama-card:hover .poster-overlay {
  opacity: 1;
  transform: translateY(0);
}

.overlay-play {
  width: 42px; height: 42px;
  margin-bottom: auto;
  margin-left: auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #0a0a0f;
  background: var(--gradient);
  box-shadow: 0 12px 26px rgba(243,115,53,.2);
  transform: scale(.92);
  transition: transform 200ms var(--ease);
}

.drama-card:hover .overlay-play { transform: scale(1); }

.overlay-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: .95;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.overlay-meta {
  margin-top: 5px;
  color: rgba(240,240,240,.63);
  font-size: .63rem;
  font-weight: 500;
}

@media (min-width: 900px) {
  .drama-grid { gap: 38px 18px; }
  .drama-card:nth-child(6n + 2),
  .drama-card:nth-child(6n + 5) { padding-top: 24px; }
}


/* =========================================================
   EMPTY STATE
========================================================= */

.empty-state {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 48px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at 50% 20%, rgba(253,200,48,.055), transparent 22rem), var(--surface-1);
  text-align: center;
}

.empty-state::before {
  content: "0";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%,-53%);
  pointer-events: none;
  font-family: var(--display);
  font-size: clamp(15rem, 40vw, 28rem);
  line-height: 1;
  color: rgba(255,255,255,.018);
}

.empty-state-inner { position: relative; z-index: 2; max-width: 500px; }

.empty-symbol {
  width: 68px; height: 68px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(253,200,48,.18);
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
}

.empty-symbol-inner {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gradient);
  opacity: .85;
}

.empty-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 10vw, 4.6rem);
  font-weight: 400;
  line-height: .9;
  text-transform: uppercase;
}

.empty-copy {
  max-width: 420px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.65;
}

.empty-action {
  min-height: 46px;
  margin-top: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #0a0a0f;
  background: var(--gradient);
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms ease;
}

.empty-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(243,115,53,.18);
}


/* =========================================================
   LOAD MORE
========================================================= */

.load-more-wrap {
  padding-top: 62px;
  display: flex;
  justify-content: center;
}

.load-more-button {
  position: relative;
  min-width: 190px;
  min-height: 50px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 999px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)), var(--surface-1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 200ms var(--ease), background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.load-more-button:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
  border-color: rgba(253,200,48,.24);
  box-shadow: 0 12px 34px rgba(0,0,0,.25);
}

.load-more-button::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(110deg, transparent 15%, rgba(253,200,48,.065), rgba(243,115,53,.05), transparent 85%);
  transition: opacity 180ms ease;
}

.load-more-button:hover::before { opacity: 1; }

.load-more-label, .loading-label { position: relative; z-index: 2; }

.loading-label { display: none; align-items: center; gap: 9px; }

.loading-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.load-more-button.is-loading { pointer-events: none; color: rgba(240,240,240,.72); }
.load-more-button.is-loading .load-more-label { display: none; }
.load-more-button.is-loading .loading-label { display: inline-flex; }

@keyframes spin { to { transform: rotate(360deg); } }


/* =========================================================
   RESPONSIVE GRID
========================================================= */

@media (min-width: 600px) {
  .drama-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 28px 14px; }
}

@media (min-width: 800px) {
  .browse-intro { padding: calc(var(--nav-h) + 92px) 0 66px; }
  .catalog-section { padding-top: 38px; }
  .drama-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

@media (min-width: 1024px) {
  .drama-grid { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 42px 18px; }
  .poster-overlay { padding: 15px; }
}

@media (min-width: 1320px) {
  .drama-grid { grid-template-columns: repeat(6, minmax(0,1fr)); gap: 46px 18px; }
}

@media (hover: none) {
  .poster-overlay { display: none; }
  .drama-card:hover .poster-shell { transform: none; box-shadow: none; }
  .drama-card:hover .poster-shell > img { transform: none; }
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
