/* ReviewRadar — shared stylesheet */

:root {
  --bg:          #0f172a;
  --surface:     #1e293b;
  --surface2:    #263348;
  --border:      #334155;
  --text:        #f1f5f9;
  --text-muted:  #94a3b8;
  --text-faint:  #64748b;
  --accent:      #3b82f6;
  --accent-dim:  #1d4ed8;
  --red:         #ef4444;
  --red-dim:     #fee2e2;
  --green:       #22c55e;
  --green-dim:   #dcfce7;
  --yellow:      #f59e0b;
  --dark:        #0a1628;
  --radius:      10px;
  --shadow:      0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
}

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

html { scroll-behavior: smooth; }

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

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

img { max-width: 100%; }

/* ── Layout ── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 23, 42, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex; align-items: center; gap: 24px;
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  height: 56px;
}
.nav__brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1rem; color: var(--text);
  text-decoration: none; flex-shrink: 0;
}
.nav__brand svg { color: var(--accent); }

.nav__search {
  flex: 1; max-width: 360px; position: relative;
}
.nav__search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  padding: 7px 12px;
  outline: none;
  transition: border-color .15s;
}
.nav__search input:focus { border-color: var(--accent); }
.nav__search input::placeholder { color: var(--text-faint); }

.nav__links { display: flex; gap: 20px; margin-left: auto; }
.nav__links a { font-size: 0.875rem; color: var(--text-muted); }
.nav__links a:hover { color: var(--text); text-decoration: none; }

.nav__badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.75rem; font-weight: 600;
  color: var(--accent);
  background: rgba(59, 130, 246, .12);
  padding: 4px 10px; border-radius: 99px;
  flex-shrink: 0;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(160deg, #0a1628 0%, #0f2040 50%, #0a1628 100%);
  border-bottom: 1px solid var(--border);
  padding: 64px 0 52px;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent);
  background: rgba(59, 130, 246, .12);
  padding: 5px 12px; border-radius: 99px;
  margin-bottom: 20px;
}
.hero__headline {
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 680px;
  margin-bottom: 16px;
}
.hero__sub {
  font-size: 1.05rem; color: var(--text-muted);
  max-width: 580px; margin-bottom: 32px;
}

/* ── Hero search ── */
.hero__search { position: relative; max-width: 500px; margin-bottom: 28px; }
.hero__search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  padding: 14px 18px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.hero__search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.hero__search input::placeholder { color: var(--text-faint); }

/* ── Autocomplete dropdown ── */
.autocomplete {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  overflow: hidden;
  display: none;
}
.autocomplete.open { display: block; }
.autocomplete__item {
  padding: 11px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background .1s;
}
.autocomplete__item:hover, .autocomplete__item.active { background: var(--surface2); }
.autocomplete__item mark {
  background: none;
  color: var(--accent);
  font-weight: 600;
}

/* ── Stats bar ── */
.stats-bar {
  display: flex; flex-wrap: wrap; gap: 28px;
  padding: 20px 0;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.stat__label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── Ad slots ── */
.ad-slot { min-height: 90px; display: flex; align-items: center; justify-content: center; }

/* ── Section titles ── */
.section-title {
  font-size: 1.25rem; font-weight: 700;
  margin-bottom: 20px;
  padding-top: 48px;
}

/* ── City cards grid ── */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding-bottom: 48px;
}
.city-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.city-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.city-card__name {
  font-weight: 700; font-size: 0.95rem;
  margin-bottom: 10px;
}
.city-card__stats { display: flex; flex-direction: column; gap: 4px; }
.city-card__stat {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.8rem; color: var(--text-muted);
}
.city-card__stat strong { color: var(--text); font-size: 0.9rem; font-weight: 600; }
.city-card__freshness {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.72rem; color: var(--text-faint);
  background: var(--surface2);
  padding: 2px 8px; border-radius: 99px;
}
.city-card--pending .city-card__name { color: var(--text-muted); }

/* ── City page header ── */
.city-header {
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 32px;
}
.city-header__eyebrow {
  font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: 8px;
}
.city-header__eyebrow a { color: var(--text-muted); }
.city-header__eyebrow a:hover { color: var(--text); }
.city-header__headline {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.city-header__meta { font-size: 0.875rem; color: var(--text-muted); }

/* ── Summary chips ── */
.summary-chips {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 20px 0 0;
}
.chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
}
.chip__value { font-size: 1.1rem; font-weight: 700; }
.chip__label { color: var(--text-muted); font-size: 0.78rem; }

