/* Page takes full height; no page scroll */
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  /* key: stop page scroll */
  overscroll-behavior: none;
}

:root {
  --top-h: 20px;
}

/* tweak to match your top bar’s actual height */

#map {
  height: 100%;
  width: 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;
}

.switch-container label {
  color: #007960;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.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);
}

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%;
  /* key: stop map column from scrolling */
}

.side-panel-toggle {
  display: none;
}

.side-panel-toggle:hover {
  background: #007960;
}

.side-panel-close {
  display: none;
}

.sp-icon-close {
  display: none !important;
}

.side-panel {
  width: 0;
  /* collapsed initially */
  overflow-y: auto;
  transition: width 0.3s ease;
  flex-shrink: 0;
  padding: 1em;
  color: #000000;
  background: #ffffff;
  /* background: #359f85; */
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.35);
  position: relative;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Headings in the side panel */
.side-panel h3 {
  color: #023047;
  /* Dark bluish-gray */
  font-size: 1.4em;
  margin-top: 0.5em;
  margin-bottom: 0.25em;
}

.side-panel h4 {
  color: #007960;
  /* Slightly vibrant green */
  font-size: 1.2em;
  margin-top: 1em;
  margin-bottom: 0.25em;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
}

.side-panel-open .side-panel {
  width: 400px;
  /* expanded */
}

.side-panel-open .sp-icon-open {
  display: none !important;
}

.side-panel-open .sp-icon-close {
  display: initial !important;
}

.default-message {
  font-style: italic;
  display: flex;
  justify-content: center;
  align-items: center;
  color: rgb(190, 190, 190);
  height: 100%;
  width: 100%;
  text-align: center;
  padding: 1rem;
}

.stock-record {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-left: 5px solid #0077b6;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  font-family: sans-serif;
}

.stock-record h3 {
  margin-top: 0;
  color: #023047;
}

.stock-record p {
  margin: 4px 0;
  color: #023047;
}

.stock-record h4 {
  margin: 4px 0;
  color: #023047;
}

.metrics strong {
  color: #023047;
}

.metric-line {
  margin-left: 10px;
  padding: 4px 0;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 8px;
  font-size: 0.9em;
  border-radius: 8px;
  color: white;
  font-weight: bold;
}

.reg-record {
  border-top: 1px solid #ccc;
  padding: 0.5em 0;
}

.top-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  /* move content to the right */
  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-button .material-icons {
  font-size: 28px;
  color: #333;
}

.home-icon {
  height: 38px;
  /* or any size you want */
  object-fit: contain;
}

/* Floating Feedback Button (top-right) */
.feedback-btn {
  position: absolute;
  bottom: 22px;
  right: 15px;
  z-index: 1600;                 /* above map & controls */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  height: 38px;
  border-radius: 9999px;         /* fully rounded edges */
  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: 10px;
  /* adjust this number as needed */
}

.FUNCTIONALLY\ EXTIRPATED {
  background-color: blueviolet;
}

.MODERATE {
  background-color: #ffb703;
}

.VERY\ LOW {
  background-color: #8ecae6;
}

.VERY\ HIGH {
  background-color: #d00000;
}

.HIGH {
  background-color: #f77f00;
}

.LOW {
  background-color: #219ebc;
}

.UNKNOWN {
  background-color: #adb5bd;
}

/* ===== Mobile styles ===== */
@media (max-width: 768px) {
  .side-panel {
    position: absolute;
    top: 0;
    left: 0;
    /* from the LEFT now */
    height: 100%;
    width: 85vw;
    /* keep a fixed drawer width */
    max-width: 85vw;
    transform: translateX(-100%);
    /* FULLY off-screen when closed */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.35);
    /* shadow on right edge */
    z-index: 1200;
    padding-top: 2.25rem;
    /* room for close button */
    pointer-events: none;
    /* no click-through when hidden */
  }

  /* Open state: slide into view */
  .side-panel-open .side-panel {
    transform: translateX(0);
    pointer-events: auto;
  }

  .side-panel-open .side-panel-toggle {
    transform: translateX(85vw);
    /* match your panel's width */
  }

  /* Floating toggle (unchanged, bottom-right) */
  .side-panel-toggle {
    display: grid;
    place-items: center;
    position: absolute;
    left: 14px;
    bottom: 40px;
    z-index: 1300;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 999px;
    background: #009578;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
  }

  .side-panel-toggle {
    --sp-shift: 0;
    transition: transform 0.3s ease;
  }

  .side-panel-open .side-panel-toggle {
    --sp-shift: 85vw;
  }

  .side-panel-toggle {
    transform: translateX(var(--sp-shift));
  }

  .side-panel-toggle:active {
    transform: translateX(var(--sp-shift)) scale(0.98);
  }

  /* Close “×” inside the panel */
  .side-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
  }

  .leaflet-control-container {
    z-index: 800;
    /* below the panel */
  }

  .leaflet-control-zoom {
    display: none !important;
  }

  .feedback-btn {
    bottom: 45px;
    right: 10px;
  }
  .wrapper.side-panel-open ~ .feedback-btn {
  display: none;
}
}