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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1a1a1a;
  --border: #2a2a2a;
  --text: #f9fafb;
  --text-muted: #9ca3af;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --error: #ef4444;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
}

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: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

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

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Form */
.api-key-input,
.form-group {
  margin-bottom: 1.5rem;
}

.api-key-input label,
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.api-key-input input,
.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: monospace;
  font-size: 0.875rem;
}

.api-key-input input:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

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

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.dropzone-content p {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.dropzone-content .hint {
  font-size: 0.75rem;
  margin: 0.75rem 0;
}

.dropzone-content .size-hint {
  font-size: 0.75rem;
  margin-top: 1rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

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

.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-danger {
  background: var(--danger);
  color: white;
  width: 100%;
}

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

.btn-copy {
  background: var(--surface-hover);
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.btn-copy:hover {
  color: var(--text);
}

.progress-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 12px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

#fileName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

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

.progress-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  text-align: center;
}

.result-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 12px;
}

.result-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--success);
}

.result-item {
  margin-bottom: 1rem;
}

.result-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.copy-field {
  display: flex;
  gap: 0.5rem;
}

.copy-field input {
  flex: 1;
  padding: 0.625rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: monospace;
  font-size: 0.8125rem;
}

.result-section .btn-secondary {
  width: 100%;
  margin-top: 1rem;
}

.error-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 12px;
  text-align: center;
}

.error-message {
  color: var(--error);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.success-message {
  color: var(--success);
  font-size: 0.875rem;
}

.error-section .btn-secondary {
  width: 100%;
}

/* Delete Tab */
.delete-form {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 12px;
}

.delete-result,
.delete-error {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.delete-result {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
}

.delete-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
}

footer {
  text-align: center;
  padding-top: 2rem;
  margin-top: auto;
}

footer p {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: monospace;
}

@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }

  .dropzone {
    padding: 2rem 1rem;
  }
}
