/* ─────────────────────────────────────────────
   FLICKSY — style.css
   Aesthetic: Cinematic Dark / Film-Noir Neon
   Fonts: Bebas Neue (display) + DM Sans (body) + Space Mono (mono)
───────────────────────────────────────────── */

/* ── RESET & ROOT ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0a0a0f;
  --surface:    #12121a;
  --card:       #16161f;
  --card-hover: #1c1c28;
  --border:     rgba(255,255,255,0.07);
  --border-lit: rgba(255,180,50,0.35);

  --gold:       #f5c842;
  --gold-dim:   #c9a030;
  --teal:       #00e5c3;
  --red:        #ff4a4a;
  --white:      #f0eeea;
  --muted:      #6b6880;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'Space Mono', monospace;

  --radius: 12px;
  --transition: 0.28s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── NOISE TEXTURE OVERLAY ── */
.noise {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ── SITE HEADER ── */
.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  color: var(--gold);
  font-size: 22px;
  animation: pulse-play 2.4s ease-in-out infinite;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--white);
}
.logo-text.small { font-size: 1rem; }

.tagline {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  border-left: 1px solid var(--border);
  padding-left: 16px;
  margin-left: 4px;
}

@keyframes pulse-play {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.88); }
}

/* ── HERO / FILTER ── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 48px 90px;
  min-height: 56vh;
  display: flex;
  align-items: center;
}

/* Ambient glowing blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.18;
}
.blob-1 {
  width: 520px; height: 520px;
  background: var(--gold);
  top: -180px; left: -120px;
  animation: drift1 14s ease-in-out infinite alternate;
}
.blob-2 {
  width: 380px; height: 380px;
  background: var(--teal);
  bottom: -100px; right: 8%;
  animation: drift2 11s ease-in-out infinite alternate;
}
.blob-3 {
  width: 260px; height: 260px;
  background: var(--red);
  top: 30%; right: 28%;
  opacity: 0.10;
  animation: drift3 18s ease-in-out infinite alternate;
}

@keyframes drift1 { to { transform: translate(40px, 30px) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-30px, -20px) scale(1.12); } }
@keyframes drift3 { to { transform: translate(20px, 40px) scale(0.92); } }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  width: 100%;
}

.hero-headline {
  font-family: var(--font-display);
  line-height: 0.92;
  margin-bottom: 18px;
}
.hero-headline .line-1 {
  display: block;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  color: var(--muted);
  letter-spacing: 3px;
}
.hero-headline .line-2 {
  display: block;
  font-size: clamp(4rem, 10vw, 8.5rem);
  color: var(--white);
  letter-spacing: 3px;
  /* Film-grain text shadow */
  text-shadow: 0 0 60px rgba(245,200,66,0.18), 0 2px 0 rgba(0,0,0,0.6);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 36px;
  letter-spacing: 0.02em;
}

/* ── SEARCH BAR ── */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 500px;
  margin-bottom: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-wrap:focus-within {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(245,200,66,0.10);
}

.search-icon {
  padding: 0 8px 0 18px;
  font-size: 1.4rem;
  color: var(--muted);
  pointer-events: none;
  line-height: 1;
}

.search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 14px 8px;
  letter-spacing: 0.02em;
}
.search-wrap input::placeholder { color: var(--muted); }

.clear-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 18px;
  font-size: 0.9rem;
  transition: color var(--transition);
  display: none; /* shown via JS when input has value */
}
.clear-btn:hover { color: var(--white); }
.clear-btn.visible { display: block; }

/* ── FILTER ROW ── */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.select-wrap label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.select-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-box select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 40px 12px 16px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-width: 170px;
}
.select-box select:focus,
.select-box select:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(245,200,66,0.09);
}

.select-box .arrow {
  position: absolute;
  right: 14px;
  color: var(--gold);
  pointer-events: none;
  font-size: 1rem;
}

