/* Page takes full height; no page scroll */
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

:root {
  --top-h: 20px;
}

#map {
  height: 100%;
  width: 100%;
}

body {
  margin: 0;
  font-family: sans-serif;
  line-height: 1.5;
}

.wrapper {
  display: flex;
  position: relative;
  height: calc(100svh - var(--top-h));
  height: calc(100dvh - var(--top-h));
}

.main {
  flex: 1;
  position: relative;
  overflow: hidden;
  height: 100%;
}

/* Position the toggle switch in the top-right corner */
.switch-container {
  position: absolute;
  z-index: 1000;
  background: white;
  padding: 10px;
  top: 50px;
  right: 10px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.switch-container label {
  color: #007960;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  gap: 10px;
}

.switch-container input[type="checkbox"] {
  width: 34px;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background-color: #ccc;
  border-radius: 50px;
  position: relative;
  cursor: pointer;
  transition: 0.4s;
}

.switch-container input[type="checkbox"]:checked {
  background-color: #007960;
}

.switch-container input[type="checkbox"]:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
}

.switch-container input[type="checkbox"]:checked:before {
  transform: translateX(14px);
}

.top-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background-color: #359f85;
  padding: 10px 20px;
  border-bottom: 1px solid #ccc;
  height: var(--top-h);
  z-index: 2000;
  position: sticky;
  top: 0;
}

.home-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  margin-left: 10px;
  display: flex;
  align-items: center;
}

.home-icon {
  height: 38px;
  object-fit: contain;
}

/* Floating Feedback Button (bottom-right) */
.feedback-btn {
  position: absolute;
  bottom: 22px;
  right: 15px;
  z-index: 1600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  height: 38px;
  border-radius: 9999px;
  background: #009578;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.feedback-btn:hover {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.feedback-btn:active {
  transform: translateY(0);
}

/* Push zoom control lower */
.leaflet-top.leaflet-left .leaflet-control-zoom {
  margin-top: 80px;
}

/* ===== Floating search (top-left) ===== */
.search-container {
  position: absolute;
  z-index: 1600;
  top: 50px;
  left: 10px;            /* <- was 480px (for side panel); now anchored left */
  width: min(360px, 70vw);
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

#wbSearch {
  width: 100%;
  border: none;
  outline: none;
  padding: 10px 12px;
  font-size: 16px;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  border-top: 1px solid #eee;
  display: none; /* shown when there are results */
}

.search-results li {
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.25;
}

.search-results li:hover,
.search-results li[aria-selected="true"] {
  background: #f5f7f7;
}

/* Popup content */
.wb-popup {
  font-family: sans-serif;
  line-height: 1.35;
}

.wb-popup h3 {
  margin: 0 0 8px 0;
  color: #023047;
  font-size: 16px;
}

.wb-popup .meta {
  color: rgba(2, 48, 71, 0.72);
  font-size: 13px;
  margin: 0 0 10px 0;
}

.wb-popup .btn-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.wb-popup a.wb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #009578;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.wb-popup a.wb-btn.secondary {
  background: #fff;
  color: #023047;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: none;
}

/* ===== Mobile styles ===== */
@media (max-width: 768px) {
  .search-container {
    top: 50px;
    left: 10px;
    width: calc(100vw - 20px);
  }

  .switch-container {
    top: 100px;
  }
}

/* iOS-only safety net: make all text inputs >=16px */
@supports (-webkit-touch-callout: none) {

  input[type="text"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px;
  }
}

html {
  -webkit-text-size-adjust: 100%;
}
