.map {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  width: min(1200px, 100vw); /*width of map box*/
  height: 650px;
  border: 1px solid #e5e5e5; /*adds mild border*/
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  text-align: center;
  margin-bottom: 200px;
  margin-top: 50px;
}

#indexmap {
  position: relative;
  height: 720px;
}

.map-loading-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.86);
  z-index: 550;
  font-size: 3rem;
  color: #f5a623;
}

.building-label {
  color: rgb(0, 96, 255);
  text-align: center;
  line-height: 1;
  text-shadow:
    1px 1px 2px white,
    -1px 1px 2px white,
    1px -1px 2px white,
    -1px -1px 2px white,
    0px 0px 3px white;
}

.leaflet-tooltip.building-label {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Map popup custom styles */
.popup-title {
  display: block;
  background-color: var(--green-accent);
  color: white;
  text-align: center;
  padding: 8px;
  font-weight: bold;
  font-size: 1.1em;
}

/*needs the important declaration otherwise leaflet overwrites. These are for the green building name background.*/
.leaflet-popup-content-wrapper {
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 8px !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: auto !important;
}

.popup-body {
  padding: 10px 14px;
}

.leaflet-popup-close-button {
  color: white !important;
}

.popup-label {
  color: var(--button-color);
  font-weight: 600;
}

.popup-kwh {
  color: var(--primary-text);
  font-weight: bold;
}

.leaflet-popup-content canvas {
  display: block;
  margin: 6px 10px 10px 10px;
  border: 3px solid #5f5f5f;
  border-radius: 4px;
}

@media (max-width: 768px) {
  #returnToTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    aspect-ratio: 1;
    z-index: 9999999;
    border: none;
    outline: none;
    background-color: #356901;
    color: white;
    cursor: pointer;
    padding: 15px;
    border: 2px solid lightgrey;
    border-radius: 50%;
    font-size: 18px;
    align-items: center;
    justify-content: center;
  }
  #returnToTopBtn:hover {
    background-color: #499200;
  }

  #returnToTopArrow {
    display: none;
    border: solid white;
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 5px;
    z-index: 9999999;
    transform: rotate(-135deg);
    -webkit-transform: rotate(-135deg);
  }
}
