/* ============================================
   CINESCOPE — style.css
   ============================================ */

:root {
  --bg: #09090b;
  --surface: #111113;
  --surface2: #1a1a1e;
  --border: rgba(255, 255, 255, 0.07);
  --text: #f4f4f5;
  --muted: #71717a;
  --accent: #e8c547;
  --accent2: #ff5f3f;
  --radius: 10px;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 400px at 50% 0%, rgba(232, 197, 71, 0.06), transparent);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(9, 9, 11, 0.85);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.logo-icon {
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--text);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 14px 9px 38px;
  outline: none;
  transition: border-color 200ms ease;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  border-color: rgba(232, 197, 71, 0.4);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
  line-height: 1;
}

/* ── FILTERS ── */
.filters-bar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.filters-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters-inner::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 150ms ease, border-color 150ms ease;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── MAIN ── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.section-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 20px;
}

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

/* ── MOVIE CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease;
  animation: fadeUp 400ms ease both;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.card:hover .card-overlay {
  opacity: 1;
}

.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--surface2);
}

.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}

.card:hover .card-poster img {
  transform: scale(1.04);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 9, 11, 0.9) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 220ms ease;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.card-overlay-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(9, 9, 11, 0.8);
  border: 1px solid rgba(232, 197, 71, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  backdrop-filter: blur(6px);
}

.card-no-poster {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--muted);
  background: var(--surface2);
}

.card-info {
  padding: 12px;
}

.card-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-genre-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent2);
  flex-shrink: 0;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  font-size: 15px;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  transition: transform 250ms ease;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease;
  z-index: 2;
}

.modal-close:hover {
  color: var(--text);
}

.modal-content {
  padding: 0 28px 28px;
  clear: both;
}

.modal-banner {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  margin-top: -44px;
  padding-top: 60px;
}

.modal-poster {
  width: 130px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

.modal-poster img {
  width: 100%;
  display: block;
}

.modal-poster-placeholder {
  width: 130px;
  aspect-ratio: 2/3;
  background: var(--surface2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
}

.modal-heading {
  padding-top: 40px;
  flex: 1;
  min-width: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 8px;
}

.modal-tagline {
  font-style: italic;
  color: var(--muted);
  font-size: 13px;
  font-weight: 300;
  margin-bottom: 12px;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge.accent {
  background: rgba(232, 197, 71, 0.1);
  border-color: rgba(232, 197, 71, 0.3);
  color: var(--accent);
}

.modal-score {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-stars {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 1px;
}

.score-num {
  font-weight: 600;
  font-size: 14px;
}

.modal-overview {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(244, 244, 245, 0.8);
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.modal-overview-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* ── ANIMATION ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:nth-child(1)  { animation-delay: 0ms; }
.card:nth-child(2)  { animation-delay: 40ms; }
.card:nth-child(3)  { animation-delay: 80ms; }
.card:nth-child(4)  { animation-delay: 120ms; }
.card:nth-child(5)  { animation-delay: 160ms; }
.card:nth-child(6)  { animation-delay: 200ms; }
.card:nth-child(7)  { animation-delay: 240ms; }
.card:nth-child(8)  { animation-delay: 280ms; }
.card:nth-child(9)  { animation-delay: 320ms; }
.card:nth-child(10) { animation-delay: 360ms; }
.card:nth-child(11) { animation-delay: 400ms; }
.card:nth-child(12) { animation-delay: 440ms; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .header-inner {
    padding: 12px 16px;
  }
  .main {
    padding: 24px 16px 48px;
  }
  .modal-banner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .modal-badges {
    justify-content: center;
  }
  .modal-score {
    justify-content: center;
  }
  .modal-title {
    font-size: 28px;
  }
}