/* ══════════════════════════════════════════════
   InstantMediaDownloader — Production Stylesheet
   Theme: Dark Industrial · Neon Accents
══════════════════════════════════════════════ */

:root {
  --bg:       #080b10;
  --bg2:      #0d1117;
  --card:     #0f1520;
  --card2:    #141d2b;
  --border:   rgba(0,200,255,0.1);
  --border2:  rgba(0,200,255,0.22);
  --cyan:     #00c8ff;
  --green:    #00ffb3;
  --yellow:   #ffcc00;
  --red:      #ff4455;
  --text:     #e8f4ff;
  --text2:    #8ba3c0;
  --text3:    #4a6080;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Space Grotesk', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --r:   14px;
  --r-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Background ─────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,200,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
}
.bg-glow { position: fixed; z-index: 0; pointer-events: none; border-radius: 50%; filter: blur(100px); opacity: 0.3; }
.g1 { width:600px; height:600px; background:radial-gradient(circle,#003060,transparent 70%); top:-200px; left:-200px; }
.g2 { width:500px; height:500px; background:radial-gradient(circle,#001a40,transparent 70%); top:30%; right:-150px; }
.g3 { width:400px; height:400px; background:radial-gradient(circle,#002a20,transparent 70%); bottom:0; left:30%; }

/* ── Nav ─────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,11,16,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 34px; height: 34px;
  background: var(--cyan); color: var(--bg);
  border-radius: 8px; display: grid; place-items: center;
  font-size: 14px; box-shadow: 0 0 16px rgba(0,200,255,0.3);
}
.logo-text { font-weight: 700; font-size: 1.05rem; }
.logo-text em { color: var(--cyan); font-style: normal; }
.nav-badges { display: flex; gap: 6px; }
.badge {
  padding: 3px 10px; border: 1px solid var(--border2);
  border-radius: 100px; font-size: 0.7rem;
  font-family: var(--font-mono); background: rgba(0,200,255,0.05);
  letter-spacing: 0.05em;
}
.badge-yt  { color:#ff4444; border-color:rgba(255,68,68,0.3); }
.badge-ig  { color:#e1306c; border-color:rgba(225,48,108,0.3); }
.badge-fb  { color:#1877f2; border-color:rgba(24,119,242,0.3); }

/* ── Hero ────────────────────────────────────── */
.hero {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto;
  padding: 70px 24px 56px;
  text-align: center;
}
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--cyan); letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 20px; opacity: 0.8;
}
.hero-title { line-height: 0.92; margin-bottom: 18px; }
.line1 {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(68px, 12vw, 124px);
  letter-spacing: 0.04em;
}
.line2 {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(48px, 8.5vw, 88px);
  color: var(--text2); letter-spacing: 0.04em;
}
.line2 em { font-style: normal; color: var(--cyan); text-shadow: 0 0 40px rgba(0,200,255,0.4); }
.hero-sub { font-size: 0.95rem; color: var(--text2); margin-bottom: 36px; font-weight: 300; }

/* ── Platform pills ──────────────────────────── */
.platform-pills { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.pill {
  display: flex; flex-direction: column; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 22px; cursor: pointer;
  transition: all .2s; min-width: 110px; position: relative; overflow: hidden;
}
.pill::after {
  content: ''; position: absolute; inset: 0;
  opacity: 0; transition: opacity .2s;
  background: var(--pill-c, var(--cyan));
}
.pill:hover { transform: translateY(-3px); border-color: var(--border2); }
.pill.active { border-color: var(--pill-c, var(--cyan)); }
.pill.active::after { opacity: 0.07; }
.pill-icon { font-size: 1.55rem; margin-bottom: 5px; transition: transform .2s; }
.pill:hover .pill-icon { transform: scale(1.15); }
.pill-name { font-weight: 700; font-size: 0.88rem; }
.pill-desc { font-size: 0.67rem; color: var(--text3); margin-top: 2px; font-family: var(--font-mono); }
.pill-yt  { --pill-c:#ff4444; } .pill-yt.active  .pill-icon { color:#ff4444; }
.pill-ig  { --pill-c:#e1306c; } .pill-ig.active  .pill-icon { color:#e1306c; }
.pill-fb  { --pill-c:#1877f2; } .pill-fb.active  .pill-icon { color:#1877f2; }

/* ── URL Card ─────────────────────────────────── */
.url-card {
  max-width: 720px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 20px 20px 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35), 0 0 30px rgba(0,200,255,0.12);
  transition: box-shadow .3s, border-color .3s;
}
.url-card:focus-within {
  border-color: rgba(0,200,255,0.4);
  box-shadow: 0 8px 40px rgba(0,0,0,0.45), 0 0 50px rgba(0,200,255,0.25);
}
.url-platform-hint {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 10px;
}
.url-input-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.url-btn-row {
  display: flex; gap: 8px;
}
.url-platform-icon { font-size: 1.1rem; flex-shrink: 0; }
.url-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font-mono); font-size: 0.85rem;
  padding: 8px 0; min-width: 0;
}
.url-input::placeholder { color: var(--text3); }

.btn-fetch {
  flex-shrink: 0; background: var(--cyan); color: var(--bg);
  border: none; border-radius: var(--r-sm);
  padding: 10px 22px; font-family: var(--font-body); font-weight: 700;
  font-size: 0.88rem; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all .2s; box-shadow: 0 0 20px rgba(0,200,255,0.25);
}
.btn-fetch:hover { background: #00e5ff; transform: translateY(-1px); box-shadow: 0 0 30px rgba(0,200,255,0.45); }
.btn-fetch:active { transform: translateY(0); }
.btn-fetch:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.platform-note {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(0,200,255,0.04); border: 1px solid rgba(0,200,255,0.12);
  border-radius: var(--r-sm); padding: 9px 12px;
  font-size: 0.76rem; color: var(--text2); line-height: 1.5; margin-bottom: 6px;
}
.platform-note code {
  background: rgba(255,255,255,0.07); padding: 1px 5px;
  border-radius: 4px; font-family: var(--font-mono); font-size: 0.73rem;
}
.note-icon { flex-shrink: 0; }

.url-error {
  display: none; margin-top: 10px; padding: 10px 14px;
  background: rgba(255,68,85,0.08); border: 1px solid rgba(255,68,85,0.3);
  border-radius: var(--r-sm); font-size: 0.8rem; color: #ff8899; line-height: 1.5;
}

/* ── Loading ──────────────────────────────────── */
.loading-card {
  max-width: 720px; margin: 24px auto 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 40px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.spinner-wrap { position: relative; width: 52px; height: 52px; }
.spinner {
  width: 52px; height: 52px;
  border: 2px solid var(--border2); border-top-color: var(--cyan);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
.spinner-inner {
  position: absolute; inset: 8px;
  border: 2px solid transparent; border-bottom-color: var(--green);
  border-radius: 50%; animation: spin 0.55s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-weight: 600; }
.loading-sub { font-size: 0.78rem; color: var(--text3); font-family: var(--font-mono); }

/* ── Info section ─────────────────────────────── */
.info-section {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto 40px; padding: 0 24px;
  animation: slideUp .35s ease;
}
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.info-card {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 26px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.4);
}

.info-platform-bar {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.info-platform-icon { font-size: 1.1rem; }
.info-platform-name { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.btn-change-url {
  margin-left: auto; background: transparent;
  border: 1px solid var(--border2); border-radius: 6px;
  color: var(--text3); font-size: 0.74rem; padding: 4px 10px;
  cursor: pointer; transition: all .2s; font-family: var(--font-mono);
}
.btn-change-url:hover { color: var(--text); border-color: var(--border2); }

.info-top { display: flex; gap: 22px; margin-bottom: 26px; }
.thumb-wrap {
  position: relative; flex-shrink: 0;
  width: 220px; height: 130px;
  border-radius: 10px; overflow: hidden;
  background: var(--card2); border: 1px solid var(--border);
}
.thumb-wrap.no-thumb .thumb { display: none; }
.thumb { width: 100%; height: 100%; object-fit: cover; }
.duration-badge {
  position: absolute; bottom: 7px; right: 7px;
  background: rgba(0,0,0,0.85); color: var(--text);
  font-family: var(--font-mono); font-size: 0.68rem;
  padding: 2px 6px; border-radius: 4px;
}
.meta { flex: 1; min-width: 0; }
.meta-channel { font-size: 0.72rem; color: var(--cyan); font-family: var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 6px; }
.meta-title { font-size: 1.05rem; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.stat { font-size: 0.76rem; color: var(--text3); font-family: var(--font-mono); }

/* ── Tabs ─────────────────────────────────────── */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
  flex: 1; background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text2);
  font-family: var(--font-body); font-size: 0.86rem; font-weight: 600;
  padding: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .2s;
}
.tab:hover { border-color: var(--border2); color: var(--text); }
.tab.active { background: rgba(0,200,255,0.09); border-color: var(--cyan); color: var(--cyan); }

/* ── Quality grid ────────────────────────────── */
.quality-label {
  font-size: 0.7rem; color: var(--text3); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px;
}
.quality-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.quality-btn {
  position: relative; background: var(--card2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text2); font-family: var(--font-mono);
  font-size: 0.86rem; font-weight: 600;
  padding: 11px 18px; cursor: pointer;
  transition: all .18s; min-width: 86px; text-align: center;
}
.quality-btn:hover { border-color: var(--border2); color: var(--text); }
.quality-btn.selected {
  background: rgba(0,200,255,0.1); border-color: var(--cyan);
  color: var(--cyan); box-shadow: 0 0 14px rgba(0,200,255,0.18);
}
.q-sub { display: block; font-size: 0.62rem; color: var(--text3); font-weight: 400; margin-top: 2px; }
.quality-btn.selected .q-sub { color: rgba(0,200,255,0.55); }
.q-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--yellow); color: #000;
  font-size: 0.52rem; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; letter-spacing: 0.04em;
}
.format-note { font-size: 0.72rem; color: var(--text3); font-style: italic; }
.no-streams { font-size: 0.82rem; color: var(--text3); padding: 6px 0; }

/* ── Download button ─────────────────────────── */
.btn-download {
  --dl-color: var(--cyan);
  width: 100%; margin-top: 18px;
  background: linear-gradient(135deg, rgba(0,58,80,0.6), rgba(0,30,48,0.6));
  border: 1px solid var(--dl-color); border-radius: var(--r);
  color: var(--dl-color); font-family: var(--font-body);
  font-size: 1rem; font-weight: 700; padding: 16px 24px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all .22s; letter-spacing: 0.02em;
}
.btn-download:not(:disabled):hover {
  box-shadow: 0 0 40px color-mix(in srgb, var(--dl-color) 28%, transparent);
  transform: translateY(-2px);
}
.btn-download:disabled { opacity: 0.35; cursor: not-allowed; transform: none; border-color: var(--border2); color: var(--text3); }
.dl-icon { font-size: 1.15rem; }

/* ── Progress ─────────────────────────────────── */
.progress-section {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto 40px; padding: 0 24px;
  animation: slideUp .35s ease;
}
.progress-card {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 30px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.4);
}
.progress-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.progress-title { font-size: 1.05rem; font-weight: 700; }
.progress-status { font-family: var(--font-mono); font-size: 0.72rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.08em; }
.progress-bar-wrap {
  height: 5px; background: var(--card2); border-radius: 3px;
  overflow: hidden; position: relative; margin-bottom: 10px;
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green));
  border-radius: 3px; transition: width .3s ease;
}
.progress-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform:translateX(-100%); } to { transform:translateX(200%); } }
.progress-meta { display: flex; gap: 20px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text3); margin-bottom: 10px; }

