:root {
  --hemlock_green: #61b045;
  --hemlock_green2: #22c55e;
}

body {
  margin: 0;
  padding: 0;
  font-family: "TASA Orbiter", sans-serif;
  background-color: #121212;
  color: #e0e0e0;
  overflow: hidden;
}

/* --- MAP VIEW ONLY MODE (Hides Overlays) --- */
body.map-view-active #map-title,
body.map-view-active #history-panel,
body.map-view-active #units-panel,
body.map-view-active #replay-trigger-btn,
body.map-view-active #speed-legend,
body.map-view-active #recency-legend {
  display: none !important;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

/* --- MAP TITLE CONTAINER (DESKTOP) --- */
#map-title {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

/* Desktop Wings */
.header-line {
  flex-grow: 1;
  height: 4px;
  background: var(--hemlock_green);
  position: relative;
  z-index: 1;
}

/* Desktop Wrapper */
#title-wrapper {
  background: var(--hemlock_green);
  padding: 0 4px 4px 4px;
  margin-left: -15px;
  margin-right: -15px;
  position: relative;
  z-index: 10;
  clip-path: polygon(0 0, 100% 0, calc(100% - 30px) 100%, 30px 100%);
  pointer-events: auto;
}

/* Desktop Content */
#title-content {
  background: rgba(30, 30, 30, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  /* Desktop uses clip-path, not border-radius */
  clip-path: polygon(0 0, 100% 0, calc(100% - 30px) 100%, 30px 100%);
}

#map-title-text {
  color: white;
  padding: 12px 50px 8px 50px;
  font-family: "TASA Orbiter", sans-serif;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
  white-space: nowrap;
}

/* --- DEFAULT HIDDEN (DESKTOP) --- */
#mobile-menu-chevron {
  display: none;
}
#mobile-menu-dropdown {
  display: none;
}

/* --- SEARCH INPUT STYLES (SHARED) --- */
.search-input {
  background: #222;
  border: 1px solid #555;
  color: white;
  padding: 8px 10px;
  border-radius: 4px;
  font-family: "Noto Sans Mono", monospace;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  height: 30px; /* Enforce height */
}
.search-input:focus {
  border-color: var(--hemlock_green);
}

/* --- MOBILE VIEW --- */
@media (max-width: 768px) {
  #map-title {
    /* Increase width from auto to a fixed percentage or larger auto */
    width: 85%;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    z-index: 20;
    margin-top: 10px;
  }

  .header-line {
    display: none;
  }

  #title-wrapper {
    background: transparent;
    padding: 0;
    margin: 0;
    clip-path: none;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #title-content {
    position: relative;
    background: rgba(30, 30, 30, 0.98);
    clip-path: none;
    border: 4px solid var(--hemlock_green);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    z-index: 20;
  }

  #map-title-text {
    padding: 15px 35px;
    font-size: 14px;
    white-space: normal;
    border-bottom: none;
  }

  /* --- MENU DROPDOWN --- */
  #mobile-menu-dropdown {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    transition:
      max-height 0.3s ease-in-out,
      opacity 0.3s ease-in-out;
    opacity: 0;
    background: transparent;
    border: none;
  }

  #mobile-menu-dropdown.open {
    max-height: 350px; /* Increased slightly to fit Replay */
    opacity: 1;
    border-top: 4px solid var(--hemlock_green);
  }

  .mobile-menu-item {
    padding: 15px 0;
    width: 100%;
    border-bottom: 2px solid var(--hemlock_green);
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    color: #eee;
    background: transparent;
  }

  .mobile-menu-item:last-child {
    border-bottom: none;
  }

  .mobile-menu-item:hover {
    background: rgba(97, 176, 69, 0.2);
  }

  /* --- CHEVRON --- */
  #mobile-menu-chevron {
    display: block;
    position: relative;
    margin-top: -4px;
    background: #1e1e1e;
    color: var(--hemlock_green);
    border: 4px solid var(--hemlock_green);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 2px 25px;
    font-size: 12px;
    cursor: pointer;
    z-index: 21;
  }

  #mobile-menu-chevron:hover {
    background: #2a2a2a;
  }

  /* --- FORCE HIDE DESKTOP ELEMENTS --- */
  #history-panel,
  #units-panel,
  #replay-trigger-btn {
    display: none !important;
  }

  /* --- REPLAY CONTROLS MOBILE LAYOUT --- */
  #replay-controls {
    bottom: 15px;
    width: 95%;
    padding: 10px;
  }

  .replay-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
  }

  .replay-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  /* ROW 1: Play and Speed */
  #play-pause-btn {
    flex: 1 1 40%;
    order: 1;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 90px;
  }

  .material-symbols-rounded {
    font-variation-settings:
      "FILL" 1,
      "wght" 400,
      "GRAD" 0,
      "opsz" 24;
    font-size: 20px;
  }

  .btn-text {
    display: flex;
    align-items: center;
    line-height: 1;
    font-weight: 600;
  }

  #speed-select {
    flex: 1 1 30%; /* Slightly less width to accommodate margin */
    order: 1;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;

    /* MARGIN FIX: Pushes button away from the absolute X button */
    margin-right: 40px;
  }

  /* ROW 2: The 5 control buttons (added draw btn) */
  #rewind-btn,
  #forward-btn,
  #zoom-out-btn,
  #zoom-in-btn,
  #draw-route-btn {
    flex: 1 1 16%;
    order: 2;
    height: 36px;
    padding: 0;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Time Display */
  #time-display {
    width: 100%;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    margin-top: 5px;
  }

  /* "X" Close Button */
  #close-replay-btn {
    position: absolute;
    top: 5px;
    right: 0px;
    background: #222;
    border: 1px solid #ef4444;
    color: #ef4444 !important;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    font-size: 0;
    gap: 0;
  }

  #close-replay-btn::after {
    content: "✕";
    font-size: 12px;
    display: block;
  }

  /* --- Update the Popup Panels (Units & History) --- */
  .panel.mobile-active,
  #history-panel.mobile-active,
  #units-panel.mobile-active {
    display: flex !important;
    position: fixed !important; /* Force it to break out of the wrapper */
    top: 20% !important;
    left: 50% !important;
    right: auto !important; /* Override the inline right: 0 */
    transform: translate(-50%) !important; /* Perfect true centering */

    width: 85% !important;
    max-width: 450px !important;

    max-height: 70vh;
    z-index: 9999 !important;
    flex-direction: column;
    border: 3px solid var(--hemlock_green);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.8);
  }

  .mobile-close-btn {
    display: block;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
  }

  #replay-controls {
    bottom: 10px;
    width: 95%;
    padding: 10px;
  }
}

