/* Archive to YouTube - Web UI */
:root {
  --bg: #0f0f12;
  --surface: #1a1a1f;
  --border: #2a2a32;
  --text: #e8e8ed;
  --text-muted: #888;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 2rem;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.input-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="url"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

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

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

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

.btn-secondary:hover {
  background: #3a3a42;
}

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

.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

.error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.success {
  color: var(--success);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.progress {
  margin: 1rem 0;
}

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

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.hidden { display: none !important; }

/* Spinner for loading states */
.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 0.25rem;
}

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

/* Indeterminate progress bar (animated when we don't have numeric progress) */
.progress-bar-indeterminate {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent) 40%,
    var(--accent) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-step {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Preview loading state */
.preview-loading {
  text-align: center;
  padding: 2.5rem;
}

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

.preview-loading-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.preview-loading-subtitle {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.preview-loading-warning {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
}

.preview-loading-status {
  font-size: 0.875rem;
  color: var(--text-muted);
  min-height: 1.25rem;
}

.app-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.app-footer a {
  color: var(--text-muted);
}

.app-footer a:hover {
  color: var(--accent);
}

.full-width { width: 100%; }
textarea.full-width { min-height: 80px; resize: vertical; }

.privacy-options { display: flex; gap: 1rem; flex-wrap: wrap; }
.radio-label { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; font-weight: normal; }

.edit-tracks-header { margin-top: 1.5rem; margin-bottom: 0.75rem; }
.edit-tracks-list { display: flex; flex-direction: column; gap: 1rem; max-height: 60vh; overflow-y: auto; }
.edit-track { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 1rem; }
.edit-track label { font-size: 0.8rem; color: var(--text-muted); }
.edit-track input, .edit-track textarea { width: 100%; margin-top: 0.25rem; padding: 0.5rem; font-size: 0.9rem; }
.edit-track textarea { min-height: 60px; resize: vertical; }
.edit-track .track-name { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
