/* App pages — extends the theme.css base */

.app-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px;
}

.app-header {
  margin-bottom: 48px;
}

.app-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 8px;
}

.app-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

/* Pipeline form */
.pipeline-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 40px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.btn-primary {
  background: var(--cyan);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* Status card */
.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 40px;
}

.status-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.pending { background: var(--text-muted); }
.status-dot.generating_script { background: #f59e0b; }
.status-dot.generating_voice { background: #f59e0b; animation: pulse 1s infinite; }
.status-dot.fetching_footage { background: #f59e0b; animation: pulse 1s infinite; }
.status-dot.assembling { background: #f59e0b; animation: pulse 1s infinite; }
.status-dot.uploading { background: #8b5cf6; animation: pulse 1s infinite; }
.status-dot.completed { background: #22c55e; }
.status-dot.failed { background: #ef4444; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.status-step {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Video list */
.videos-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.video-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: background 0.2s;
}

.video-item:hover { background: var(--surface2); }

.video-info { flex: 1; min-width: 0; }
.video-topic {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.video-meta { font-size: 12px; color: var(--text-muted); }

.video-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending { background: var(--surface2); color: var(--text-muted); }
.badge-generating_script, .badge-generating_voice, .badge-fetching_footage, .badge-assembling { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-uploading { background: var(--violet-dim); color: var(--violet); }
.badge-completed { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-failed { background: rgba(239,68,68,0.15); color: #ef4444; }

.video-link {
  color: var(--cyan);
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
}
.video-link:hover { text-decoration: underline; }

/* Loading spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--surface2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* API error */
.error-msg {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  padding: 12px 16px;
  color: #ef4444;
  font-size: 14px;
  margin-top: 12px;
}

@media (max-width: 600px) {
  .app-page { padding: 32px 20px; }
  .form-row { flex-direction: column; }
  .btn-primary { width: 100%; }
}