/* ============================================================
   Content Command — Design System
   Dark command-center / ops dashboard aesthetic
============================================================ */

:root {
  /* Surfaces */
  --bg-base: #08090c;
  --bg-surface: #0e1015;
  --bg-elevated: #14171f;
  --bg-panel: #1a1e28;
  --bg-hover: #20242f;

  /* Borders */
  --border-subtle: #1f2330;
  --border-default: #2a2f3d;
  --border-strong: #3a4050;

  /* Text */
  --text-primary: #e8ecf2;
  --text-secondary: #95a0b3;
  --text-tertiary: #5b6478;
  --text-muted: #404858;

  /* Accent — electric amber for distinct identity from Journali (green) */
  --accent: #ffb020;
  --accent-dim: #b87a10;
  --accent-hover: #ffc040;
  --accent-glow: rgba(255, 176, 32, 0.15);
  --accent-soft: rgba(255, 176, 32, 0.08);

  /* Status colors */
  --status-success: #00d68f;
  --status-warning: #f5a623;
  --status-danger: #ff4d6a;
  --status-info: #4d9fff;

  /* Pillar colors (for visual content categorization) */
  --pillar-educational: #4d9fff;
  --pillar-authority: #b366ff;
  --pillar-proof: #00d68f;
  --pillar-community: #ff8c42;

  /* Brand colors (per-brand accents — overridable) */
  --brand-gtoa: #4d9fff;
  --brand-alphae: #b366ff;
  --brand-socialsurge: #ff8c42;

  /* Radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 24px var(--accent-glow);
}

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

html, body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse at top, rgba(255,176,32,0.04) 0%, transparent 50%),
    var(--bg-base);
}

/* ---------- LAYOUT ---------- */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.sidebar-brand-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-brand-logo::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(255,176,32,0.15);
}

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
  font-family: var(--font-mono);
}

.main {
  padding: 24px 32px;
  max-width: 1400px;
}

/* ---------- HEADERS ---------- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0d;
  border-color: var(--accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-elevated);
}

.btn-danger {
  color: var(--status-danger);
  border-color: rgba(255,77,106,0.2);
}

.btn-danger:hover {
  background: rgba(255,77,106,0.1);
  border-color: var(--status-danger);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 20px; font-size: 14px; }

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* ---------- FORMS ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.label-help {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-sans);
  margin-top: -2px;
}

.input, .textarea, .select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s;
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-panel);
}

.textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  font-family: var(--font-sans);
}

.textarea-mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------- BADGES / TAGS ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.badge-pillar {
  background: rgba(77,159,255,0.1);
  color: var(--pillar-educational);
  border-color: rgba(77,159,255,0.2);
}

.badge.pillar-educational { background: rgba(77,159,255,0.1); color: var(--pillar-educational); border-color: rgba(77,159,255,0.2); }
.badge.pillar-authority { background: rgba(179,102,255,0.1); color: var(--pillar-authority); border-color: rgba(179,102,255,0.2); }
.badge.pillar-proof { background: rgba(0,214,143,0.1); color: var(--pillar-proof); border-color: rgba(0,214,143,0.2); }
.badge.pillar-community { background: rgba(255,140,66,0.1); color: var(--pillar-community); border-color: rgba(255,140,66,0.2); }

/* ---------- UTILS ---------- */
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.spacer { flex: 1; }
.hide { display: none !important; }

.text-mono { font-family: var(--font-mono); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent); }

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideIn 0.2s ease;
}

.toast.success { border-left-color: var(--status-success); }
.toast.error { border-left-color: var(--status-danger); }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- AUTH PAGE ---------- */
.auth-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 40px 32px;
  text-align: center;
}

.auth-logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-logo::before {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 16px var(--accent-glow);
}

.auth-sub {
  color: var(--text-tertiary);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.auth-tagline {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.auth-btn {
  width: 100%;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.15s;
}

.auth-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

/* ---------- BRAND CARD (on brands page) ---------- */
.brand-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.15s;
}

.brand-card:hover { border-color: var(--border-default); }

.brand-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.brand-card-body {
  padding: 16px 20px;
}

.brand-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-base);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* Pillar mix bar */
.mix-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.mix-bar-segment { height: 100%; }

