/* Minimal, readable UI */
:root {
  --bg: #0b0f14;
  --panel: #101824;
  --panel2: #0f1620;
  --text: #e8eef7;
  --muted: #a9b4c5;
  --accent: #5db3ff;
  --danger: #ff5d5d;
  --stroke: #203046;
  --card: #0f1722;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  background: radial-gradient(1200px 700px at 20% 10%, #0f1b2b 0%, var(--bg) 55%);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(11,15,20,0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 2;
}

header h1 { margin: 0; font-size: 18px; }
header p { margin: 6px 0 0 0; color: var(--muted); font-size: 13px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(520px, 44vw);
}
.search input {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  background: #0a111a;
  color: var(--text);
  outline: none;
}
.search input:focus { border-color: rgba(93,179,255,.55); }
.search button {
  width: 36px; height: 36px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #0a111a;
  color: var(--muted);
  cursor: pointer;
}
.search button:hover { color: var(--text); border-color: rgba(93,179,255,.35); }

main {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  padding: 18px;
}

.mapPane, .infoPane { min-height: calc(100vh - 92px); }

#map {
  height: calc(100vh - 140px);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(16,24,36,.75), rgba(10,15,22,.55));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px 0 6px;
  color: var(--muted);
  font-size: 13px;
}
.pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(16,24,36,.55);
  color: var(--text);
  font-size: 12px;
}

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

.card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(15,23,34,.75);
  box-shadow: var(--shadow);
  padding: 14px 14px 12px 14px;
}

.card.small { padding: 12px 14px; }

.card h2 {
  margin: 0 0 10px 0;
  font-size: 14px;
}

.kv {
  display: grid;
  grid-template-columns: 86px 1fr;
  row-gap: 8px;
  column-gap: 10px;
  font-size: 13px;
}
.kv .k { color: var(--muted); }
.kv .v { color: var(--text); }
.mono { font-family: var(--mono); letter-spacing: .2px; }


.controls{
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.control label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px 2px;
}
.control select{
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  background: #0a111a;
  color: var(--text);
  outline: none;
}
.control select:focus{ border-color: rgba(93,179,255,.55); }
button.secondary{
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(10,17,26,.6);
  color: var(--text);
  cursor: pointer;
}
button.secondary:hover{ border-color: rgba(93,179,255,.35); }
button.secondary:disabled{ opacity:.45; cursor:not-allowed; }

.results .empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0 4px 0;
}

.resultItem {
  border-top: 1px solid rgba(32,48,70,.7);
  padding: 10px 0;
}
.resultItem:first-child { border-top: 0; }
.resultTitle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.resultTitle .name { font-weight: 600; font-size: 13px; }
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(32,48,70,.85);
  color: var(--muted);
}
.links { margin-top: 6px; display: grid; gap: 6px; }
.links a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-word;
  font-size: 13px;
}
.links a:hover { text-decoration: underline; }

.muted { color: var(--muted); font-size: 12px; }

/* Map styles */
svg { width: 100%; height: 100%; display: block; }
.state {
  fill: rgba(93,179,255,.12);
  stroke: rgba(93,179,255,.35);
  stroke-width: 1;
  cursor: pointer;
}
.state:hover { fill: rgba(93,179,255,.20); }

.county {
  fill: rgba(232,238,247,.06);
  stroke: rgba(232,238,247,.12);
  stroke-width: .35;
  cursor: pointer;
}
.county:hover { fill: rgba(93,179,255,.18); stroke: rgba(93,179,255,.38); }

.selected {
  fill: rgba(93,179,255,.28) !important;
  stroke: rgba(93,179,255,.75) !important;
  stroke-width: 1.2 !important;
}

.hidden { display: none; }

@media (max-width: 1100px) {
  main { grid-template-columns: 1fr; }
  .mapPane, .infoPane { min-height: auto; }
  #map { height: 62vh; }
  .search { min-width: unset; width: 100%; }
  header { flex-direction: column; align-items: stretch; }
}


/* Hover tooltip */
.tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  background: rgba(10, 18, 28, 0.95);
  border: 1px solid rgba(93,179,255,0.6);
  color: #e8eef7;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.tooltip.hidden { display: none; }

/* Search row (input + button) */
.searchRow{
  display:flex;
  gap:10px;
  align-items:center;
  flex: 1 1 auto;
  flex-wrap: nowrap;
}
.searchRow #searchBox{ flex: 1 1 auto; }

#searchBtn{
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(93,179,255,0.35);
  background: rgba(20,30,44,0.75);
  color: #e8eef7;
  cursor: pointer;
  width: auto;
  height: auto;
  min-width: 88px;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#searchBtn:hover{
  border-color: rgba(93,179,255,0.75);
}
#searchBtn:active{
  transform: translateY(1px);
}
