:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #232735;
  --border: #2d3142;
  --text: #e4e6eb;
  --text-muted: #8b90a0;
  --primary: #4f8cff;
  --primary-hover: #3a78f0;
  --success: #2ecc71;
  --error: #e74c3c;
  --radius: 10px;
}

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

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.container {
  max-width: 620px;
  width: 100%;
}

header { text-align: center; margin-bottom: 2rem; }

h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: 1.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; margin-bottom: 1rem; }

.subtitle { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.95rem; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 1rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(79, 140, 255, 0.05);
}
.drop-zone-inner { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.upload-icon { color: var(--text-muted); }
.drop-text { font-size: 1.05rem; }
.or-text { color: var(--text-muted); font-size: 0.85rem; }

/* Upload info */
.upload-info { text-align: center; margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); }
.badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  margin: 0 0.1rem;
}
.max-size { margin-top: 0.5rem; }

/* File info */
.file-info {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.muted { color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
  text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Progress */
.progress-bar {
  width: 100%;
  height: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #6ba0ff);
  transition: width 0.3s ease;
  border-radius: var(--radius);
}
.progress-text { text-align: center; margin-top: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }

/* Stats */
.stats-grid {
  margin-top: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); }
.stat-value { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Result */
#result-section { text-align: center; }
.result-label { color: var(--text-muted); margin-top: 0.5rem; }
.result-count {
  font-size: 3rem;
  font-weight: 800;
  color: var(--success);
  margin: 0.5rem 0 1.5rem;
  font-variant-numeric: tabular-nums;
}
.download-buttons { display: flex; gap: 1rem; justify-content: center; }
.error-message {
  color: var(--error);
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

/* Error toast */
.error-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--error);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

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

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 0; }
  h1 { font-size: 1.5rem; }
  .result-count { font-size: 2.25rem; }
  .download-buttons { flex-direction: column; }
}