/* Pillar editor */
.pillar-row {
  display: grid;
  grid-template-columns: 12px 1fr 80px 32px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
}

.pillar-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}


/* ============================================================
   POLISH PASS — refined interactions + missing states
   Added 2026-05-27 to bring everything to "super clean" level.
============================================================ */

/* ---------- LOADING / SKELETON ---------- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading-shimmer,
.skeleton-line {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0%,
    var(--bg-panel) 50%,
    var(--bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--r-sm);
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
}
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.short { width: 60%; }
.skeleton-line.tall { height: 32px; margin-bottom: 14px; }

.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* ---------- LAYOUT: sidebar gets a footer slot ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-footer-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sidebar-footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-success);
  box-shadow: 0 0 6px rgba(0,214,143,0.5);
}

/* ---------- NAV: left-edge accent on active ---------- */
.nav-item {
  position: relative;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ---------- FOCUS RINGS (subtle, keyboard-friendly, polished) ---------- */
.btn:focus-visible,
.nav-item:focus-visible,
.filter-btn:focus-visible,
.copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.input:focus,
.textarea:focus,
.select:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- CARD / ROW HOVER (subtle lift across surfaces) ---------- */
.brand-card,
.queue-card,
.brand-row,
.history-item {
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.18s ease;
}

.brand-card:hover,
.queue-card:hover,
.brand-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

/* ---------- EMPTY STATES (unified, used everywhere now) ---------- */
.empty-state {
  background: var(--bg-surface);
  border: 1px dashed var(--border-default);
  border-radius: var(--r-md);
  padding: 60px 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.6;
}

.empty-state-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.empty-state a { color: var(--accent); text-decoration: none; }
.empty-state a:hover { text-decoration: underline; }

/* ---------- STATUS TAGS (shared, refined) ---------- */
.status-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  line-height: 1.4;
}
.status-tag.status-idea       { background: rgba(255,176,32,0.12); color: var(--accent); }
.status-tag.status-script     { background: rgba(77,159,255,0.12); color: var(--pillar-educational); }
.status-tag.status-asset      { background: rgba(179,102,255,0.12); color: var(--pillar-authority); }
.status-tag.status-scheduled  { background: rgba(0,214,143,0.12);  color: var(--pillar-proof); }
.status-tag.status-posted     { background: rgba(95,107,134,0.18); color: var(--text-tertiary); }

/* ---------- TILE refinement (data-first typography) ---------- */
.tile-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

/* ---------- BUTTONS — refined ---------- */
.btn-primary {
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

/* ---------- COPY BUTTON (used in generate + queue) ---------- */
.copy-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.12s ease;
}
.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- MIX BAR (grows slightly on hover for visual feedback) ---------- */
.mix-bar { transition: height 0.18s ease; }
.brand-card:hover .mix-bar { height: 8px; }

/* ---------- MODAL POLISH ---------- */
.modal-overlay {
  animation: fadeIn 0.18s ease;
}
.modal-detail {
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ---------- PAGE FADE-IN ---------- */
.main {
  animation: fadeIn 0.22s ease;
}

/* ---------- TOAST refined (slightly larger, longer breathing room) ---------- */
.toast {
  font-family: var(--font-sans);
  min-width: 240px;
  max-width: 380px;
  font-weight: 500;
}

/* ---------- SCROLLBAR refined ---------- */
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
  border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ---------- BRAND COLOR DOT — subtle glow when hovered ---------- */
.brand-row:hover .brand-color-dot,
.brand-card:hover .brand-color-dot {
  box-shadow: 0 0 8px currentColor;
}

/* ---------- POST FORMAT TAG REFINEMENTS (Generate v2 chips) ---------- */
.post-format-tags .format-tag {
  font-variant: tabular-nums;
}

/* ---------- LINKS (subtle accent on hover) ---------- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.12s;
}
a:hover { color: var(--accent-hover); }

/* ---------- SELECTION ---------- */
::selection {
  background: var(--accent);
  color: var(--bg-base);
}

/* ---------- TEXT ACCENT helper ---------- */
.text-accent { color: var(--accent); }
.text-accent-dim { color: var(--accent-dim); }

/* ---------- KBD (keyboard shortcut hint) ---------- */
kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.4;
}
