/*
 * Nominatim search popdown — same dark-glass visual language
 * as style switcher / language switcher. Search input + status
 * line + scrollable result list.
 */

/* Center the inline SVG magnifier inside the toolbar button.
   MapLibre's default button has no flex centering, so an
   inline-SVG ends up baseline-aligned and the visual centroid
   of the magnifier (handle in the bottom-right) ends up off
   to the upper-left. Flexbox fixes both axes. */
.geocoder-ctrl button {
  display: flex;
  align-items: center;
  justify-content: center;
}
.geocoder-ctrl button svg {
  display: block;
}

.geocoder-menu {
  /* Anchor at the TOP of the viewport regardless of which row
     the trigger button occupies in the right-side stack — the
     Android software keyboard otherwise covers a popdown that
     sat next to the button. Side stays right (control lives on
     the right edge); 60px = 40px control width + 8px MapLibre
     margin + a bit of breathing room. */
  position: fixed;
  top: 12px;
  right: 60px;
  width: min(320px, 80vw);
  padding: 8px;
  background: rgba(28, 28, 30, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  color: #e5e5e5;
  font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  display: none;
  z-index: 800;
}

.geocoder-menu.open {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.geocoder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 2px 4px;
}
.geocoder-title {
  font-weight: 600;
  font-size: 12px;
  color: #fff;
}
.geocoder-close {
  background: transparent;
  border: 0;
  color: #e5e5e5;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.geocoder-close:hover { color: #fff; }

.geocoder-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}
.geocoder-input:focus {
  border-color: #3388ff;
}
.geocoder-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.geocoder-status {
  display: none;
  padding: 4px 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}
.geocoder-status.error  { color: #ef4444; }
.geocoder-status.muted  { color: rgba(255, 255, 255, 0.5); }

.geocoder-results {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: min(360px, 60vh);
  overflow-y: auto;
}

.geocoder-results .geocoder-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  background: transparent;
  color: #e5e5e5;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font: 12px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  white-space: normal;
  transition: background-color 120ms ease;
}
.geocoder-results .geocoder-result:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