/* ── Filter bar ── */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 24px 0 16px;
}
.filter-bar label { font-size: 0.85rem; color: var(--text-muted); }
.select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  padding: 7px 32px 7px 12px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  outline: none;
}
.select:focus { border-color: var(--accent); }

/* ── Rankings table ── */
.table-wrap { overflow-x: auto; }
.rankings-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 40px;
}
.rankings-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.rankings-table th:hover { color: var(--text); }
.rankings-table th.sorted { color: var(--accent); }
.rankings-table th .sort-arrow { margin-left: 4px; opacity: .6; }
.rankings-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(51,65,85,.5);
  vertical-align: middle;
}
.rankings-table tr:last-child td { border-bottom: none; }
.rankings-table tbody tr:hover td { background: var(--surface2); }

.rank { font-weight: 700; color: var(--text-faint); min-width: 32px; }
.rank--top { color: var(--yellow); }

.biz-name { font-weight: 600; margin-bottom: 3px; }
.biz-name a { color: var(--text); }
.biz-name a:hover { color: var(--accent); text-decoration: none; }
.biz-category {
  display: inline-block;
  font-size: 0.72rem; color: var(--text-faint);
  background: var(--surface2);
  padding: 2px 7px; border-radius: 4px;
}
.biz-address { font-size: 0.78rem; color: var(--text-faint); margin-top: 2px; }

.removed-count {
  font-weight: 700; font-size: 1rem;
  white-space: nowrap;
}
.removed-range { font-size: 0.78rem; color: var(--text-muted); }

.rating-col { white-space: nowrap; }
.rating-orig { font-weight: 600; }
.rating-adj { font-size: 0.78rem; color: var(--red); }
.rating-adj::before { content: '→ '; }

/* ── Trend badge ── */
.trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.78rem; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
  white-space: nowrap;
}
.trend--up    { color: var(--red);   background: rgba(239,68,68,.12); }
.trend--down  { color: var(--green); background: rgba(34,197,94,.12); }
.trend--same  { color: var(--text-faint); background: var(--surface2); }
.trend--new   { color: var(--accent); background: rgba(59,130,246,.12); }

/* ── History row (expanded) ── */
.history-row td {
  padding: 0 !important;
  background: var(--dark) !important;
}
.history-panel {
  padding: 16px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.history-panel h4 { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }
.sparkline { display: block; }

/* ── Expand toggle ── */
.btn-expand {
  background: none; border: none; color: var(--accent);
  font-size: 0.8rem; cursor: pointer; padding: 0;
}
.btn-expand:hover { text-decoration: underline; }

/* ── Pagination ── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 24px 0 40px;
}
.pagination button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .15s;
}
.pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination button.active { border-color: var(--accent); color: var(--accent); background: rgba(59,130,246,.1); }
.pagination__info { font-size: 0.8rem; color: var(--text-muted); }

/* ── Empty / loading states ── */
.state-loading, .state-empty, .state-error {
  text-align: center; padding: 64px 20px;
  color: var(--text-muted);
}
.state-loading .spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 40px;
}
.footer__inner {
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; text-align: center;
}
.footer__brand {
  display: flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 0.9rem;
  color: var(--text-muted);
}
.footer__nav { font-size: 0.82rem; color: var(--text-faint); }
.footer__nav a { color: var(--text-faint); }
.footer__nav a:hover { color: var(--text-muted); }
.footer__disclaimer {
  font-size: 0.78rem; color: var(--text-faint);
  max-width: 640px;
}

/* ── Prose (legal pages) ── */
.prose { max-width: 700px; padding: 48px 0 80px; }
.prose h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.prose .date { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 36px; display: block; }
.prose h2 { font-size: 1.05rem; font-weight: 700; margin: 32px 0 10px; }
.prose p, .prose li { font-size: 0.92rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 10px; }
.prose ul { list-style: disc; padding-left: 20px; }
.prose a { color: var(--accent); }
.highlight-box {
  background: var(--dark); border-radius: 10px;
  padding: 22px 26px; margin: 28px 0;
}
.highlight-box p { color: #94a3b8; margin: 0; }
.highlight-box strong { color: #fff; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__badge { display: none; }
  .hero { padding: 40px 0 36px; }
  .city-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .rankings-table td, .rankings-table th { padding: 10px 10px; }
  .biz-address { display: none; }
  .filter-bar { gap: 8px; }
}

@media (max-width: 480px) {
  .hero__headline { font-size: 1.6rem; }
  .city-grid { grid-template-columns: 1fr 1fr; }
}
