:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #242424;
  --border: #333;
  --text: #e4e4e4;
  --text-dim: #888;
  --accent: #6c63ff;
  --accent-hover: #7d75ff;
  --green: #34d399;
  --red: #f87171;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.app {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Controls */
.controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.controls select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.controls select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.webgpu {
  background: #6c63ff33;
  color: var(--accent);
}

.badge.wasm {
  background: #34d39933;
  color: var(--green);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--surface);
}

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

.drop-zone-label {
  color: var(--text-dim);
  font-size: 0.875rem;
}

.drop-zone-label strong {
  color: var(--accent);
}

#file-name {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--green);
  font-weight: 500;
}

#file-input {
  display: none;
}

/* Transcribe button */
.transcribe-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.transcribe-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.transcribe-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Progress */
.progress-section {
  flex-direction: column;
  gap: 0.5rem;
}

.progress-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.progress-text.error {
  color: var(--red);
}

/* Output */
.output-section {
  flex-direction: column;
  gap: 0.75rem;
}

.output-section:not([hidden]) {
  display: flex;
}

/* Export buttons */
.export-buttons:not([hidden]) {
  display: flex;
}

/* Progress */
.progress-section:not([hidden]) {
  display: flex;
}

.output-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.export-buttons {
  gap: 0.5rem;
  flex-wrap: wrap;
}

.export-buttons button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.export-buttons button:hover {
  background: var(--border);
}

/* Scrollbar */
.output-box::-webkit-scrollbar {
  width: 6px;
}

.output-box::-webkit-scrollbar-track {
  background: transparent;
}

.output-box::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
