/* =========================================================
   ZIZ TV — SEARCH / DISCOVERY PAGE
   ---------------------------------------------------------
   Note: the shared site nav (layouts/app.blade.php) is
   position:fixed, top:0, height:var(--nav-h) -- not part of
   document flow. .search-hero below is offset by var(--nav-h)
   to clear it (the ChatGPT mockup assumed its own non-fixed
   nav, so this needed adjusting on integration, same as the
   Browse page).

   Card classes (.drama-card, .poster-shell, .card-copy, etc)
   intentionally match browse.css -- both pages share the same
   frontend.partials.drama-card Blade partial, one markup
   source for both.
========================================================= */

: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;
}


/* =========================================================
   SEARCH HERO
========================================================= */

.search-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-h) + 72px) 0 38px;
}

.search-hero::before {
  content: "SEARCH";
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  font-family: var(--display);
  font-size: clamp(10rem, 34vw, 25rem);
  line-height: .75;
  letter-spacing: -.015em;
  color: rgba(255,255,255,.017);
  white-space: nowrap;
}

.search-hero::after {
  content: "";
  position: absolute;
  left: 50%; top: 55%;
  width: 600px; height: 240px;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(253,200,48,.055), rgba(243,115,53,.025) 45%, transparent 70%);
  filter: blur(8px);
}

.search-hero-inner {
  position: relative;
  z-index: 3;
  width: min(calc(100% - 32px), 960px);
  margin-inline: auto;
  text-align: center;
}

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

.page-eyebrow::before, .page-eyebrow::after {
  content: "";
  width: 23px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(253,200,48,.8));
}

.page-eyebrow::after {
  background: linear-gradient(90deg, rgba(243,115,53,.8), transparent);
}

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

.page-subtitle {
  max-width: 590px;
  margin: 17px auto 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.65;
}


/* =========================================================
   SEARCH CONTROL
========================================================= */

.search-form { margin-top: 32px; }

.search-box {
  position: relative;
  width: 100%;
  padding: 1px;
  border-radius: 22px;
  background: rgba(255,255,255,.09);
  box-shadow: 0 18px 60px rgba(0,0,0,.26);
  transition: background 220ms ease, box-shadow 250ms ease, transform 250ms var(--ease);
}

.search-box::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  background: var(--gradient);
  filter: blur(7px);
  transition: opacity 220ms ease;
}

.search-box:focus-within {
  background: var(--gradient);
  transform: translateY(-2px);
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
}

.search-box:focus-within::before { opacity: .14; }

.search-field {
  min-height: 68px;
  display: grid;
  grid-template-columns: 25px minmax(0,1fr) 40px;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 18px;
  border-radius: 21px;
  background: linear-gradient(180deg, rgba(28,28,38,.97), rgba(19,19,26,.98));
}

.search-icon {
  color: rgba(240,240,240,.42);
  transition: color 180ms ease;
}

.search-box:focus-within .search-icon { color: var(--gold); }

.search-input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: clamp(1rem, 4vw, 1.14rem);
  font-weight: 500;
  caret-color: var(--gold);
}

.search-input::placeholder { color: rgba(136,136,153,.74); }

.clear-search {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  border: 1px solid transparent;
  border-radius: 50%;
  background: rgba(255,255,255,.055);
  color: rgba(240,240,240,.65);
  font-size: 1.2rem;
  cursor: pointer;
  transform: scale(.8);
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease, color 180ms ease;
}

.clear-search.show {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.clear-search:hover {
  color: var(--text);
  background: rgba(255,255,255,.1);
}

.search-helper {
  margin-top: 11px;
  color: rgba(136,136,153,.72);
  font-size: .64rem;
}


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

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

.genre-filter-shell::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 42px;
  pointer-events: none;
  background: linear-gradient(to left, var(--bg), transparent);
}

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

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

.genre-chip {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  color: rgba(240,240,240,.62);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)), var(--surface-1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  scroll-snap-align: start;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms var(--ease), box-shadow 180ms ease;
}

.genre-chip::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.24);
}

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

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

.genre-chip.is-active::before { background: rgba(10,10,15,.56); }


/* =========================================================
   DISCOVERY / DEFAULT STATE
========================================================= */

.discovery-state { padding: 42px 0 90px; }

