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

:root {
  --bg:        #0f1117;
  --bg-card:   #1a1d27;
  --bg-card2:  #21253a;
  --border:    rgba(255,255,255,.08);
  --text-1:    #f1f5f9;
  --text-2:    #94a3b8;
  --text-3:    #64748b;
  --accent:    #6366f1;
  --accent-2:  #818cf8;
  --fox:       #f97316;
  --mozilla:   #a855f7;
  --alert:     #ef4444;
  --gold:      #f59e0b;
  --green:     #22c55e;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
  border-bottom: 1px solid rgba(99,102,241,.3);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand { display: flex; align-items: center; gap: 12px; }

.brand-icon { font-size: 28px; filter: drop-shadow(0 0 8px rgba(249,115,22,.5)); }

.brand-name {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(90deg, #f1f5f9, var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.header-controls { display: flex; align-items: center; gap: 12px; }

.last-updated { font-size: 11px; color: var(--text-3); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { cursor: pointer; border: none; border-radius: var(--radius-sm);
       font-family: inherit; font-size: 13px; font-weight: 500;
       padding: 7px 14px; transition: all .15s; }

.btn-ghost {
  background: rgba(255,255,255,.06);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,.12); color: var(--text-1); }

/* ── Filters bar ─────────────────────────────────────────────────────────── */
.filters-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 61px;
  z-index: 90;
}

.filters-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-label { font-size: 11px; color: var(--text-3); white-space: nowrap; }

.filter-pills { display: flex; gap: 6px; }

.pill {
  cursor: pointer; border: 1px solid var(--border);
  background: transparent; color: var(--text-2);
  font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 4px 12px; border-radius: 999px; transition: all .15s;
  white-space: nowrap;
}
.pill:hover { background: rgba(255,255,255,.06); color: var(--text-1); }
.pill-active {
  background: var(--accent); border-color: var(--accent);
  color: #fff;
}

.select {
  background: rgba(255,255,255,.05); color: var(--text-1);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 12px; padding: 5px 10px; cursor: pointer;
  outline: none;
}
.select:focus { border-color: var(--accent); }

.count-badge {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}

/* ── Stats row ───────────────────────────────────────────────────────────── */
.stats-row {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  min-width: 120px;
  flex: 1;
  max-width: 180px;
}
.stat-value { font-size: 24px; font-weight: 700; color: var(--text-1); }
.stat-label { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ── Main grid ───────────────────────────────────────────────────────────── */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(99,102,241,.4);
}
.card.is-reviewed {
  opacity: .6;
  border-color: var(--green);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 0;
  gap: 8px;
}

.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Category badges */
.category-badge {
  font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
}
.cat-firefox { background: rgba(249,115,22,.15); color: var(--fox); border: 1px solid rgba(249,115,22,.3); }
.cat-mozilla { background: rgba(168,85,247,.15); color: var(--mozilla); border: 1px solid rgba(168,85,247,.3); }
.cat-alert   { background: rgba(239,68,68,.15);   color: var(--alert);   border: 1px solid rgba(239,68,68,.3); }
.cat-none    { background: rgba(148,163,184,.1);   color: var(--text-3);  border: 1px solid var(--border); }

.top-badge {
  font-size: 10px; font-weight: 700;
  background: rgba(245,158,11,.15); color: var(--gold);
  border: 1px solid rgba(245,158,11,.3);
  padding: 2px 8px; border-radius: 999px;
}
.alert-badge {
  font-size: 10px; font-weight: 700;
  background: rgba(239,68,68,.15); color: var(--alert);
  border: 1px solid rgba(239,68,68,.3);
  padding: 2px 8px; border-radius: 999px;
}

/* Review button */
.review-btn {
  cursor: pointer; background: transparent;
  border: 1px solid var(--border); color: var(--text-3);
  font-family: inherit; font-size: 11px; font-weight: 500;
  padding: 4px 10px; border-radius: var(--radius-sm);
  transition: all .15s; white-space: nowrap; flex-shrink: 0;
}
.review-btn:hover { background: rgba(34,197,94,.1); color: var(--green); border-color: var(--green); }
.review-btn.reviewed { background: rgba(34,197,94,.1); color: var(--green); border-color: var(--green); }

/* Card body */
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.card-title {
  font-size: 15px; font-weight: 600; color: var(--text-1);
  text-decoration: none; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-title:hover { color: var(--accent-2); }

.card-byline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-source { font-size: 12px; font-weight: 600; color: var(--text-2); }
.card-date   { font-size: 12px; color: var(--text-3); }
.country-flag { font-size: 11px; color: #b45309; background: rgba(180,83,9,.1);
                padding: 1px 7px; border-radius: 999px; border: 1px solid rgba(180,83,9,.2); }

/* Snippets */
.snippets { display: flex; flex-direction: column; gap: 6px; }
.snippet {
  font-size: 12px; color: var(--text-2); line-height: 1.5;
  border-left: 3px solid var(--accent);
  padding: 4px 10px;
  background: rgba(99,102,241,.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.snippet b { color: #fde68a; font-weight: 600; }

/* Summary */
.card-summary { font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* Personnel row */
.personnel-row {
  display: flex; align-items: flex-start; gap: 6px;
  background: rgba(168,85,247,.06); border: 1px solid rgba(168,85,247,.15);
  border-radius: var(--radius-sm); padding: 6px 10px;
  font-size: 12px;
}
.personnel-label { flex-shrink: 0; }
.personnel-names { color: #d8b4fe; font-weight: 500; }

/* ── States ──────────────────────────────────────────────────────────────── */
.loading-state, .error-state, .empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 24px; gap: 12px; color: var(--text-3); text-align: center;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .article-grid { grid-template-columns: 1fr; }
  .filters-inner { gap: 12px; }
  .stats-row { padding-top: 12px; }
}