/* ── RECOMMEND BUTTON ── */
.recommend-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gold);
  color: #0a0a0f;
  border: none;
  border-radius: 8px;
  padding: 13px 28px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 24px rgba(245,200,66,0.22);
  white-space: nowrap;
}
.recommend-btn:hover {
  background: #ffe066;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(245,200,66,0.38);
}
.recommend-btn:active { transform: translateY(0); }

.btn-icon {
  font-size: 1.3rem;
  transition: transform var(--transition);
}
.recommend-btn:hover .btn-icon { transform: translateX(4px); }

/* ── RESULTS SECTION ── */
.results-section {
  padding: 0 48px 80px;
  min-height: 200px;
}

/* ── LOADER ── */
.loader {
  display: none; /* shown via JS */
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 60px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.loader.active { display: flex; }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESULTS META ── */
.results-meta {
  padding: 24px 0 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.results-meta span { color: var(--gold); }

/* ── MOVIE GRID ── */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 24px;
}

/* ── MOVIE CARD ── */
.movie-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: default;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.45s ease both;
}

/* staggered entrance */
.movie-card:nth-child(1)  { animation-delay: 0.04s; }
.movie-card:nth-child(2)  { animation-delay: 0.08s; }
.movie-card:nth-child(3)  { animation-delay: 0.12s; }
.movie-card:nth-child(4)  { animation-delay: 0.16s; }
.movie-card:nth-child(5)  { animation-delay: 0.20s; }
.movie-card:nth-child(6)  { animation-delay: 0.24s; }
.movie-card:nth-child(7)  { animation-delay: 0.28s; }
.movie-card:nth-child(8)  { animation-delay: 0.32s; }
.movie-card:nth-child(9)  { animation-delay: 0.36s; }
.movie-card:nth-child(10) { animation-delay: 0.40s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.movie-card:hover {
  transform: translateY(-6px) scale(1.018);
  border-color: var(--border-lit);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 0 0 1px rgba(245,200,66,0.12);
  background: var(--card-hover);
}

/* Poster */
.card-poster {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--surface);
}
.card-poster img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.movie-card:hover .card-poster img { transform: scale(1.06); }

/* Rating badge */
.rating-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(10,10,15,0.88);
  border: 1px solid rgba(245,200,66,0.4);
  border-radius: 6px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(6px);
}

/* Genre pill on poster */
.genre-pill {
  position: absolute;
  bottom: 10px; left: 10px;
  background: rgba(0,229,195,0.15);
  border: 1px solid rgba(0,229,195,0.3);
  border-radius: 50px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--teal);
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

/* Card body */
.card-body {
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.8px;
  line-height: 1.15;
  color: var(--white);
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Teaser button */
.teaser-btn {
  margin-top: auto;
  padding-top: 14px;
}
.teaser-btn a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 14px;
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.teaser-btn a:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #0a0a0f;
  transform: scale(1.03);
}

.teaser-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ── NO RESULTS ── */
.no-results {
  display: none; /* shown via JS */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  gap: 14px;
}
.no-results.active { display: flex; }

.no-results-icon { font-size: 3.5rem; opacity: 0.5; }

.no-results h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 1px;
  color: var(--white);
}
.no-results p {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 360px;
}

.reset-btn {
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 10px 24px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.reset-btn:hover {
  background: var(--gold);
  color: #0a0a0f;
}

/* ── SITE FOOTER ── */
.site-footer {
  text-align: center;
  padding: 28px 48px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .site-header { padding: 16px 20px; }
  .tagline { display: none; }

  .hero { padding: 50px 20px 60px; }

  .filter-row { flex-direction: column; align-items: stretch; }
  .select-box select { width: 100%; }
  .recommend-btn { width: 100%; justify-content: center; }

  .results-section { padding: 0 20px 60px; }

  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 420px) {
  .movie-grid { grid-template-columns: 1fr 1fr; }
  .card-title { font-size: 1rem; }
}
