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

/* ── Design tokens (from DESIGN.md) ────────────── */
:root {
    --primary: #004071;
    --secondary: #536070;
    --tertiary: #2E7D32;
    --neutral: #F8F9FA;
    --border: #D0D5DD;
    --text: #1A1A2E;
    --text-muted: #536070;
    --radius: 6px;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

/* ── Base ───────────────────────────────────────── */
body {
    font-family: 'Public Sans', sans-serif;
    background: var(--neutral);
    color: var(--text);
    min-height: 100vh;
}

/* ── Header bar ─────────────────────────────────── */
header {
    background: var(--primary);
    color: #fff;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

header .logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

header .badge {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    background: var(--tertiary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* ── Main content ───────────────────────────────── */
main {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 24px;
}

/* Page heading */
.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ── Search card ────────────────────────────────── */
.search-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 6px;
}

.search-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}

.search-row {
    display: flex;
    gap: 10px;
}

.search-row input {
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    color: var(--text);
    transition: border-color 0.15s;
}

.search-row input:focus {
    border-color: var(--primary);
}

.search-row button {
    display: none;
    /* kept in DOM for fallback, hidden visually */
}

/* ── Dropdown results ───────────────────────────── */
#results {
    display: none;
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    list-style: none;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

#results li {
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid #F0F2F5;
    color: var(--text);
}

#results li:last-child {
    border-bottom: none;
}

#results li:hover,
#results li.selected {
    background: #EEF3F8;
    color: var(--primary);
}

/* ── Map box ────────────────────────────────────── */
.map-wrapper {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    height: 500px;
    box-shadow: var(--shadow);
}

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

/* ── Progress bar ───────────────────────────────── */
/* Sits flush along the top edge of the map, full width, 3px tall */
#progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: #c0392b;
    opacity: 0;
    z-index: 10;
    pointer-events: none;
    border-radius: 0 2px 2px 0;
}

/* ── Fullscreen button ──────────────────────────── */
/* Sits in the top-right corner of the map wrapper */
#fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s, color 0.15s;
}

#fullscreen-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* When the map wrapper is in fullscreen, make it fill the screen and resize the map */
.map-wrapper:fullscreen {
    height: 100vh;
    width: 100vw;
    border-radius: 0;
    border: none;
}

/* Firefox uses a vendor-prefixed version */
.map-wrapper:-moz-full-screen {
    height: 100vh;
    width: 100vw;
    border-radius: 0;
    border: none;
}

/* Safari / older WebKit */
.map-wrapper:-webkit-full-screen {
    height: 100vh;
    width: 100vw;
    border-radius: 0;
    border: none;
}

/* ── Legend ────────────────────────────────────── */
.legend {
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow);
}

.legend-title {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.legend-items span {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text);
}