:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-hover: #22222e;
  --border-color: #2a2a3a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-secondary: #22c55e;
  --accent-secondary-hover: #4ade80;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 150ms ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo svg {
  color: var(--accent);
}

.logo h1 {
  font-size: 28px;
  font-weight: 600;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

main {
  flex: 1;
}

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: var(--bg-secondary);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.drop-zone svg {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.drop-zone p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.drop-zone .hint {
  font-size: 12px;
  color: var(--text-muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: var(--accent-hover);
}

.controls {
  margin-top: 24px;
}

.operation-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.radio-card {
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  transition: var(--transition);
}

.radio-card:hover .radio-content {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.radio-card input:checked + .radio-content {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.radio-card input:checked + .radio-content svg {
  color: var(--accent);
}

.radio-content svg {
  color: var(--text-secondary);
}

.radio-content .label {
  font-weight: 500;
  font-size: 15px;
}

.radio-content .desc {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.queue-section {
  margin-top: 32px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.queue-header h2 {
  font-size: 18px;
  font-weight: 500;
}

.queue-count {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 20px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.queue-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.queue-item-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 500;
}

.queue-item-status.pending {
  background: var(--bg-hover);
  color: var(--text-muted);
}

.queue-item-status.processing {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.queue-item-status.done {
  background: rgba(34, 197, 94, 0.2);
  color: var(--accent-secondary);
}

.queue-item-status.error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.queue-item-progress {
  width: 100px;
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
}

.queue-item-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 100ms ease;
}

.queue-item-download {
  background: none;
  border: none;
  color: var(--accent-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
}

.queue-item-download:hover {
  background: var(--bg-hover);
}

.queue-item-download:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.queue-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
}

.queue-item-remove:hover {
  color: var(--error);
  background: var(--bg-hover);
}

.queue-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

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

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

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

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-download {
  width: 100%;
  margin-top: 16px;
  background: var(--accent-secondary);
  color: white;
}

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

.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); }
}

footer {
  margin-top: 40px;
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

footer p {
  font-size: 12px;
  color: var(--text-muted);
}

.ffmpeg-loading {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
}

.ffmpeg-loading-content {
  text-align: center;
}

.ffmpeg-loading h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.ffmpeg-loading p {
  font-size: 14px;
  color: var(--text-secondary);
}

.ffmpeg-loading .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
  margin-bottom: 16px;
  color: var(--accent);
}

@media (max-width: 600px) {
  .operation-select {
    grid-template-columns: 1fr;
  }
  
  .queue-actions {
    flex-direction: column;
  }
  
  .queue-actions .btn {
    width: 100%;
  }
}
