:root {
    --font-display: "Montserrat", sans-serif;
    --font-body: "Montserrat", sans-serif;
    --bg: #101115;
    --bg-soft: #17181d;
    --surface: rgba(24, 26, 32, 0.92);
    --surface-strong: rgba(18, 19, 24, 0.98);
    --surface-alt: rgba(32, 34, 42, 0.92);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f7f7f8;
    --text-muted: #c1c3ca;
    --text-soft: #9598a3;
    --brand: #e50914;
    --brand-bright: #ff3340;
    --brand-glow: rgba(229, 9, 20, 0.24);
    --shadow-soft: 0 24px 50px rgba(0, 0, 0, 0.34);
    --shadow-strong: 0 34px 90px rgba(0, 0, 0, 0.46);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --container: 1380px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(229, 9, 20, 0.14), transparent 24%),
    radial-gradient(circle at 14% 14%, rgba(255, 255, 255, 0.06), transparent 22%),
    linear-gradient(180deg, #0e0f14 0%, #121319 38%, #13151c 70%, #0c0d11 100%);
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.search-page {
  position: relative;
  min-height: 100vh;
}

.search-page__backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 12%, rgba(229, 9, 20, 0.12), transparent 24%),
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.05), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 24%);
}

.search-main {
  position: relative;
  z-index: 1;
  padding: clamp(1rem, 1.6vw, 1.4rem) 0 clamp(3rem, 5vw, 5rem);
}

.search-shell {
  width: min(100% - 2rem, var(--container));
  margin: 0 auto;
}

.search-bar-wrapper {
  width: 100%;
  padding: 0 0 clamp(1.5rem, 2.4vw, 2.2rem);
}

.search-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  gap: clamp(1.3rem, 3vw, 2.2rem);
  align-items: end;
  padding: clamp(1.2rem, 2vw, 1.8rem) 0 clamp(1.5rem, 2.4vw, 2.2rem);
}

.search-hero__copy {
  padding: clamp(1.2rem, 1.8vw, 1.8rem);
}

.search-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
  color: #f2b9bd;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

.search-kicker::before {
  content: "";
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, var(--brand), transparent);
}

.search-hero__copy h1 {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.search-hero__copy p {
  max-width: 44ch;
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
}

.search-panel {
  position: relative;
  padding: clamp(1rem, 2vw, 1.4rem);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(229, 9, 20, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(22, 23, 29, 0.96), rgba(13, 14, 19, 0.98));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.search-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
/*  padding: 0.8rem 1rem 0.8rem 1.05rem;*/
  padding:0.7rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 38px rgba(0, 0, 0, 0.24);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}

.search-field:focus-within {
  border-color: rgba(229, 9, 20, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 4px rgba(229, 9, 20, 0.08),
    0 20px 40px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}

.search-field__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f2f7;
  font-size: 1.05rem;
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(1rem, 1.8vw, 1.08rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.search-field input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-weight: 600;
}

.recent-searches {
  margin-top: 1.3rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  letter-spacing: -0.04em;
}

.section-head--spaced {
  margin-bottom: clamp(1rem, 1.6vw, 1.5rem);
}

.section-head__meta {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.recent-searches__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.72rem;
  min-height: 44px;
  padding: 0.45rem 0.5rem 0.45rem 0.72rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    rgba(20, 21, 27, 0.94);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}

.recent-chip:hover,
.recent-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(229, 9, 20, 0.25);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  outline: none;
}

.recent-chip__lead {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: #f3f3f7;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.1;
}

.recent-chip__lead span:last-child {
  white-space: nowrap;
}

.recent-chip__lead i {
  color: #bdc0ca;
  font-size: 0.84rem;
}

.recent-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e7e8ed;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.recent-chip__remove i {
  font-size: 0.72rem;
}

.recent-chip:hover .recent-chip__remove,
.recent-chip:focus-visible .recent-chip__remove {
  background: rgba(229, 9, 20, 0.12);
  border-color: rgba(229, 9, 20, 0.2);
  color: #fff;
}

.trending-section {
  padding-top: clamp(0.8rem, 1.2vw, 1rem);
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: clamp(0.9rem, 1.7vw, 1.35rem);
  align-items: start;
}

.poster-grid > .movie-card,
.poster-grid > .poster-card {
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: none;
  width: 100%;
}

.poster-grid .movie-card__frame,
.poster-grid .poster-card__frame {
  height: 100%;
}

.poster-card {
  position: relative;
  min-width: 0;
}

.poster-card__frame {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 24px;
  overflow: hidden;
  background: #20232c;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, filter 0.35s ease;
}

.poster-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.45s ease;
}

.poster-card__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 8, 11, 0.1) 10%, rgba(9, 10, 14, 0.16) 34%, rgba(10, 10, 13, 0.82) 100%),
    linear-gradient(0deg, rgba(229, 9, 20, 0.12), transparent 38%);
}

.poster-card__top,
.poster-card__content {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 2;
}

.poster-card__top {
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 0.95rem 0;
}

