:root {
  --bg-dark: #0f172a;
  --bg-light: #ffffff;
  --text-light: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-light);
}

/* Topbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-dark);
  color: var(--text-light);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
}

.brand img {
  height: 28px;
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

select {
  padding: 6px 10px;
  border-radius: 4px;
  border: none;
  font-size: 14px;
}

.nav-link {
  padding: 6px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Map */
#map {
  height: calc(100vh - 52px);
  width: 100%;
}

/* Legend */
.legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 180px;
}

.legend-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: #333;
}

.legend-gradient {
  margin-top: 8px;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.legend-gradient::before {
  content: "";
  display: block;
  height: 8px;
  background: linear-gradient(to right, #ff0000, #ff8000, #ffff00, #80ff00, #00ff00);
  border-radius: 4px;
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .brand span {
    display: none;
  }

  select {
    font-size: 13px;
  }
}
