/* public/css/base.css — Design tokens and global resets */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Brand */
  --brand:         #1a3a2a;
  --brand-light:   #2d5c44;
  --brand-muted:   #e8f2ec;
  --accent:        #e8472c;
  --accent-soft:   #fff1ee;
  --accent-hover:  #c83620;
  --gold:          #c8922a;
  --gold-soft:     #fdf6e8;
  --gold-border:   rgba(200,146,42,0.3);
  --verified:      #1a7a4a;
  --verified-bg:   #edfaf3;
  --disputed:      #c25b0a;
  --disputed-bg:   #fef3ee;

  /* Neutrals */
  --ink:           #111111;
  --ink2:          #3d3d3a;
  --ink3:          #6b6b67;
  --ink4:          #9b9b96;
  --surface:       #f9f8f5;
  --surface2:      #f2f1ec;
  --surface3:      #e8e7e0;
  --white:         #ffffff;
  --border:        rgba(0,0,0,0.08);
  --border-md:     rgba(0,0,0,0.14);
  --border-strong: rgba(0,0,0,0.22);

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.06);
  --shadow:     0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.15);

  /* Radii */
  --r-sm:  6px;
  --r:     10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-full: 999px;

  /* Fonts */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  /* Transitions */
  --t-fast: 120ms ease;
  --t:      200ms ease;
  --t-slow: 350ms ease;

  /* Layout */
  --max-w:        1120px;
  --nav-h:        52px;
  --locality-h:   40px;
  --cat-h:        48px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
input, select, textarea { font-family: inherit; }

/* ─── UTILITY CLASSES ─────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-muted   { color: var(--ink3); }
.text-brand   { color: var(--brand); }
.text-accent  { color: var(--accent); }
.text-mono    { font-family: var(--font-mono); }
.hidden       { display: none !important; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-sm       { gap: 6px; }
.gap          { gap: 12px; }
.gap-lg       { gap: 20px; }

/* ─── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--r-sm); font-size: 0.875rem;
  font-weight: 600; transition: all var(--t); white-space: nowrap;
  cursor: pointer; border: 1.5px solid transparent; line-height: 1;
}
.btn-primary  { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover  { background: var(--brand-light); border-color: var(--brand-light); }
.btn-accent   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover   { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline  { background: transparent; color: var(--ink); border-color: var(--border-md); }
.btn-outline:hover  { background: var(--surface2); border-color: var(--border-strong); }
.btn-ghost    { background: transparent; color: var(--ink3); border-color: transparent; }
.btn-ghost:hover    { background: var(--surface2); color: var(--ink); }
.btn-sm       { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg       { padding: 13px 28px; font-size: 1rem; }
.btn-full     { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── FORM ELEMENTS ───────────────────────────────────────────────────────── */
.form-group        { margin-bottom: 16px; }
.form-label        { display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-input,
.form-select,
.form-textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border-md);
  border-radius: var(--r-sm); font-size: 0.9rem; font-family: inherit;
  background: var(--white); color: var(--ink); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,58,42,0.1); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

/* ─── BADGES / CHIPS ──────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-full); font-size: 0.72rem; font-weight: 600; }
.chip-brand    { background: var(--brand-muted); color: var(--brand); }
.chip-verified { background: var(--verified-bg); color: var(--verified); border: 1px solid rgba(26,122,74,0.25); }
.chip-disputed { background: var(--disputed-bg); color: var(--disputed); border: 1px solid rgba(194,91,10,0.25); }
.chip-gold     { background: var(--gold-soft);   color: var(--gold);     border: 1px solid var(--gold-border); }

/* ─── CARD ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
}
.card-body { padding: 16px 18px; }

/* ─── SPINNER ──────────────────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border-md);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TOAST ────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; border-radius: var(--r-sm);
  padding: 11px 22px; font-size: 0.85rem; font-weight: 500;
  box-shadow: var(--shadow-lg); pointer-events: auto; white-space: nowrap;
  animation: toast-in 0.25s ease forwards;
}
.toast.toast-success { background: var(--verified); }
.toast.toast-error   { background: var(--accent); }
.toast.toast-out     { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(12px); } }

/* ─── MODAL ────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.42);
  z-index: 400; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--r-lg); padding: 28px 30px;
  width: 100%; max-width: 440px; position: relative; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-xl);
  animation: modal-in 0.2s ease;
}
.modal-wide { max-width: 560px; }
@keyframes modal-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 30px; height: 30px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--ink3); background: var(--surface2); transition: all var(--t);
}
.modal-close:hover { background: var(--surface3); color: var(--ink); }
.modal h2 { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 4px; }
.modal .modal-sub { font-size: 0.85rem; color: var(--ink3); margin-bottom: 20px; }

/* ─── PULSE BAR ────────────────────────────────────────────────────────────── */
.pulse-track { height: 4px; background: var(--surface3); border-radius: 2px; }
.pulse-fill  { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--verified), #43c47a); transition: width 0.5s ease; }

/* ─── EMPTY STATE ──────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink3); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.empty-state p  { font-size: 0.85rem; line-height: 1.6; }

/* ─── SKELETON LOADER ──────────────────────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── SCROLLBAR ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink4); }

/* ─── MEDIA ─────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
