/* EcomCine Video Downloader — dark UI (same design system as WebM Converter) */

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

:root {
  --bg:         #0f0f11;
  --surface:    #1a1a1f;
  --border:     #2a2a32;
  --accent:     #7c6af7;
  --accent-dim: #4f44a6;
  --text:       #e8e8f0;
  --muted:      #7a7a90;
  --success:    #3dbb72;
  --error:      #e05555;
  --info:       #3a8fd4;
  --radius:     12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 32px 16px 80px;
}

#root {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Nav ───────────────────────── */
.site-nav { display: flex; }
.nav-home {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: color .15s;
}
.nav-home:hover { color: var(--accent); }

/* ─── Hero ─────────────────────── */
.hero { text-align: center; }
.hero h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 6px; }
.hero p   { color: var(--muted); }

/* ─── Card ──────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-height: 360px;
}

/* ─── Views ─────────────────────── */
.view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.view[hidden] { display: none !important; }
[hidden] { display: none !important; }

/* ─── Field group ───────────────── */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field-hint  { font-size: 12px; color: var(--muted); }

.url-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 11px 14px;
  transition: border-color .15s;
  outline: none;
  width: 100%;
}
.url-input::placeholder { color: var(--muted); }
.url-input:focus  { border-color: var(--accent); }
.url-input.is-valid { border-color: var(--success); }
.url-input.is-error { border-color: var(--error); }

/* ─── Presets ───────────────────── */
.presets { display: flex; flex-direction: column; gap: 8px; }
.presets-heading { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.preset {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.preset:hover { border-color: var(--accent); background: rgba(124,106,247,.04); }
.preset input[type=radio] { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.preset-label strong { display: block; font-size: 14px; }
.preset-label small  { color: var(--muted); font-size: 12px; }

/* ─── Info box ──────────────────── */
.info-box {
  background: rgba(58,143,212,.08);
  border: 1px solid rgba(58,143,212,.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.info-box strong { color: var(--text); }

/* ─── Buttons ───────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: #6b5ad6; }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: rgba(124,106,247,.1); }

/* ─── Error ─────────────────────── */
.error-box {
  background: rgba(224,85,85,.12);
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
}

/* ─── Progress view ─────────────── */
.progress-title {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.progress-track {
  background: var(--border);
  border-radius: 6px;
  height: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width .4s ease;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.progress-log {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "Fira Mono", "Consolas", monospace;
  font-size: 11.5px;
  color: #b0b0c8;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 160px;
  overflow-y: auto;
}

/* ─── Result view ───────────────── */
.result-done-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(61,187,114,.15);
  color: var(--success);
  font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  align-self: center;
}
.result-title { text-align: center; font-size: 1.2rem; font-weight: 700; }
.result-rows  { display: flex; flex-direction: column; gap: 10px; }
.result-row   {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.04);
  border-radius: 8px;
  padding: 10px 14px;
}
.result-row-label { flex: 1; font-size: 14px; word-break: break-all; }
.result-row-size  { color: var(--muted); font-size: 13px; white-space: nowrap; }
.btn-download {
  background: var(--accent-dim);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s;
  white-space: nowrap;
}
.btn-download:hover { background: var(--accent); }

/* ─── Legal notice ──────────────── */
.legal-notice {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
