/* ═══════════════════════════════════════════════
   CodeConvert — Dark IDE Theme
   ═══════════════════════════════════════════════ */

:root {
  --bg:          #0D0F17;
  --bg-surface:  #13151F;
  --bg-card:     #1A1D2E;
  --bg-elevated: #21253A;
  --border:      #2A2F4A;
  --border-light:#363D5C;
  --accent:      #7C3AED;
  --accent-dim:  #5B21B6;
  --accent-glow: rgba(124,58,237,.28);
  --pdf:         #EF4444;
  --docx:        #3B82F6;
  --green:       #10B981;
  --text:        #E2E8F0;
  --text-muted:  #8892B0;
  --text-faint:  #4B5568;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 4px 32px rgba(0,0,0,.55);
}

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

html { scroll-behavior: smooth; }

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

/* ── Background ─────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(124,58,237,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.bg-glow {
  position: fixed; top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse, rgba(124,58,237,.12) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── Navbar ─────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,23,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px; height: 60px;
}
.logo { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.logo-icon {
  font-family: 'JetBrains Mono', monospace; font-size: 1.3rem;
  color: var(--accent); font-weight: 700;
}
.logo-text { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.logo-accent { color: var(--accent); }
.stat-chip {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 12px;
  font-size: .78rem; color: var(--text-muted);
}
.stat-num { color: var(--accent); font-weight: 600; }
.nav-link {
  color: var(--text-muted); text-decoration: none; font-size: .88rem;
  transition: color .2s;
}
.nav-link:hover { color: var(--text); }

/* ── Hero ───────────────────────────────────── */
.hero {
  max-width: 900px; margin: 0 auto;
  padding: 72px 24px 48px;
  text-align: center; position: relative; z-index: 1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124,58,237,.15); border: 1px solid rgba(124,58,237,.3);
  color: #C4B5FD; border-radius: 99px; padding: 6px 16px;
  font-size: .82rem; font-weight: 500; margin-bottom: 28px;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700; line-height: 1.12;
  letter-spacing: -.03em; color: var(--text);
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 40%, #3B82F6 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.05rem; color: var(--text-muted); max-width: 560px;
  margin: 0 auto 32px;
}
.lang-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
}
.lang-pills span {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 14px;
  font-size: .8rem; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.lang-pills .more {
  background: rgba(124,58,237,.15); border-color: rgba(124,58,237,.3);
  color: #C4B5FD;
}

/* ── Main wrapper ────────────────────────────── */
.main-wrap {
  max-width: 900px; margin: 0 auto;
  padding: 0 24px 80px;
  position: relative; z-index: 1;
}

/* ── Converter Card ──────────────────────────── */
.converter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

/* ── Drop Zone ───────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 48px 24px;
  display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 12px;
  cursor: pointer;
  transition: border-color .25s, background .25s;
  position: relative;
  margin-bottom: 28px;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(124,58,237,.05);
}
.drop-zone.has-file {
  padding: 24px;
  border-style: solid; border-color: var(--accent);
  background: rgba(124,58,237,.06);
}

.drop-icon {
  width: 56px; height: 56px; color: var(--accent);
}
.drop-icon svg { width: 100%; height: 100%; }

.drop-text { display: flex; flex-direction: column; gap: 4px; }
.drop-primary { font-size: 1rem; font-weight: 600; color: var(--text); }
.drop-secondary { font-size: .88rem; color: var(--text-muted); }
.browse-btn {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font-size: inherit; text-decoration: underline;
  font-family: inherit; padding: 0;
}
.browse-btn:hover { color: #A78BFA; }
.drop-limit { font-size: .78rem; color: var(--text-faint); }

.file-info {
  display: flex; align-items: center; gap: 14px; width: 100%;
}
.file-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  flex-shrink: 0;
}
.file-details { flex: 1; text-align: left; min-width: 0; }
.file-name { font-size: .93rem; font-weight: 600; color: var(--text); truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.file-meta { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.file-remove {
  background: none; border: none; color: var(--text-faint);
  cursor: pointer; font-size: .9rem; padding: 6px; border-radius: 6px;
  transition: color .2s, background .2s;
}
.file-remove:hover { color: var(--pdf); background: rgba(239,68,68,.1); }

/* ── Format Selector ─────────────────────────── */
.section-label {
  font-size: .8rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 12px;
}
.format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }

