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

:root {
  --bg:          #f0f2f4;
  --surface:     #ffffff;
  --surface2:    #f8f9fa;
  --charcoal:    #1a1f2e;
  --charcoal2:   #252b3b;
  --charcoal3:   #2f3647;
  --green:       #2d7a3a;
  --green-light: #38a047;
  --green-pale:  #e8f5ea;
  --border:      #e2e6ea;
  --border-dark: #c8cdd5;
  --text:        #1a1f2e;
  --text-muted:  #6b7280;
  --text-light:  #9ca3af;
  --radius:      6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── HEADER ─────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--charcoal);
  border-bottom: 3px solid var(--green);
}

.header-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 60px;
}

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

.brand-mark {
  background: var(--green);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 4px;
  line-height: 1;
  white-space: nowrap;
}

.brand-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
}

.brand-subtitle {
  font-size: 11px;
  color: #8a9ab5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
  font-family: 'Barlow Condensed', sans-serif;
}

/* Submit Camp Button */
.submit-camp-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}

.submit-camp-btn:hover { background: var(--green-light); }
.submit-camp-btn:active { transform: scale(0.97); }

.submit-camp-btn-icon {
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  margin-top: -1px;
}

/* ── STATS TICKER ────────────────────────────────── */

.stats-ticker {
  background: var(--charcoal2);
  border-bottom: 1px solid var(--charcoal3);
}

.stats-ticker-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 8px 0;
  margin-right: 20px;
  border-right: 1px solid var(--charcoal3);
}

.stat-item:last-child { border-right: none; margin-right: 0; }

.stat-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a9ab5;
  white-space: nowrap;
}

.stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--green-light);
  line-height: 1;
}

.stat-updated {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--green-light);
  border-radius: 50%;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ── CONTROLS ────────────────────────────────────── */

.controls-section {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

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

.controls-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: 4px;
}

.controls-inner input,
.controls-inner select {
  background: var(--surface2);
  border: 1px solid var(--border-dark);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
  min-width: 140px;
}

.controls-inner input::placeholder { color: var(--text-light); }

.controls-inner input:focus,
.controls-inner select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45,122,58,0.12);
  background: #fff;
}

.controls-inner select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

/* ── CONTENT ─────────────────────────────────────── */

.content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* ── MAP CARD ────────────────────────────────────── */

.map-card {
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

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

.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--charcoal);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--green);
  border-radius: 2px;
}

.card-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#map {
  height: 420px;
  width: 100%;
}

/* Leaflet popup */
.leaflet-popup-content-wrapper {
  background: var(--charcoal) !important;
  border: 2px solid var(--green) !important;
  border-radius: 6px !important;
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}
.leaflet-popup-tip { background: var(--charcoal) !important; }
.leaflet-popup-content { font-family: 'Barlow', sans-serif; font-size: 13px; line-height: 1.6; }
.leaflet-popup-content b { color: var(--green-light); font-family: 'Barlow Condensed', sans-serif; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }

/* Marker */
.field-marker {
  width: 14px !important;
  height: 14px !important;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

/* Clusters */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(45,122,58,0.18) !important;
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: var(--green) !important;
  color: #fff !important;
  font-family: 'Barlow Condensed', sans-serif !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}

/* ── TABLE CARD ──────────────────────────────────── */

.table-card {
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

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

#resultCount {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 12px;
}

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 10px 16px;
  text-align: left;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

tbody tr { transition: background 0.1s; cursor: default; }

tbody tr:hover { background: #f0f7f1; }

tbody tr:hover td:first-child {
  border-left: 3px solid var(--green);
  padding-left: 13px;
}

tbody tr:last-child td { border-bottom: none; }

td:first-child {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--charcoal);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-state  { background: var(--charcoal); color: #fff; }
.badge-region { background: var(--green-pale); color: var(--green); border: 1px solid #b8dfc0; }
.badge-replay-yes { background: var(--green-pale); color: var(--green); border: 1px solid #b8dfc0; }
.badge-replay-no  { background: #f3f4f6; color: var(--text-light); border: 1px solid var(--border); }

/* Visit link */
td a {
  display: inline-block;
  background: var(--charcoal);
  color: #fff;
  text-decoration: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 4px;
  transition: background 0.15s;
}

td a:hover { background: var(--green); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── MODAL ───────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 22, 0.72);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(12px);
  transition: transform 0.22s ease;
}

.modal-overlay.is-open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--charcoal);
  border-radius: 10px 10px 0 0;
  gap: 12px;
}

.modal-eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-light);
  display: block;
  margin-bottom: 4px;
}

.modal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
}

.modal-close {
  background: none;
  border: none;
  color: #8a9ab5;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  margin-top: -2px;
  transition: color 0.15s;
  flex-shrink: 0;
}

.modal-close:hover { color: #fff; }

.modal-body {
  padding: 22px;
}

.modal-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ── CAMP FORM ───────────────────────────────────── */

.camp-form { display: flex; flex-direction: column; gap: 14px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group-full { grid-column: 1 / -1; }

.form-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.required { color: var(--green); }

.form-input {
  background: var(--surface2);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  font-family: 'Barlow', sans-serif;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder { color: var(--text-light); }

.form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45,122,58,0.12);
  background: #fff;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.btn-cancel {
  background: none;
  border: 1px solid var(--border-dark);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 9px 18px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }

.btn-submit {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 22px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
  justify-content: center;
}

.btn-submit:hover:not(:disabled) { background: var(--green-light); }

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Spinner */
.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-submit.is-loading .btn-spinner { display: block; }
.btn-submit.is-loading .btn-label  { opacity: 0.7; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Success state */
.form-success {
  text-align: center;
  padding: 40px 20px;
}

.form-success-icon {
  width: 52px;
  height: 52px;
  background: var(--green-pale);
  color: var(--green);
  border: 2px solid #b8dfc0;
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
}

.form-success-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.form-success-msg {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.form-error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fff0f0;
  border: 1px solid #f5c6c6;
  border-radius: var(--radius);
  font-size: 13px;
  color: #b91c1c;
  font-family: 'Barlow', sans-serif;
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 700px) {
  .header-top { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .stats-ticker-inner { flex-wrap: wrap; }
  .stat-item { padding: 7px 12px 7px 0; margin-right: 12px; }
  .content { padding: 14px 14px 40px; }
  #map { height: 280px; }
  .controls-inner { padding: 10px 14px; }

  .form-row { grid-template-columns: 1fr; }
  .modal { max-height: 95vh; }
  .submit-camp-btn .submit-camp-btn-icon { display: none; }
}
