/* Blog IQ — Design Tokens */
/* Premium SaaS light theme — Mixpanel-inspired */

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

:root {
  /* ─── Colors ──────────────────────────────── */

  /* Surfaces */
  --bg: #F8F8F8;
  --bg-card: #FFFFFF;
  --bg-hover: #F5F5F5;
  --bg-subtle: #F0F0F0;
  --bg-deep: #FFFFFF;
  --bg-nested: #FCFCFC;

  /* Borders */
  --border: rgba(0, 0, 0, 0.08);
  --border-light: #D0D0D0;
  --border-lighter: #EAEAEA;
  --border-hover: rgba(0, 0, 0, 0.12);
  --border-focus: #7B46F6;

  /* Accent — Purple */
  --accent: #7B46F6;
  --accent-hover: #6A39E0;
  --accent-active: #592DAA;
  --accent-muted: #EFE8FD;
  --accent-gradient-start: #7B46F6;
  --accent-gradient-end: #A87BFD;
  --accent-light: #A87BFD;
  --accent-bright: #7B46F6;

  /* Text */
  --text-primary: #1A1A1A;
  --text-secondary: #4A4A4A;
  --text-muted: #6A6A6A;
  --text-dim: #A0A0A0;
  --text-faint: #6A6A6A;
  --text-white: #FFFFFF;

  /* Status */
  --status-published: #00B386;
  --status-published-bg: #E6F7F4;
  --status-review: #7B46F6;
  --status-review-bg: #EFE8FD;
  --status-writing: #007AFF;
  --status-writing-bg: #E8F0FE;
  --status-scheduled-auto: #FF9500;
  --status-scheduled-auto-bg: #FFF3E0;
  --status-scheduled-approval: #007AFF;
  --status-planned: #6A6A6A;
  --status-planned-bg: #F0F0F0;
  --status-declining: #E5484D;
  --status-declining-bg: #FDE8E9;
  --status-improving: #00B386;

  /* Chart colors */
  --chart-series-1: #7B46F6;
  --chart-series-2: #007AFF;
  --chart-series-3: #00B386;
  --chart-series-4: #FF9500;
  --chart-area-start: rgba(123, 70, 246, 0.15);
  --chart-area-end: rgba(123, 70, 246, 0);
  --chart-grid: #EAEAEA;

  /* ─── Typography ──────────────────────────── */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ─── Shadows (2-layer) ───────────────────── */
  --shadow-card: 0px 1px 3px rgba(0, 0, 0, 0.05), 0px 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0px 4px 8px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0px 8px 16px rgba(0, 0, 0, 0.15), 0px 4px 8px rgba(0, 0, 0, 0.08);
  --shadow-primary: 0px 2px 4px rgba(123, 70, 246, 0.3);

  /* ─── CTA ─────────────────────────────────── */
  --btn-primary: linear-gradient(90deg, #7B46F6 0%, #A87BFD 100%);
  --btn-primary-shadow: 0px 2px 4px rgba(123, 70, 246, 0.3);
  --btn-ghost-bg: transparent;
  --btn-ghost-border: #D0D0D0;

  /* ─── Spacing ─────────────────────────────── */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* ─── Radii ───────────────────────────────── */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-pill: 9999px;

  /* ─── Layout ──────────────────────────────── */
  --sidebar-width: 240px;
  --context-panel-width: 280px;

  /* ─── Transitions ─────────────────────────── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-short: 0.15s ease-in-out;
  --transition-medium: 0.2s ease-in-out;
}

/* ─── Reset & Base ──────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ─── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ─── Utility Classes ───────────────────────── */
.label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-secondary);
}

.label-sm {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--text-muted);
}

.page-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ─── Status Badges ─────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.badge-published { background: var(--status-published-bg); color: var(--status-published); }
.badge-review { background: var(--status-review-bg); color: var(--status-review); }
.badge-writing { background: var(--status-writing-bg); color: var(--status-writing); }
.badge-scheduled { background: var(--status-scheduled-auto-bg); color: var(--status-scheduled-auto); }
.badge-planned { background: var(--status-planned-bg); color: var(--status-planned); }
.badge-declining { background: var(--status-declining-bg); color: var(--status-declining); }

/* ─── Trend Badges ──────────────────────────── */
.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.trend-badge.up {
  background: var(--status-published-bg);
  color: var(--status-published);
}
.trend-badge.down {
  background: var(--status-declining-bg);
  color: var(--status-declining);
}
.trend-badge.stable {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

/* ─── Buttons ───────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: var(--btn-primary);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--btn-primary-shadow);
  transition: all var(--transition-medium);
}
.btn-primary:hover {
  background: linear-gradient(90deg, var(--accent-hover) 0%, #976AF0 100%);
  box-shadow: 0px 4px 8px rgba(123, 70, 246, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0px 1px 2px rgba(123, 70, 246, 0.2);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  background: var(--btn-ghost-bg);
  color: var(--text-secondary);
  border: 1px solid var(--btn-ghost-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-short);
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: rgba(0,0,0,0.12);
}

/* ─── Cards ─────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-medium);
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* ─── Inputs ────────────────────────────────── */
.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-short);
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123, 70, 246, 0.12);
}
.input::placeholder { color: var(--text-dim); }

/* ─── Trend indicators ──────────────────────── */
.trend-up { color: var(--status-improving); }
.trend-down { color: var(--status-declining); }
.trend-stable { color: var(--text-muted); }

/* ─── Pill filters ──────────────────────────── */
.pill {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: all var(--transition-short);
  position: relative;
  border: none;
  font-family: var(--font-body);
}
.pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.pill.active {
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 600;
}
.pill .count {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