.progress-done, .progress-error {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 22px; text-align: center;
  animation: fadeIn .4s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.done-icon { font-size: 2.2rem; color: var(--green); }
.done-text { font-size: 0.95rem; font-weight: 600; color: var(--green); }
.err-icon  { font-size: 2.2rem; color: var(--red); }
.err-text  { font-size: 0.85rem; color: #ff8899; max-width: 500px; word-break: break-word; line-height: 1.5; }

.btn-save {
  background: var(--green); color: var(--bg);
  border: none; border-radius: var(--r-sm);
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.95rem; padding: 11px 32px; cursor: pointer;
  transition: all .2s; box-shadow: 0 0 20px rgba(0,255,179,0.25);
}
.btn-save:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(0,255,179,0.4); }

.btn-reset {
  background: transparent; border: 1px solid var(--border2);
  border-radius: var(--r-sm); color: var(--text2);
  font-family: var(--font-body); font-size: 0.84rem;
  padding: 9px 22px; cursor: pointer; transition: all .2s;
}
.btn-reset:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── Features ─────────────────────────────────── */
.features {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 56px 24px; background: rgba(0,0,0,0.15);
}
.features-inner {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px;
}
.feat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px; transition: border-color .2s;
}
.feat:hover { border-color: var(--border2); }
.feat-icon { font-size: 1.6rem; margin-bottom: 10px; }
.feat-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.feat-desc { font-size: 0.78rem; color: var(--text3); line-height: 1.55; }
.feat-yt  { border-color:rgba(255,68,68,0.12);  } .feat-yt:hover  { border-color:rgba(255,68,68,0.35);  } .feat-yt  .feat-icon { color:#ff4444; }
.feat-ig  { border-color:rgba(225,48,108,0.12); } .feat-ig:hover  { border-color:rgba(225,48,108,0.35); } .feat-ig  .feat-icon { color:#e1306c; }
.feat-fb  { border-color:rgba(24,119,242,0.12); } .feat-fb:hover  { border-color:rgba(24,119,242,0.35); } .feat-fb  .feat-icon { color:#1877f2; }
.feat-gen { border-color:rgba(0,200,255,0.12);  } .feat-gen:hover { border-color:rgba(0,200,255,0.35);  } .feat-gen .feat-icon { color:var(--cyan); }

/* ── Footer ───────────────────────────────────── */
.footer {
  position: relative; z-index: 1; text-align: center;
  padding: 22px; border-top: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text3); font-family: var(--font-mono);
}
.footer-note { margin-top: 4px; font-size: 0.68rem; opacity: 0.55; }

/* ── Utility ──────────────────────────────────── */
.hidden { display: none !important; }

@media (max-width: 640px) {
  .info-top { flex-direction: column; }
  .thumb-wrap { width: 100%; height: 190px; }
  .nav-badges { display: none; }
  .line1 { font-size: 58px; }
  .line2 { font-size: 40px; }
  .pill-desc { display: none; }
  .pill { min-width: 80px; padding: 12px 10px; }
}

/* ══════════════════════════════════════════════
   HOW TO USE
══════════════════════════════════════════════ */
.how-section {
  position: relative; z-index: 1;
  padding: 64px 24px;
  border-top: 1px solid var(--border);
}
.how-inner {
  max-width: 860px; margin: 0 auto;
}
.how-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.03em;
  margin-bottom: 40px; text-align: center;
  color: var(--text);
}
.how-steps {
  list-style: none; counter-reset: none;
  display: flex; flex-direction: column; gap: 28px;
}
.how-step {
  display: flex; align-items: flex-start; gap: 20px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px 24px;
  transition: border-color .2s;
}
.how-step:hover { border-color: var(--border2); }
.step-num {
  flex-shrink: 0; width: 38px; height: 38px;
  background: rgba(0,200,255,0.1); border: 1px solid var(--border2);
  border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.2rem;
  color: var(--cyan); line-height: 1;
}
.how-step strong { display: block; font-size: 1rem; margin-bottom: 6px; }
.how-step p { font-size: 0.83rem; color: var(--text2); line-height: 1.6; margin: 0; }
.how-step em { color: var(--cyan); font-style: normal; }

/* ══════════════════════════════════════════════
   FAQ
══════════════════════════════════════════════ */
.faq-section {
  position: relative; z-index: 1;
  padding: 64px 24px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.12);
}
.faq-inner {
  max-width: 860px; margin: 0 auto;
}
.faq-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.03em;
  margin-bottom: 32px; text-align: center;
  color: var(--text);
}
.faq-list { display: flex; flex-direction: column; gap: 10px; }

