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

:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --surface-2: #1c1c1f;
  --border: #2a2a2e;
  --text: #fafafa;
  --text-muted: #71717a;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
}

header {
  text-align: center;
  margin-bottom: 48px;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Upload Section */
.upload-section {
  margin-bottom: 32px;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.dropzone:hover .upload-icon {
  color: var(--primary);
}

.dropzone p {
  font-size: 1rem;
  color: var(--text);
}

.browse-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hint {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Queue Section */
.queue-section {
  display: none;
  margin-bottom: 32px;
}

.queue-section.visible {
  display: block;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.queue-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.queue-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.queue-item-thumbnail {
  width: 80px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
}

.queue-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-item-thumbnail .audio-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.queue-item-thumbnail .audio-icon svg {
  width: 24px;
  height: 24px;
}

.queue-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.queue-item-name {
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Progress Bar */
.progress-container {
  width: 120px;
  flex-shrink: 0;
}

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

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

.status-stage {
  font-size: 0.75rem;
  color: var(--primary);
  white-space: nowrap;
}

.queue-item-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.status-badge.pending {
  background: var(--surface-2);
  color: var(--text-muted);
}

.status-badge.processing {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.status-badge.done {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease;
}

.remove-btn:hover {
  color: var(--error);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

/* Results Section */
.results-section {
  display: none;
}

.results-section.visible {
  display: block;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.result-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.result-header:hover {
  background: var(--surface-2);
}

.result-title {
  font-size: 0.875rem;
  font-weight: 500;
}

.result-toggle {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.result-item.expanded .result-toggle {
  transform: rotate(180deg);
}

.result-content {
  display: none;
  padding: 0 16px 16px;
}

.result-item.expanded .result-content {
  display: block;
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

/* Icon buttons */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--border);
  color: var(--text);
}

.btn-icon.copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--success);
  color: var(--success);
}

.btn-icon-text {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-text:hover {
  background: var(--border);
  color: var(--text);
}

/* Results header */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.results-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.transcription-text {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-muted);
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

/* Prompt Section */
.prompt-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.prompt-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.preset-btn {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}

.preset-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

#promptInput {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.6;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  resize: vertical;
  margin-bottom: 16px;
}

#promptInput:focus {
  outline: none;
  border-color: var(--primary);
}

#promptInput::placeholder {
  color: var(--text-muted);
}

/* Summary Section */
.summary-section {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.summary-section.visible {
  display: block;
}

.summary-content {
  font-size: 0.9375rem;
  line-height: 1.8;
}

/* Summary items (collapsible like results) */
.summary-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.summary-item:last-child {
  margin-bottom: 0;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.summary-header:hover {
  background: var(--surface-2);
}

.summary-title {
  font-size: 0.875rem;
  font-weight: 500;
}

.summary-item .result-toggle {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.summary-item.expanded .result-toggle {
  transform: rotate(180deg);
}

.summary-body {
  display: none;
  padding: 0 16px 16px;
}

.summary-item.expanded .summary-body {
  display: block;
}

.summary-text {
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.processing-message {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}

.summary-content h1,
.summary-content h2,
.summary-content h3 {
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  margin-top: 24px;
  margin-bottom: 12px;
}

.summary-content h1:first-child,
.summary-content h2:first-child,
.summary-content h3:first-child {
  margin-top: 0;
}

.summary-content h1 { font-size: 1.25rem; }
.summary-content h2 { font-size: 1.125rem; }
.summary-content h3 { font-size: 1rem; }

.summary-content p {
  margin-bottom: 12px;
}

.summary-content ul,
.summary-content ol {
  margin-bottom: 12px;
  padding-left: 24px;
}

.summary-content li {
  margin-bottom: 6px;
}

.summary-content strong {
  color: var(--text);
  font-weight: 600;
}

/* Loading spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 32px 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .dropzone {
    padding: 32px 16px;
  }

  .queue-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .queue-item-status {
    width: 100%;
    justify-content: space-between;
  }
}