.poster-card__badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.35rem 0.68rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(229, 9, 20, 0.26), rgba(229, 9, 20, 0.14));
  border: 1px solid rgba(229, 9, 20, 0.2);
  color: #ffe0e3;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.poster-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(18, 19, 23, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.poster-card__content {
  bottom: 0;
  padding: 0 1rem 1rem;
}

.poster-card__content h3 {
  margin: 0 0 0.38rem;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.poster-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem 0.65rem;
  color: rgba(255, 255, 255, 0.79);
  font-size: 0.76rem;
  font-weight: 500;
}

.poster-card__meta span {
  position: relative;
}

.poster-card__meta span:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -0.35rem;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%);
}

.poster-card:hover .poster-card__frame,
.poster-card:focus-within .poster-card__frame {
  transform: translateY(-8px) scale(1.03);
  border-color: rgba(229, 9, 20, 0.28);
  box-shadow: 0 30px 58px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(229, 9, 20, 0.08);
  filter: saturate(1.05);
}

.poster-card:hover .poster-card__image,
.poster-card:focus-within .poster-card__image {
  transform: scale(1.08);
}

.poster-card.is-hidden {
  display: none;
}

.poster-grid .movie-card:hover .movie-card__frame,
.poster-grid .movie-card:focus-within .movie-card__frame,
.poster-grid .movie-card.is-active .movie-card__frame {
  transform: translateY(-6px) scale(1.02);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 0.7rem;
/*  margin-top: 1.4rem;
  padding: 2.2rem 1.2rem;
  border-radius: 28px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(229, 9, 20, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(22, 23, 29, 0.96), rgba(12, 12, 17, 0.98));*/
  text-align: center;
/*  box-shadow: var(--shadow-soft);*/
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffd9dc;
  font-size: 1.35rem;
}

.empty-state h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .search-hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .search-hero__copy {
    padding-bottom: 0.35rem;
  }

  .search-hero__copy p {
    max-width: 56ch;
  }
}

@media (max-width: 767.98px) {
  .search-shell {
    width: min(100% - 1.15rem, var(--container));
  }

  .search-main {
    padding-top: 0.9rem;
  }

  .search-panel {
    border-radius: 26px;
    padding: 0.9rem;
  }

  .search-field {
    min-height: 58px;
    gap: 0.8rem;
    padding-inline: 0.85rem;
    border-radius: 20px;
  }

  .search-field__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .recent-chip {
    max-width: 100%;
  }

  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 0.82rem;
  }

  .poster-grid .movie-card:hover .movie-card__frame,
  .poster-grid .movie-card:focus-within .movie-card__frame,
  .poster-grid .movie-card.is-active .movie-card__frame,
  .poster-card:hover .poster-card__frame,
  .poster-card:focus-within .poster-card__frame {
    transform: translateY(-4px) scale(1.01);
  }

  .poster-card__frame {
    border-radius: 20px;
  }

  .poster-card__top {
    padding: 0.75rem 0.75rem 0;
  }

  .poster-card__content {
    padding: 0 0.8rem 0.82rem;
  }

  .poster-card__content h3 {
    font-size: 0.92rem;
  }

  .poster-card__meta {
    font-size: 0.7rem;
  }
}

@media (max-width: 575.98px) {
  .search-hero__copy {
    padding-inline: 0.25rem;
  }

  .search-hero__copy h1 {
    font-size: clamp(1.7rem, 10vw, 2.35rem);
  }

  .search-hero__copy p {
    font-size: 0.95rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .recent-searches__list {
    gap: 0.58rem;
  }

  .recent-chip {
    width: 100%;
    min-height: 46px;
    padding-left: 0.72rem;
    padding-right: 0.48rem;
  }

  .recent-chip__lead span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .poster-grid .movie-card:hover .movie-card__frame,
  .poster-grid .movie-card:focus-within .movie-card__frame,
  .poster-grid .movie-card.is-active .movie-card__frame,
  .poster-card:hover .poster-card__frame,
  .poster-card:focus-within .poster-card__frame {
    transform: none;
  }
}

@media (max-width: 389.98px) {
  .search-shell {
    width: min(100% - 0.8rem, var(--container));
  }

  .search-panel {
    padding: 0.75rem;
    border-radius: 22px;
  }

  .search-field {
    min-height: 54px;
    gap: 0.65rem;
    padding-inline: 0.72rem;
  }

  .search-field__icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .search-field input {
    font-size: 0.95rem;
  }

  .poster-grid {
    gap: 0.7rem;
  }

  .poster-card__badge {
    min-height: 27px;
    padding-inline: 0.56rem;
    font-size: 0.62rem;
  }

  .poster-card__action {
    width: 34px;
    height: 34px;
  }
}

:focus-visible {
    box-shadow:none !important;
}

.playlist-row {
     display: block !important; 
    grid-auto-flow: column;
    /* --playlist-card-width: 180px; */
     --playlist-card-width: 184px; 
    --playlist-card-width-mobile: 150px;
    --playlist-card-aspect-ratio: 2 / 3;
    --playlist-gap: 1rem;
}