.faq-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  transition: border-color .2s;
}
.faq-item[open] { border-color: var(--border2); }
.faq-item[open] .faq-q { color: var(--cyan); }

.faq-q {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; cursor: pointer;
  font-weight: 600; font-size: 0.95rem;
  color: var(--text); list-style: none;
  user-select: none; transition: color .2s;
  gap: 12px;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+'; flex-shrink: 0;
  font-size: 1.3rem; font-weight: 300;
  color: var(--text3); transition: transform .25s, color .2s;
  line-height: 1;
}
.faq-item[open] .faq-q::after {
  transform: rotate(45deg);
  color: var(--cyan);
}
.faq-a {
  padding: 0 22px 18px;
  font-size: 0.84rem; color: var(--text2);
  line-height: 1.7; margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.faq-a strong { color: var(--text); }

/* ── Paste button ─────────────────────────── */
.btn-paste {
  flex: 0 0 auto;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .2s;
  white-space: nowrap;
}
.btn-paste:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0,200,255,0.06);
}
.btn-paste.pasted {
  border-color: var(--green);
  color: var(--green);
}
/* Analyze button fills remaining space */
.url-btn-row .btn-fetch {
  flex: 1;
  justify-content: center;
}
/* Mobile: stack input above buttons */
@media (max-width: 500px) {
  .url-btn-row {
    flex-direction: row;
  }
  .url-btn-row .btn-paste {
    flex: 0 0 auto;
  }
  .url-btn-row .btn-fetch {
    flex: 1;
  }
}
