/* Apply Poppins font globally */

:root {
  font-family: "Poppins", system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #f0f0f0;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 320px;
  min-height: 100vh;
}

#app {
  display: grid;
  grid-template-rows: auto 1fr auto; /* Auto for header/footer, 1fr for map */
  height: 100vh; /* Full viewport height */
  width: 100vw; /* Set width to 90% of the viewport width */
}

#map {
  grid-row: 2; /* Place the map in the second row */
  width: 100%; /* Make sure the map takes up the full width of the #app container */
  border-radius: 8px;
}

.button-container {
  display: flex;
  justify-content: center;
  width: 100%; /* Ensure the button container takes full width */
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}

.card {
  padding: 2em;
}

.read-the-docs {
  color: #888;
}

/* canvas {
  background-color: #69f455a3;
} */

.leaflet-container {
  background-color: #f0f0f0 !important;
}

/* Toggle button specific styles */
#toggleMarkers {
  padding: 8px;
  font-size: 1.2em;
  color: white;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background-color: #fff;
  box-shadow: 0px 10px 20px #00000040;
  border-radius: 20px;
  margin: 0 25px 25px 0px !important;
}

#toggleMarkers:hover {
  cursor: pointer;
}

.toggler-marker-active > .inactive-svg {
  display: none;
}

.toggler-marker-active > .active-svg {
  display: block;
}

.toggler-marker-inactive > .active-svg {
  display: none;
}

.toggler-marker-inactive > .inactive-svg {
  display: block;
}

/* Fade transition for the marker pane */
.leaflet-pane.fade-out {
  opacity: 0;
  transition: opacity 250ms ease-in-out;
}

.leaflet-pane.fade-in {
  opacity: 1;
  transition: opacity 250ms ease-in-out;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }

  a:hover {
    color: #747bff;
  }

  button {
    background-color: #f9f9f9;
  }
}

/* Ensure these styles override Leaflet's default styles */
.leaflet-popup {
  background-color: #f8f8f8 !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
}

.leaflet-popup-content-wrapper {
  padding: 15px !important;
  border-radius: 12px !important;
  background-color: #f8f8f8 !important;
  font-family: "Poppins", sans-serif !important;
  color: #333 !important;
}

.leaflet-popup-content {
  font-size: 16px !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

.leaflet-popup-close-button {
  background-color: white !important;
  color: var(--highlight-color) !important;
  font-family: "Poppins", sans-serif !important;
  font-weight: 600 !important;
  border-radius: 50% !important;
  border: 1px solid #eee !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  font-size: 16px !important;
  height: 30px !important;
  width: 30px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  top: -15px !important;
  right: -15px !important;
  position: absolute !important;
  cursor: pointer !important;
}

.leaflet-fade-anim .leaflet-popup {
  transition: opacity 250ms ease-in-out !important;
}

.leaflet-fps-counter {
  color: #000;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 5px;
  font-size: 14px;
  border-radius: 4px;
}

/* 
  Note: correct the position classes here if the group button position from map.js is changed
  currently it is set to bottom right
*/
.leaflet-bottom {
  display: flex;
}

.leaflet-control {
  margin: 0 !important;
  width: min-content !important;
}

.leaflet-bottom .leaflet-control-zoom {
  display: flex;
  flex-direction: row-reverse;
  border: none !important;
  height: 40px !important;
  width: 74px !important;
  margin: 0 12px 25px 0px !important;
}

.leaflet-control-zoom > a {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.leaflet-control-zoom > a > span {
  display: block !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 100% !important;
}

.leaflet-bar a:hover,
.leaflet-bar a:focus {
  background-color: #fff !important;
}

.leaflet-bar a.leaflet-disabled {
  background-color: #fff !important;
  color: #c6c6c6 !important;
}

.leaflet-bar a.leaflet-disabled > span {
  background-color: #f2f2f2 !important;
}

.leaflet-control-zoom > a > span:hover {
  background-color: #f2f2f2 !important;
}

.leaflet-control-zoom-out {
  border-top-left-radius: 50% !important;
  border-bottom-left-radius: 50% !important;
  border-top-right-radius: 0px !important;
  border-bottom-right-radius: 0px !important;
  border: none !important;
}

.leaflet-control-zoom-in {
  border-top-left-radius: 0px !important;
  border-bottom-left-radius: 0px !important;
  border-top-right-radius: 50% !important;
  border-bottom-right-radius: 50% !important;
  border: none !important;
}

.leaflet-bar a.leaflet-disabled {
  background-color: #fff !important;
}

.leaflet-bar a span::hover {
  width: 20px !important;
  height: 20px !important;
  border-radius: 100% !important;
  background-color: #ccc !important;
}

.toggle-switch {
  position: relative;
  width: 39px;
  height: 24px;
}

.toggle-switch input {
  display: none;
}

.toggle-track {
  display: block;
  background-color: #edebeb;
  border-radius: 12px;
  width: 100%;
  height: 100%;
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s ease;
}

.toggle-track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background-color: #ffffff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left 0.3s ease;
}

input:checked + .toggle-track {
  background-color: var(--highlight-color);
}

input:checked + .toggle-track::before {
  left: 18px;
}

.leaflet-interactive {
  cursor: grab !important;
}