/* --- PANELS (DESKTOP) --- */
.panel {
  background: rgba(30, 30, 30, 0.95);
  color: #ffffff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 2;
  position: absolute;
  max-height: 40vh;
  overflow-y: auto;
  border: 1px solid #444; /*use var(--hemlock_green) instead? */
  transition: background 0.2s;
  text-align: center;
}

#replay-trigger-btn:hover {
  background: #444 !important;
}

#history-panel {
  top: 20px;
  right: 20px;
  width: 220px;
}

#units-panel {
  top: 20px;
  left: 20px;
  width: 220px;
  display: flex;
  flex-direction: column;
  max-height: 60vh;
}

#settings-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #333;
  color: white;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: transform 0.2s;
  border: 1px solid #555;
}
#settings-btn:hover {
  transform: scale(1.1);
}

/* --- 3D TOGGLE BTN (ABOVE GEOLOCATE) --- */
#terrain-toggle-btn {
  position: absolute;
  bottom: 220px; /* Above scale/attribution */
  right: 25px; /* Aligned with mapbox controls */
  width: 29px;
  height: 29px;
  background: #333;
  border: 1px solid #555;
  border-radius: 4px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

#terrain-toggle-btn:hover {
  background: #444;
}

#terrain-toggle-btn.active {
  background: rgba(34, 197, 94, 0.2);
  color: var(--hemlock_green2);
  border-color: var(--hemlock_green2);
}

#terrain-toggle-btn .material-symbols-rounded {
  font-size: 20px;
  color: #ccc;
}

#terrain-toggle-btn.active .material-symbols-rounded {
  color: var(--hemlock_green2);
}

/* --- SEARCH WIDGET (FLOATING ICON) --- */
#search-widget-wrapper {
  position: absolute;
  bottom: 270px;
  right: 25px;
  z-index: 15;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

#search-icon-btn {
  width: 29px;
  height: 29px;
  background: #333;
  border: 1px solid #555;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
  color: #ccc;
  transition: background 0.2s;
  flex-shrink: 0;
}

#search-icon-btn:hover {
  background: #444;
}

/* CONTAINER FOR INPUT */
#search-container {
  position: relative;
  overflow: visible;
  width: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
}

#search-widget-wrapper.expanded #search-container {
  width: 240px;
}

#search-widget-wrapper input {
  width: 100%;
  opacity: 0;
  transition: opacity 0.2s ease 0.1s;
}

#search-widget-wrapper.expanded input {
  opacity: 1;
}

