/* dollarbird-carousel review UI — design tokens lifted from shared/agent-ui.css */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Light theme */
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --surface-3: #e7e5e4;
  --border: #d6d3d1;
  --border-subtle: #e7e5e4;
  --text: #1c1917;
  --text-2: #44403c;
  --text-3: #78716c;
  --text-4: #a8a29e;
  --accent: #c2410c;
  --accent-soft: rgba(194,65,12,0.08);
  --accent-hover: #9a3412;
  --green: #16a34a;
  --green-soft: rgba(22,163,74,0.10);
  --green-border: rgba(22,163,74,0.25);
  --amber: #d97706;
  --amber-soft: rgba(217,119,6,0.10);
  --amber-border: rgba(217,119,6,0.25);
  --red: #dc2626;
  --red-soft: rgba(220,38,38,0.08);
  --red-border: rgba(220,38,38,0.25);
  --blue: #2563eb;
  --blue-soft: rgba(37,99,235,0.08);
  --gray: #71717a;
  --gray-soft: rgba(113,113,122,0.10);
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
  --transition: 0.15s ease;
}

:root[data-theme="dark"] {
  --bg: #0c0a09;
  --surface: #1c1917;
  --surface-2: #292524;
  --surface-3: #44403c;
  --border: #44403c;
  --border-subtle: #292524;
  --text: #fafaf9;
  --text-2: #d6d3d1;
  --text-3: #a8a29e;
  --text-4: #78716c;
  --accent: #fb923c;
  --accent-soft: rgba(251,146,60,0.12);
  --accent-hover: #fdba74;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

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

code, kbd, pre { font-family: var(--mono); font-size: 0.92em; }
pre {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.45;
}

button, input, textarea, select { font: inherit; color: inherit; }

button {
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
button:hover { background: var(--surface-2); border-color: var(--text-3); }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--red); border-color: var(--red-border); }
button.danger:hover { background: var(--red-soft); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--surface-2); }

input[type="text"], input[type="search"], textarea, select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  outline: none;
  transition: border-color var(--transition);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { font-family: var(--mono); resize: vertical; min-height: 64px; }

/* ─── chrome ──────────────────────────────────────────────────── */

