/* ============================================================
   download.css — vdl 다운로드 페이지 전용 스타일
   ============================================================ */

:root {
  --bg-base:       #f8f9fb;
  --bg-surface:    #ffffff;

  --accent:        #2563EB;
  --accent-dim:    rgba(37, 99, 235, 0.08);

  --hls-color:     #22C55E;
  --hls-dim:       rgba(34, 197, 94, 0.08);

  --err-color:     #ef4444;

  --text-primary:   #111218;
  --text-secondary: #55556a;
  --text-muted:     #9898b0;

  --border:        rgba(0,0,0,0.08);
  --border-hover:  rgba(0,0,0,0.16);

  --radius:    14px;
  --radius-sm: 9px;

  --font-mono: 'Space Mono', monospace;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

.hidden { display: none !important; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 22px;
  min-height: 100vh;
}

/* ── Site Nav ────────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 200;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none;
}
.nav-logo-icon { width: 38px; height: 38px; border-radius: 9px; }
.nav-logo-text { font-size: 19px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  font-size: 15px; font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 18px; border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-link:hover  { color: var(--text-primary); background: var(--bg-base); }
.nav-link.active { background: var(--text-primary); color: #fff; }

/* ── Header ──────────────────────────────────────────────── */
header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 36px;
  display: flex; align-items: center; gap: 14px;
}
.logo-icon { width: 44px; height: 44px; }
.logo-text  { font-size: 24px; font-weight: 500; color: var(--text-primary); }
.logo-badge {
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 700;
  background: var(--hls-dim);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--hls-color);
  border-radius: 4px; padding: 3px 8px;
}

/* ── Layout ──────────────────────────────────────────────── */
main {
  padding: 60px 24px 40px;
  display: flex; justify-content: center;
}

/* ── Download Card ───────────────────────────────────────── */
.dl-card {
  width: 100%; max-width: 840px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 6px 36px rgba(0,0,0,0.08);
  display: flex; flex-direction: column; gap: 28px;
}

/* ── Type Badge ──────────────────────────────────────────── */
.type-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 15px; border-radius: 6px;
}
.badge-video { background: var(--accent-dim); color: var(--accent); }
.badge-hls   { background: var(--hls-dim);    color: var(--hls-color); }
.badge-dash  { background: rgba(14,165,233,0.08); color: #0ea5e9; }

/* ── Filename Field ──────────────────────────────────────── */
.field-group  { display: flex; flex-direction: column; gap: 10px; }
.field-label  {
  font-size: 16px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.filename-wrap {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: text;
}
.filename-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.filename-icon { color: var(--text-muted); flex-shrink: 0; width: 20px; height: 20px; }
.pencil-icon   { color: var(--text-muted); flex-shrink: 0; opacity: 0.5; width: 18px; height: 18px; }
.filename-wrap:focus-within .pencil-icon { color: var(--accent); opacity: 1; }

.filename-input {
  flex: 1; border: none; background: transparent;
  font-family: var(--font-mono); font-size: 20px;
  color: var(--text-primary); outline: none;
}
.filename-input::placeholder { color: var(--text-muted); }

/* ── Progress Section ────────────────────────────────────── */
.progress-section { display: flex; flex-direction: column; gap: 13px; }

.progress-track {
  height: 12px;
  background: rgba(0,0,0,0.06);
  border-radius: 6px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #22C55E, #2563EB);
  border-radius: 6px;
  transition: width 0.25s ease;
}
@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}
.progress-fill.converting {
  animation: progress-pulse 1.2s ease infinite;
}

.progress-meta {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pct {
  font-family: var(--font-mono); font-size: 22px;
  font-weight: 700; color: var(--text-primary);
  min-width: 64px;
}
.seg-counter {
  font-family: var(--font-mono); font-size: 19px;
  color: var(--text-muted); flex: 1; text-align: center;
}
.speed {
  font-family: var(--font-mono); font-size: 19px;
  color: var(--hls-color); font-weight: 600;
  min-width: 150px; text-align: right;
}

/* ── Status Text ─────────────────────────────────────────── */
.status-text {
  font-size: 18px; color: var(--text-secondary);
  text-align: center; line-height: 1.5;
  min-height: 22px;
}

/* URL 없음 상태: 메시지만 표시 */
.dl-card.no-url .card-type-row,
.dl-card.no-url .field-group,
.dl-card.no-url .btn-action { display: none; }
.dl-card.no-url .status-text {
  font-size: 26px; font-weight: 600;
  color: var(--text-primary);
  padding: 32px 0;
  min-height: unset;
}

/* ── Action Buttons ──────────────────────────────────────── */
.btn-action {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 20px 28px;
  border: none; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 24px; font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn-action:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn-action:active:not(:disabled) { transform: scale(0.99); filter: none; }
.btn-action:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-download {
  background: linear-gradient(135deg, #22C55E, #2563EB);
  color: #fff;
  box-shadow: 0 3px 18px rgba(37,99,235,0.25);
}
.btn-download.done {
  background: #22C55E;
  box-shadow: 0 3px 18px rgba(34,197,94,0.25);
}

.btn-stop {
  background: transparent;
  border: 3px solid var(--err-color);
  color: var(--err-color);
}
.btn-stop:hover { background: rgba(239,68,68,0.06); filter: none; transform: none; }

.btn-restart {
  background: transparent;
  border: 3px solid var(--hls-color);
  color: var(--hls-color);
}
.btn-restart:hover { background: var(--hls-dim); filter: none; transform: none; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #1a1a2e; color: #fff;
  font-size: 18px; padding: 14px 30px;
  border-radius: 28px; opacity: 0;
  transition: all 0.25s; pointer-events: none; z-index: 999;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  main { padding: 32px 16px; }
  .dl-card { padding: 28px 22px; }
}
