/* Reel Creation Hub — dark, minimal, pink accent */

:root {
  --bg: #0d0d10;
  --surface: #16161b;
  --surface-2: #1e1e25;
  --line: #2a2a33;
  --text: #eceaf0;
  --muted: #8f8d98;
  --accent: #e1306c;
  --accent-soft: rgba(225, 48, 108, 0.14);
  --ok: #3ddc85;
  --warn: #f5b840;
  --bad: #ff5c5c;
  --radius: 12px;
  --font-body: "Inter", system-ui, sans-serif;
  --font-display: "Space Grotesk", var(--font-body);
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }

h1 { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 2.2rem 0 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── wordmark: the one loud thing ── */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: -0.03em;
}
.wordmark span { color: var(--accent); }
.wordmark.small { font-size: 1.15rem; }

/* ── auth ── */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(600px 300px at 85% -10%, var(--accent-soft), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
}
.auth-sub { color: var(--muted); margin: 0.4rem 0 1.6rem; }
.auth-switch { margin: 1.2rem 0 0; color: var(--muted); font-size: 0.9rem; }

/* ── forms ── */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
input, select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 0.65rem 0.8rem;
  font: inherit;
}
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.form-error { color: var(--bad); font-size: 0.88rem; margin: 0.4rem 0 0.8rem; }

.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: #26262f; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #c92a5f; }
.btn.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.full { width: 100%; }
.linklike {
  background: none; border: none; padding: 0;
  color: var(--accent); font: inherit; cursor: pointer;
}
.linklike:hover { text-decoration: underline; }

/* ── app shell ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(13, 13, 16, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.tabs { display: flex; gap: 0.25rem; flex: 1; }
.tab {
  background: none; border: none; color: var(--muted);
  font: inherit; font-weight: 500;
  padding: 0.45rem 0.8rem; border-radius: 8px; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--accent-soft); }
.userchip { display: flex; align-items: center; gap: 0.8rem; font-size: 0.9rem; color: var(--muted); }

.panel { max-width: 960px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* ── pickers ── */
.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.4rem 0 1rem; }
.picker {
  display: flex; flex-direction: column; gap: 0.3rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.picker:hover { border-color: var(--accent); background: var(--accent-soft); }
.picker.filled { border-style: solid; border-color: var(--accent); }
.picker-kicker { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.picker-hint { font-weight: 500; word-break: break-all; }

/* ── queue & cards ── */
.queue, .gallery { display: grid; gap: 0.75rem; }
.gallery { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.empty { color: var(--muted); font-size: 0.92rem; }

.job-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.job-meta { flex: 1; min-width: 180px; }
.job-title { font-weight: 600; font-size: 0.95rem; }
.job-sub { color: var(--muted); font-size: 0.82rem; }

.status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.queued::before { background: var(--muted); }
.status.running::before { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.status.success::before { background: var(--ok); }
.status.failed::before { background: var(--bad); }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .status.running::before { animation: none; } }

/* ── gallery cards ── */
.reel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.reel-card video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; }
.reel-card .reel-info { padding: 0.7rem 0.9rem; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.reel-card .reel-date { color: var(--muted); font-size: 0.8rem; }
.dl { color: var(--accent); font-weight: 600; font-size: 0.85rem; text-decoration: none; }
.dl:hover { text-decoration: underline; }

/* ── manager ── */
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1.2rem 0 1rem; }
.filters select, .filters input { width: auto; min-width: 130px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.jobs-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 620px; }
.jobs-table th, .jobs-table td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); }
.jobs-table th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; background: var(--surface); }
.jobs-table tr:last-child td { border-bottom: none; }
.jobs-table td .job-sub { display: block; }

/* ── mobile ── */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .pickers { grid-template-columns: 1fr; }
  .panel { padding: 1.4rem 1rem 4rem; }
}