/* --- AUTOCOMPLETE SUGGESTIONS (FIXED) --- */
/* Constrain width and prevent "black box" artifacts by using fixed positioning logic */
#search-suggestions {
  display: none;
  position: absolute;
  top: 35px; /* Directly below input */
  right: 0; /* Anchor to right side of wrapper */
  width: 240px; /* MATCH EXPANDED WIDTH EXACTLY */
  background: #222;
  border: 1px solid #555;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
  z-index: 2000; /* Super high z-index to avoid overlap */
  box-sizing: border-box;
  margin-right: 40px;
}

.suggestion-item {
  padding: 10px;
  border-bottom: 1px solid #333;
  cursor: pointer;
  font-size: 12px;
  color: #eee;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
  text-align: left;
  white-space: nowrap; /* Prevent text wrap */
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: #333;
  color: #fff;
}

.suggestion-icon {
  color: #aaa;
  font-size: 16px;
  flex-shrink: 0;
}

/* --- REPLAY CONTROLS --- */
#replay-controls {
  display: none;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid #444;
  border-radius: 12px;
  padding: 15px;
  z-index: 10;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.8);
  flex-direction: column;
  gap: 10px;
}

.replay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.replay-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: #333;
  border: 1px solid #555;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Noto Sans Mono", monospace;
  font-size: 12px;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
}

.icon-btn:hover {
  background: #444;
}

/* DRAW MODE ACTIVE STATE */
#draw-route-btn.state-active {
  border: 1px solid var(--hemlock_green2);
  color: var(--hemlock_green2);
  background: rgba(34, 197, 94, 0.1);
}

#play-pause-btn.state-play {
  border: 1px solid #a3e635;
  color: #a3e635;
}
#play-pause-btn.state-play:hover {
  background: rgba(163, 230, 53, 0.1);
}

#play-pause-btn.state-pause {
  border: 1px solid #eab308;
  color: #eab308;
}
#play-pause-btn.state-pause:hover {
  background: rgba(234, 179, 8, 0.1);
}

/* --- TIMELINE WRAPPER --- */
#timeline-wrapper {
  position: relative;
  width: 100%;
  height: 50px;
  background: #222;
  border-radius: 6px;
  border: 1px solid #444;
  overflow: hidden;
}

#timeline-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  z-index: 1;
  pointer-events: none;
}

#timeline-scroll-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  z-index: 2;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}

#timeline-scroll-area::-webkit-scrollbar {
  height: 6px;
}
#timeline-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}
#timeline-scroll-area::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 3px;
}

#timeline-content {
  position: relative;
  width: 100%;
  height: 100%;
}

#markers-container {
  position: absolute;
  top: 30px;
  left: 0;
  width: 100%;
  height: 20px;
  z-index: 3;
  pointer-events: none;
}

.snap-dot {
  position: absolute;
  top: -4px; /* Adjusts vertical position in the markers row */
  transform: translateX(-50%);

  /* Icon Styling */
  color: #a3e635; /* Your theme's neon green */
  font-size: 20px; /* Size of the play arrow */
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8); /* Shadow for contrast */

  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 0.1s,
    color 0.1s;

  /* Reset old circle styles */
  background: transparent;
  width: auto;
  height: auto;
  border-radius: 0;
  box-shadow: none;
}

.snap-dot:hover {
  transform: translateX(-50%) scale(1.3); /* Grow slightly */
  color: #ffffff; /* Turn white on hover */
  background: transparent;
}

#timeline-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  margin: 0;
  z-index: 2;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

#timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 30px;
  width: 4px;
  background: #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  cursor: ew-resize;
}

#timeline-slider::-moz-range-thumb {
  height: 30px;
  width: 4px;
  background: #fff;
  border: none;
  cursor: ew-resize;
}

#time-display {
  font-family: "Noto Sans Mono", monospace;
  font-size: 14px;
  color: #fff;
  min-width: 80px;
  text-align: right;
}

