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

:root {
  --red:     #e50914;
  --red-dk:  #b0060f;
  --bg:      #0a0a0f;
  --bg2:     #111118;
  --bg3:     #1a1a24;
  --surface: #1e1e2a;
  --border:  #2a2a3a;
  --text:    #e8e8f0;
  --muted:   #8888a0;
  --accent:  #e50914;
  --green:   #22c55e;
  --yellow:  #f59e0b;
  --radius:  12px;
  --shadow:  0 4px 24px rgba(0,0,0,.5);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.5px;
}

.logo-icon { width: 32px; height: 32px; }
.logo-accent { color: var(--red); }

.header-nav { display: flex; gap: 28px; }
.header-nav a { color: var(--muted); font-size: .9rem; font-weight: 500; transition: color .2s; }
.header-nav a:hover { color: var(--text); text-decoration: none; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(229,9,20,.18) 0%, transparent 70%);
}

.hero-inner { text-align: center; }

.hero-badge {
  display: inline-block;
  background: rgba(229,9,20,.15);
  border: 1px solid rgba(229,9,20,.35);
  color: #ff6b6b;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #e50914 0%, #ff6b35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 40px;
}

/* ── Search Box ───────────────────────────────────────────────────────────── */
.search-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.input-row input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}

.input-row input:focus { border-color: var(--red); }
.input-row input::placeholder { color: var(--muted); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all .2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover { background: var(--red-dk); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-ghost:hover { border-color: var(--text); color: var(--text); }

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(1.1); }

.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* ── Quality Row ──────────────────────────────────────────────────────────── */
.quality-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quality-label { font-size: .85rem; color: var(--muted); font-weight: 500; }

.q-opt {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  transition: color .2s;
}

.q-opt input[type="radio"] { accent-color: var(--red); cursor: pointer; }
.q-opt:has(input:checked) { color: var(--text); }

/* ── Section ──────────────────────────────────────────────────────────────── */
.section { padding: 60px 0; }
.bg-dark { background: var(--bg2); }

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: -.3px;
}
.section-title.center { text-align: center; }

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

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(229,9,20,.2);
  border-color: var(--red);
}

.result-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--bg3);
  display: block;
}

.result-poster-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2.5rem;
}

.result-info { padding: 10px 12px 14px; }
.result-title { font-size: .88rem; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.result-meta { font-size: .75rem; color: var(--muted); display: flex; gap: 8px; }

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge-red { background: rgba(229,9,20,.2); color: #ff6b6b; border: 1px solid rgba(229,9,20,.3); }
.badge-blue { background: rgba(59,130,246,.2); color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }

/* ── Detail Card ──────────────────────────────────────────────────────────── */
.back-btn { margin-bottom: 24px; }

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  gap: 32px;
}

.detail-poster {
  flex-shrink: 0;
  width: 200px;
  border-radius: 8px;
  overflow: hidden;
}

.detail-poster img {
  width: 100%;
  display: block;
  border-radius: 8px;
}

.detail-poster-placeholder {
  width: 200px;
  height: 300px;
  background: var(--bg3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--muted);
}

.detail-body { flex: 1; min-width: 0; }
.detail-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 10px; }
.detail-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.detail-desc { color: var(--muted); font-size: .95rem; line-height: 1.7; margin-bottom: 24px; }

.download-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ── Progress Bar ─────────────────────────────────────────────────────────── */
.progress-wrap {
  background: var(--bg3);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--red), #ff6b35);
  border-radius: 999px;
  transition: width .4s ease;
}

/* ── Downloads List ───────────────────────────────────────────────────────── */
.download-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.dl-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.dl-title { font-weight: 600; font-size: 1rem; }
.dl-status { font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.dl-status.queued    { background: rgba(245,158,11,.15); color: var(--yellow); }
.dl-status.downloading { background: rgba(59,130,246,.15); color: #93c5fd; }
.dl-status.done      { background: rgba(34,197,94,.15); color: var(--green); }
.dl-status.error     { background: rgba(229,9,20,.15); color: #ff6b6b; }

.dl-meta { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.dl-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ── Steps ────────────────────────────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.step-num {
  width: 40px;
  height: 40px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.step-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.step-card p { font-size: .9rem; color: var(--muted); line-height: 1.6; }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq-container { max-width: 720px; }

.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  padding: 18px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .2s;
}
.faq-item summary:hover { background: var(--bg3); }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--red); }
.faq-item[open] summary::after { content: "−"; }

.faq-item p {
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.7;
}

.faq-item code {
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: .88em;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg2);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-note { font-size: .82rem; color: var(--muted); }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  z-index: 999;
  max-width: 340px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: #ff6b6b; color: #ff6b6b; }

/* ── Loading Spinner ──────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .header-nav { display: none; }
  .detail-card { flex-direction: column; }
  .detail-poster { width: 100%; max-width: 200px; }
  .hero { padding: 50px 0 40px; }
  .hero-title { font-size: 1.8rem; }
}