.format-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-surface); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  cursor: pointer; transition: border-color .2s, background .2s;
  position: relative;
}
.format-card:hover { border-color: var(--border-light); }
.format-card.selected {
  border-color: var(--accent);
  background: rgba(124,58,237,.08);
}
.fmt-icon { width: 36px; height: 36px; flex-shrink: 0; }
.fmt-icon svg { width: 100%; height: 100%; }
.fmt-name { font-size: .93rem; font-weight: 600; color: var(--text); }
.fmt-desc { font-size: .76rem; color: var(--text-muted); margin-top: 2px; }
.fmt-check {
  margin-left: auto; color: var(--accent); font-size: 1rem; font-weight: 700;
  opacity: 0; transition: opacity .2s;
}
.format-card.selected .fmt-check { opacity: 1; }

/* ── Convert Button ──────────────────────────── */
.convert-btn {
  width: 100%; padding: 16px 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: white; border: none; border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(124,58,237,.35);
  font-family: inherit;
}
.convert-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(124,58,237,.5);
}
.convert-btn:active:not(:disabled) { transform: translateY(0); }
.convert-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-arrow { font-size: 1.1rem; }

/* ── Progress ────────────────────────────────── */
.progress-wrap { margin-top: 20px; }
.progress-bar {
  height: 6px; background: var(--bg-elevated);
  border-radius: 99px; overflow: hidden; margin-bottom: 10px;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #60A5FA);
  border-radius: 99px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
  animation: shimmer 1.5s infinite;
  background-size: 200% 100%;
}
@keyframes shimmer {
  0%   { background-position: -100% 0; }
  100% { background-position:  100% 0; }
}
.progress-text { font-size: .83rem; color: var(--text-muted); text-align: center; }

/* ── Result ──────────────────────────────────── */
.result-box {
  margin-top: 20px; padding: 20px;
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.25);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 14px;
}
.result-icon { font-size: 1.6rem; }
.result-content { flex: 1; }
.result-title { font-weight: 600; color: var(--green); }
.result-meta { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.result-again {
  background: none; border: 1px solid var(--border-light);
  color: var(--text-muted); border-radius: var(--radius-sm);
  padding: 8px 14px; cursor: pointer; font-size: .82rem;
  font-family: inherit; transition: border-color .2s, color .2s;
}
.result-again:hover { border-color: var(--accent); color: var(--text); }

/* ── Stats strip ─────────────────────────────── */
.stats-strip {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 36px;
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 40px;
}
.stat-block { flex: 1; text-align: center; }
.stat-val {
  font-size: 2rem; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
}
.stat-val.red { color: var(--pdf); }
.stat-val.blue { color: var(--docx); }
.stat-lbl { font-size: .78rem; color: var(--text-faint); margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }
.stat-divider { width: 1px; height: 48px; background: var(--border); margin: 0 12px; }

/* ── History ─────────────────────────────────── */
.history-section { }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.refresh-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 1rem; transition: color .2s, border-color .2s;
  font-family: inherit;
}
.refresh-btn:hover { color: var(--text); border-color: var(--accent); }

.history-table-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.history-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.history-table thead th {
  background: var(--bg-elevated); padding: 12px 16px;
  text-align: left; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.history-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.history-table tbody tr:last-child { border-bottom: none; }
.history-table tbody tr:hover { background: var(--bg-elevated); }
.history-table td { padding: 12px 16px; color: var(--text); }
.empty-row td {
  text-align: center; color: var(--text-faint); padding: 32px;
  font-style: italic;
}

.fmt-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px;
  font-size: .75rem; font-weight: 600; font-family: 'JetBrains Mono', monospace;
}
.fmt-badge.pdf {
  background: rgba(239,68,68,.12); color: var(--pdf);
  border: 1px solid rgba(239,68,68,.25);
}
.fmt-badge.docx {
  background: rgba(59,130,246,.12); color: var(--docx);
  border: 1px solid rgba(59,130,246,.25);
}
.lang-tag {
  display: inline-block; padding: 2px 8px;
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: 6px; font-size: .75rem;
  font-family: 'JetBrains Mono', monospace; color: var(--text-muted);
}

/* ── Footer ──────────────────────────────────── */
.footer {
  text-align: center; padding: 32px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: .82rem;
  position: relative; z-index: 1;
}
.footer strong { color: var(--text-muted); }

/* ── Scrollbar ───────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .converter-card { padding: 20px; }
  .format-grid { grid-template-columns: 1fr; }
  .stats-strip { flex-direction: column; gap: 20px; padding: 24px; }
  .stat-divider { width: 60px; height: 1px; margin: 0; }
  .hero-title { font-size: 2.2rem; }
  .history-table thead th:nth-child(3),
  .history-table td:nth-child(3) { display: none; }
}