/* --- MAP CONTROLS --- */
.mapboxgl-ctrl-bottom-right {
  bottom: 0 !important;
  right: 25px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.mapboxgl-ctrl-bottom-right > * {
  pointer-events: auto;
}
.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-group {
  margin: 10px 0 0 0 !important;
}
.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-group:last-of-type {
  margin-bottom: 80px !important;
}

/* Make space for our new button */
.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-group:nth-last-child(2) {
  margin-bottom: 5px !important;
}

.mapboxgl-ctrl-bottom-left {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  margin-bottom: 10px;
}
.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl {
  margin: 0 0 0 20px !important;
}
.mapboxgl-ctrl-logo {
  margin: 0 !important;
}
.mapboxgl-ctrl-attrib {
  margin-bottom: 0 !important;
  background-color: rgba(30, 30, 30, 0.85) !important;
  color: #888 !important;
  align-self: center;
}
.mapboxgl-ctrl-attrib a {
  color: #ccc !important;
}

.mapboxgl-ctrl-group {
  background-color: #333 !important;
  border: 1px solid #555 !important;
}
.mapboxgl-ctrl-icon {
  filter: invert(1) brightness(2);
}
.mapboxgl-ctrl button:hover {
  background-color: #444 !important;
}

/* SETTINGS MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 20;
  align-items: center;
  justify-content: center;
}
.modal {
  background: #222;
  color: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 300px;
  position: relative;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid #444;
}
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 18px;
  cursor: pointer;
  color: #aaa;
}

.setting-group {
  margin-bottom: 15px;
}
.setting-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 14px;
}
.setting-group select {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #333;
  color: white;
}

.setting-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 14px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--hemlock_green);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* LEGEND */
.map-legend {
  display: none;
  position: absolute;
  bottom: 45px;
  left: 20px;
  background: rgba(30, 30, 30, 0.95);
  color: white;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  z-index: 2;
  border: 1px solid #444;
}
.gradient-bar {
  width: 150px;
  height: 10px;
  background: linear-gradient(
    to right,
    #ef4444,
    #eab308,
    var(--hemlock_green2)
  );
  margin-top: 5px;
  border-radius: 5px;
}
.legend-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 10px;
  color: #aaa;
}

/* RECENCY LEGEND SPECIFIC */
.recency-grid {
  display: flex;
  flex-direction: row;
  gap: 2px;
  margin-top: 5px;
  width: 200px;
  height: 15px;
}
.recency-block {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #121212;
}
.recency-lime {
  background-color: #a3e635;
  border-radius: 4px 0 0 4px;
}
.recency-yellow {
  background-color: #eab308;
}
.recency-orange {
  background-color: #f97316;
}
.recency-maroon {
  background-color: #8d3748;
  border-radius: 0 4px 4px 0;
}

h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #fff;
  text-align: center;
}
.unit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.unit-item {
  display: flex;
  align-items: center;
  font-size: 13px;
  background: #333;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #444;
  color: #eee;
}
.unit-item:hover {
  background: #444;
}
.unit-item input {
  margin-right: 10px;
  cursor: pointer;
}

/* --- LOCATOR BUTTON (NEW) --- */
.locator-btn {
  margin-left: auto; /* Push to the right */
  cursor: pointer;
  color: #888;
  font-size: 18px;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.locator-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #eee;
}
.locator-btn.active {
  color: var(--hemlock_green2); /* Green when locked */
}

.color-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- UPDATED LOADING INDICATOR --- */
#loading {
  display: none; /* Toggled via JS */
  position: fixed;
  top: 33%; /* 2/3s up from bottom (or 1/3 from top) */
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000; /* Above everything */

  background: rgba(20, 20, 20, 0.95);
  color: #fff;
  padding: 15px 30px;
  border-radius: 50px;
  border: 2px solid var(--hemlock_green);
  font-family: "TASA Orbiter", sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 0 20px rgba(97, 176, 69, 0.4);
  pointer-events: none;
  text-align: center;
}

.stats-text {
  font-family: "Noto Sans Mono", monospace;
  font-weight: 500;
  font-size: 12px;
}
.mapboxgl-popup-content {
  background: #1e1e1e !important;
  color: #fff !important;
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  border: 1px solid #444;
  font-family: "Noto Sans Mono", monospace;
}
.mapboxgl-popup-tip {
  border-top-color: #1e1e1e !important;
  border-bottom-color: #1e1e1e !important;
}

#start-date-select,
#end-date-select {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}

.apply-range-btn {
  width: 100%;
  padding: 8px;
  background: var(--hemlock_green);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: "TASA Orbiter", sans-serif;
  font-weight: 600;
  transition: background 0.2s ease;
}

.apply-range-btn:hover {
  background: #4d8f36; /* A slightly darker shade of your green */
}

.mobile-close-btn {
  display: none;
}

/* --- DEAD ZONE WARNING LEGEND --- */
#dead-zone-warning {
  bottom: 115px; /* Sits just above the other legend */
  border-left: 4px solid #ef4444;
}

#dead-zone-warning strong {
  color: #ef4444;
  display: flex;
  align-items: center;
  gap: 5px;
}

#dead-zone-warning .material-symbols-rounded {
  font-size: 16px;
}

#dead-zone-warning .warning-text {
  color: #ccc;
  margin-top: 4px;
  font-size: 10px;
}

/* --- HIDE FLOATING WIDGETS WHEN MODAL IS OPEN --- */
body:has(.panel.mobile-active) #search-widget-wrapper,
body:has(.panel.mobile-active) #terrain-toggle-btn {
  display: none !important;
}

/* Error Toast Notification */
#toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(150px);
  background-color: #ef4444; /* Mapbox Red */
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: "Noto Sans Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

#toast-notification.show {
  transform: translateX(-50%) translateY(0);
}
