/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #0d0d0f;
  --surface:      #16161a;
  --surface-2:    #1e1e24;
  --border:       #2a2a32;
  --border-hover: #44444e;
  --accent:       #7c6af7;
  --accent-dim:   #3d3478;
  --accent-glow:  rgba(124, 106, 247, 0.18);
  --text-1:       #e8e8f0;
  --text-2:       #8888a0;
  --text-3:       #55556a;
  --success:      #4ade80;
  --danger:       #f87171;
  --radius:       10px;
  --font-mono:    'JetBrains Mono', monospace;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-body);
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

/* ── Header ────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}

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

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

.logo-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--text-1);
}

.gh-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.gh-link:hover {
  color: var(--text-1);
  border-color: var(--border-hover);
}

.ext-arrow {
  font-size: 11px;
  opacity: 0.7;
}

/* ── Main ──────────────────────────────────────────────────── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px 48px;
  gap: 36px;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  text-align: center;
}

.hero h1 {
  font-family: var(--font-body);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-1);
  margin-bottom: 14px;
}

.accent {
  color: var(--accent);
  font-weight: 500;
}

.subtitle {
  font-size: 14px;
  color: var(--text-2);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* ── Drop Zone ─────────────────────────────────────────────── */
.drop-zone {
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 160px;
  position: relative;
  text-align: center;
  background: var(--surface-2);
  color: var(--text-1);
}

.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-glow);
  outline: none;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: scale(1.01);
}

.drop-zone.has-file {
  border-style: solid;
  border-color: var(--accent-dim);
}

.drop-icon {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--text-3);
  transition: color 0.2s;
}

.drop-zone:hover .drop-icon,
.drop-zone.dragging .drop-icon {
  color: var(--accent);
}

.file-icon {
  color: var(--accent) !important;
  font-size: 22px;
}

.drop-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 6px;
}

.drop-filename {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
  word-break: break-all;
  max-width: 320px;
}

.drop-hint {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ── Controls Row ──────────────────────────────────────────── */
.controls-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.theme-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.select-wrap {
  position: relative;
}

select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 32px 10px 12px;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

select:hover, select:focus {
  border-color: var(--border-hover);
  outline: none;
}

.select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-3);
  pointer-events: none;
}

/* ── Convert Button ────────────────────────────────────────── */
.convert-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 10px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.convert-btn:hover:not(:disabled) {
  background: #9080ff;
  transform: translateY(-1px);
}

.convert-btn:active:not(:disabled) {
  transform: translateY(0);
}

.convert-btn:disabled {
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
  cursor: not-allowed;
}

/* ── Progress ──────────────────────────────────────────────── */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  animation: shimmer 1.2s ease infinite;
}

@keyframes shimmer {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}

.progress-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}

/* ── Error ─────────────────────────────────────────────────── */
.error-msg {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--danger);
  line-height: 1.5;
}

/* ── Reset Button ──────────────────────────────────────────── */
.reset-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  letter-spacing: 0.03em;
}

.reset-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

/* ── Feature Grid ──────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
  max-width: 520px;
}

.feature {
  background: var(--surface);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feat-icon {
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 2px;
}

.feat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

.feat-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 10px;
}

.footer-sep { opacity: 0.4; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 540px) {
  main { padding: 32px 16px 40px; }
  .card { padding: 20px; }
  .controls-row { flex-direction: column; align-items: stretch; }
  .feature-grid { grid-template-columns: 1fr; }
  header { padding: 16px 20px; }
}