header.app-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
}
header.app-header h1 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
header.app-header .agent-tag {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 3px 8px;
  color: var(--text-2);
}
header.app-header nav {
  display: flex; gap: 4px; flex: 1;
  overflow-x: auto;
}
header.app-header nav a {
  font-size: 0.85rem;
  color: var(--text-2);
  padding: 6px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
header.app-header nav a:hover { background: var(--surface-2); color: var(--text); }
header.app-header nav a.active { background: var(--accent-soft); color: var(--accent); }
header.app-header .right { display: flex; align-items: center; gap: 8px; }

main.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

h2 { font-size: 1.4rem; margin: 0 0 6px; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; margin: 16px 0 8px; }
h4 { font-size: 0.92rem; margin: 12px 0 6px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.subtitle { color: var(--text-3); font-size: 0.92rem; margin: 0 0 24px; }

/* ─── status pills ────────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; font-family: var(--mono); font-weight: 500;
  padding: 2px 8px; border-radius: 99px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.pill.green   { background: var(--green-soft);  border-color: var(--green-border);  color: var(--green); }
.pill.amber   { background: var(--amber-soft);  border-color: var(--amber-border);  color: var(--amber); }
.pill.red     { background: var(--red-soft);    border-color: var(--red-border);    color: var(--red); }
.pill.blue    { background: var(--blue-soft);   border-color: rgba(37,99,235,0.25); color: var(--blue); }
.pill.gray    { background: var(--gray-soft);   border-color: var(--border);        color: var(--text-3); }
.pill.accent  { background: var(--accent-soft); border-color: rgba(194,65,12,0.25); color: var(--accent); }

.chip {
  display: inline-block;
  font-family: var(--mono); font-size: 0.74rem;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2px 7px;
  color: var(--text-2);
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}

/* ─── cards / grid ────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.grid.wide    { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; color: inherit;
}
.card:hover { border-color: var(--border); box-shadow: var(--shadow); }
.card.clickable { cursor: pointer; }
.card.clickable:hover { transform: translateY(-1px); }

.card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.card-title { font-weight: 600; font-size: 0.95rem; margin: 0; line-height: 1.35; }
.card-id    { font-family: var(--mono); font-size: 0.78rem; color: var(--text-3); }
.card-foot  { font-size: 0.78rem; color: var(--text-3); margin-top: auto; display: flex; justify-content: space-between; }

.thumb {
  width: 100%;
  aspect-ratio: 9 / 16;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  object-fit: cover;
  overflow: hidden;
}
.thumb-row { display: flex; gap: 6px; overflow-x: auto; }
.thumb-row .thumb { width: 80px; aspect-ratio: 9/16; flex-shrink: 0; }

/* ─── workflow diagram (home page) ────────────────────────────── */

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.workflow-step {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color var(--transition), background var(--transition);
  text-decoration: none; color: inherit;
  position: relative;
}
.workflow-step:hover { border-color: var(--border); background: var(--surface-2); }
.workflow-step.done { border-left: 3px solid var(--green); }
.workflow-step.partial { border-left: 3px solid var(--amber); }
.workflow-step.missing { border-left: 3px solid var(--text-4); opacity: 0.85; }
.workflow-step.manual { border-left: 3px solid var(--blue); }
.workflow-step .step-num {
  font-family: var(--mono); font-size: 0.74rem; color: var(--text-3);
  display: flex; justify-content: space-between; align-items: center;
}
.workflow-step .step-name { font-weight: 600; font-size: 0.98rem; }
.workflow-step .step-desc { font-size: 0.85rem; color: var(--text-3); line-height: 1.4; }
.workflow-step .step-meta { font-size: 0.78rem; color: var(--text-2); display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── slide carousel ──────────────────────────────────────────── */

.carousel {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.carousel .slide-stage {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.carousel .slide-img {
  max-height: 600px;
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--surface-3);
  object-fit: contain;
}
.carousel .slide-overlay {
  font-family: var(--mono); font-size: 0.78rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--text-2);
  max-width: 320px;
}
.carousel .slide-thumbs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
}
.carousel .slide-thumbs img {
  width: 56px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition), border-color var(--transition);
}
.carousel .slide-thumbs img:hover { opacity: 1; }
.carousel .slide-thumbs img.active { border-color: var(--accent); opacity: 1; }
.carousel .slide-meta {
  font-size: 0.85rem; color: var(--text-2);
  display: flex; gap: 12px;
}

/* ─── feedback panel ──────────────────────────────────────────── */

.feedback-panel {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.rating { display: flex; gap: 4px; }
.rating .star {
  cursor: pointer; font-size: 1.4rem; color: var(--text-4); user-select: none;
  transition: color var(--transition), transform var(--transition);
}
.rating .star:hover { transform: scale(1.15); }
.rating .star.on { color: var(--accent); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-toggle {
  font-family: var(--mono); font-size: 0.78rem;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.tag-toggle.on {
  background: var(--accent-soft);
  border-color: rgba(194,65,12,0.25);
  color: var(--accent);
}

/* ─── toolbar / filters ───────────────────────────────────────── */

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 16px 0 14px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.toolbar label { font-size: 0.85rem; color: var(--text-3); }
.toolbar .spacer { flex: 1; }

/* ─── empty state ─────────────────────────────────────────────── */

.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  color: var(--text-3);
  background: var(--surface);
}
.empty .empty-icon { font-size: 2rem; margin-bottom: 10px; opacity: 0.6; }
.empty .empty-hint { font-size: 0.85rem; color: var(--text-4); margin-top: 8px; }

/* ─── two-column layout ───────────────────────────────────────── */

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ─── breadcrumbs ─────────────────────────────────────────────── */

.crumbs { font-size: 0.85rem; color: var(--text-3); margin-bottom: 10px; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 6px; opacity: 0.5; }

/* ─── live run output ─────────────────────────────────────────── */

.run-stream {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: 480px; overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── stats / metrics row ────────────────────────────────────── */

.metric-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.metric {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 120px;
}
.metric .metric-label { font-size: 0.75rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.metric .metric-value { font-size: 1.1rem; font-weight: 600; font-family: var(--mono); margin-top: 2px; }

/* ─── small utilities ─────────────────────────────────────────── */

.row     { display: flex; gap: 10px; align-items: center; }
.col     { display: flex; flex-direction: column; gap: 8px; }
.muted   { color: var(--text-3); }
.mono    { font-family: var(--mono); }
.small   { font-size: 0.85rem; }
.tiny    { font-size: 0.78rem; }
.right   { margin-left: auto; }
hr.sep   { border: none; border-top: 1px solid var(--border-subtle); margin: 16px 0; }
.hidden  { display: none !important; }
