:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

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

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.subtitle {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--surface);
}

.dropzone:hover,
.dropzone:focus,
.dropzone.dragover {
  border-color: var(--accent);
  background: #1e2a3d;
  outline: none;
}

.dropzone-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.dropzone-hint {
  margin: 0;
  color: var(--muted);
}

.dropzone-limit {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 0;
}

.file-info,
.progress,
.result,
.error {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.file-info-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.75rem;
}

.file-info-header p {
  margin: 0;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}

.file-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.file-list-item:last-child {
  border-bottom: none;
}

.file-list-meta {
  font-size: 0.92rem;
  word-break: break-all;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.file-actions .btn {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

.btn {
  display: inline-block;
  margin-top: 1rem;
  margin-right: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn.primary {
  background: var(--accent);
  color: white;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.result-title {
  margin: 0 0 0.5rem;
  color: var(--success);
  font-weight: 600;
}

.stats {
  margin: 0;
  font-size: 1.05rem;
}

.error {
  border-color: var(--error);
}

#error-text {
  margin: 0;
  color: #fca5a5;
}

.progress {
  text-align: center;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 300;
  font-style: italic;
  color: var(--muted);
}

footer p {
  margin: 0;
}