.section-header {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.section-eyebrow {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  font-weight: 400;
  line-height: .95;
  letter-spacing: .025em;
  text-transform: uppercase;
}


/* =========================================================
   TRENDING SEARCHES
========================================================= */

.trending-searches { margin-bottom: 56px; }

.trending-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.trending-chip {
  position: relative;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 0 11px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface-1);
  color: rgba(240,240,240,.76);
  font-size: .72rem;
  font-weight: 600;
  transition: transform 200ms var(--ease), border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.trending-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(253,200,48,.04), rgba(243,115,53,.07), transparent);
  transition: opacity 180ms ease;
}

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

.trending-chip:hover::after { opacity: 1; }

.trend-number {
  position: relative;
  z-index: 2;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  color: var(--gold);
  font-family: var(--display);
  font-size: .92rem;
}

.trend-name { position: relative; z-index: 2; }


/* =========================================================
   DRAMA GRID
   Same poster DNA as Home + Browse
========================================================= */

.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;
  opacity: .72;
  background: linear-gradient(180deg, transparent 43%, rgba(10,10,15,.16) 65%, rgba(10,10,15,.97) 100%);
  transition: opacity 220ms 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;
  color: var(--text);
  background: rgba(10,10,15,.7);
  backdrop-filter: blur(10px);
  font-size: .54rem;
  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;
  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: 0 0 auto auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient);
  color: #0a0a0f;
  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;
}


/* =========================================================
   RESULTS STATE
========================================================= */

.results-state { padding: 42px 0 90px; }

.results-context { margin-bottom: 26px; }

.results-kicker {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.results-heading {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.5rem, 9vw, 4.6rem);
  font-weight: 400;
  line-height: .92;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.results-heading strong {
  color: transparent;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 400;
}

.results-summary {
  margin-top: 9px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 500;
}

.results-context::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 22px;
  background: linear-gradient(90deg, var(--hairline), transparent);
}


/* =========================================================
   PAGINATION
========================================================= */

.pagination-wrap { padding-top: 62px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.page-link {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: rgba(240,240,240,.66);
  background: var(--surface-1);
  font-size: .72rem;
  font-weight: 600;
  transition: transform 180ms var(--ease), color 180ms ease, background 180ms ease, border-color 180ms ease;
}

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

.page-link.is-current {
  color: #0a0a0f;
  border-color: transparent;
  background: var(--gradient);
}

.page-link[aria-disabled="true"] {
  opacity: .35;
  pointer-events: none;
}

.page-link.page-arrow { min-width: 46px; }

.pagination-ellipsis {
  min-width: 30px;
  display: inline-flex;
  justify-content: center;
  color: var(--muted);
  font-size: .8rem;
}


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

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

.empty-state::before {
  content: "?";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-52%);
  pointer-events: none;
  color: rgba(255,255,255,.018);
  font-family: var(--display);
  font-size: clamp(18rem, 50vw, 31rem);
  line-height: .8;
}

.empty-inner { position: relative; z-index: 3; max-width: 540px; }

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

.empty-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3rem, 11vw, 5rem);
  font-weight: 400;
  line-height: .88;
  letter-spacing: .02em;
  text-transform: uppercase;
}

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

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

.empty-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
}

.empty-button {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-2);
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease;
}

.empty-button:hover {
  transform: translateY(-2px);
  background: var(--surface-3);
  border-color: rgba(253,200,48,.23);
}

.empty-button.primary {
  color: #0a0a0f;
  border-color: transparent;
  background: var(--gradient);
}


/* =========================================================
   GRID RHYTHM
========================================================= */

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


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

@media (min-width: 600px) {
  .drama-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 30px 14px; }
  .search-field { min-height: 74px; padding: 0 17px 0 22px; }
}

@media (min-width: 800px) {
  .search-hero { padding: calc(var(--nav-h) + 94px) 0 48px; }
  .search-form { margin-top: 38px; }
  .search-box { border-radius: 26px; }
  .search-field {
    min-height: 82px;
    border-radius: 25px;
    grid-template-columns: 28px minmax(0,1fr) 44px;
    gap: 14px;
    padding: 0 18px 0 25px;
  }
  .search-input { font-size: 1.15rem; }
  .drama-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 38px 17px; }
}

@media (min-width: 1024px) {
  .drama-grid { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 43px 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;
  }
}
