/* Full-viewport, edge-to-edge map app */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: sans-serif;
  background: #0d1b2a;
  color: #e0e0e0;
}

#map {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(100% - 48px);
}

/* Mode placeholder (non-MRMS modes) */
#mode-placeholder[hidden] {
  display: none;
}
#mode-placeholder {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0d1b2a;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 6px;
  font-size: 22px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  z-index: 5;
}

/* Top navigation bar */
#nav-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  width: 100%;
  background: #080d12;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  box-sizing: border-box;
}
#nav-logo {
  padding-left: 20px;
  display: flex;
  align-items: center;
  filter: brightness(0.88);
}
#nav-logo img {
  height: 32px;
  width: auto;
  display: block;
}
#nav-modes {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-mode {
  position: relative;
  height: 100%;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0 2px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-family: inherit;
}
.nav-mode.active {
  color: #7ec8e3;
}
.nav-mode.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #7ec8e3;
}
#nav-gear {
  padding-right: 20px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
#nav-gear.active {
  color: #7ec8e3;
}

/* Shared HUD overlay style */
.hud {
  position: absolute;
  background: rgba(13, 27, 42, 0.85);
  border: 1px solid rgba(126, 200, 227, 0.3);
  color: #e0e0e0;
  border-radius: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
}

/* In-nav search */
#nav-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 24px;
  margin-right: auto;
  position: relative;
}
#nav-search input {
  background: #11181f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 1px;
  width: 220px;
  outline: none;
  box-sizing: border-box;
  height: 28px;
}
#nav-search input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
}
#nav-search input:focus {
  border-color: rgba(126, 200, 227, 0.5);
}
#nav-search button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #7ec8e3;
  padding: 0 12px;
  height: 28px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 500;
}
#status {
  position: absolute;
  top: 100%;
  right: 0;
  margin: 4px 0 0 0;
  font-size: 11px;
  color: #a0c4d6;
  white-space: nowrap;
}

/* Map reset button */
#map-reset[hidden] {
  display: none;
}
#map-reset {
  top: 60px;
  right: 16px;
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(13, 27, 42, 0.85);
  color: #7ec8e3;
  border: 1px solid rgba(126, 200, 227, 0.4);
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
#map-reset:hover {
  background: rgba(126, 200, 227, 0.25);
}

/* Radar playback controls (default: lower-left, draggable) */
#radar-controls[hidden] {
  display: none;
}
#radar-controls {
  bottom: 16px;
  left: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(440px, calc(100vw - 32px));
  background: #080d12;
  border: 1px solid rgba(126, 200, 227, 0.5);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: grab;
  user-select: none;
}
#radar-controls.dragging {
  cursor: grabbing;
}
#radar-controls button {
  background: none;
  border: none;
  border-radius: 0;
  color: #7ec8e3;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
}
#radar-controls button:hover {
  background: none;
  color: #a8dcef;
}
#radar-scrubber {
  flex: 1;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
  height: 10px;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  cursor: pointer;
  --radar-progress: 0%;
}
#radar-scrubber::-webkit-slider-runnable-track {
  height: 1px;
  border: none;
  border-radius: 0;
  background: linear-gradient(
    to right,
    #7ec8e3 0%,
    #7ec8e3 var(--radar-progress),
    rgba(255, 255, 255, 0.15) var(--radar-progress),
    rgba(255, 255, 255, 0.15) 100%
  );
}
#radar-scrubber::-moz-range-track {
  height: 1px;
  border: none;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.15);
}
#radar-scrubber::-moz-range-progress {
  height: 1px;
  background: #7ec8e3;
  border: none;
}
#radar-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7ec8e3;
  border: none;
  box-shadow: none;
  margin-top: -4.5px;
  cursor: pointer;
}
#radar-scrubber::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7ec8e3;
  border: none;
  box-shadow: none;
  cursor: pointer;
}
#radar-scrubber:focus {
  outline: none;
}
#radar-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #7ec8e3;
  letter-spacing: 1px;
  min-width: 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* MRMS preset view buttons (right edge, below home) */
#presets[hidden] {
  display: none;
}
#presets {
  position: absolute;
  top: 106px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}
.preset-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(13, 27, 42, 0.55);
  color: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.preset-btn:hover {
  color: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.3);
}
.preset-btn.set {
  background: rgba(13, 27, 42, 0.85);
  color: #7ec8e3;
  border-color: rgba(126, 200, 227, 0.4);
}
.preset-btn.set:hover {
  background: rgba(126, 200, 227, 0.25);
  border-color: rgba(126, 200, 227, 0.4);
}

#presets-reset {
  margin-top: 4px;
  width: 38px;
  height: 24px;
  padding: 0;
  background: rgba(13, 27, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
#presets-reset:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
}

#presets-reset-menu[hidden] {
  display: none;
}
#presets-reset-menu {
  position: absolute;
  top: 200px;
  right: 46px;
  background: #080d12;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  min-width: 120px;
  z-index: 11;
  overflow: hidden;
}
#presets-reset-menu button {
  background: none;
  border: none;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.65);
  text-align: left;
  padding: 10px 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
#presets-reset-menu button:hover {
  color: #7ec8e3;
  background: rgba(126, 200, 227, 0.08);
}
.presets-reset-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0;
}

/* Mobile: shrink panels to fit */
@media (max-width: 600px) {
  #nav-search input {
    width: 140px;
  }
}
