@use "../../vars";

.codap-component.codap-map.minimized {
  .map {
    visibility: hidden;
  }
}

.map-container {
  position: relative;
  width: 100%;
  height: calc(100% - vars.$title-bar-height);
  z-index: 5;

  .leaflet-wrapper {
    // set up stacking context to contain leaflet z-indices
    position: relative;
    z-index: 1;

    .leaflet-container {
      width: 100%;
      height: 100%;

      .leaflet-pane {
        z-index: 10;

        .leaflet-rectangle {
          cursor: pointer;
        }
      }

      .map-dot-area {
        position: absolute;
        z-index: 11;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
      }
    }

    .map-background-div {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      cursor: crosshair;
    }
  }
}

.leaflet-popup-tip-container {
  margin: 0 auto;
  width: 0;
  height: 0;
  position: relative;
  overflow: hidden;
}

.leaflet-popup-content-wrapper {
  background: #FBFBB0;
  opacity: 0.7;
  border-radius: 0;
}

.leaflet-popup-content {
  margin: 6px 9px;
  line-height: 1;
}
.leaflet-popup-content p {
  margin: 6px 0;
}

.leaflet-popup-tip {
  background: transparent;
}

.leaflet-popup-tip {
  width: 0;
  height: 0;
  padding: 0;
}

.leaflet-container ~ div {
  z-index: 1100;
}
.leaflet-container .leaflet-control-attribution {
  margin: 10px;
  opacity: .5;
  width: 140px;
}

.map-container {

  .map-grid-slider {
    position: absolute!important;
    top: 16px;
    right: 58px;
    width: 40px;
    height: 16px;
    left: auto;
    background: rgba(211, 211, 211, 0.25);
    z-index: 1;
    border-radius: 3px;
  }

  .map-grid-slider-track {
    background: gray;
    height: 2px;
    border-radius: 3px;
  }

  .map-grid-slider-thumb {
    background: teal;
  }

  .map-marquee-select {
    position: absolute;
    top: 9px;
    right: 6px;
    width: 32px;
    height: 32px;
    left: auto;
    border: none;
    z-index: 1;
    background-image:  url('../assets/map_marquee_icon.svg');
    background-repeat: no-repeat;

    &:hover {
      background-image:  url('../assets/map_marquee_icon_hover.svg');
      background-repeat: no-repeat;
    }

  }
  .selected {
    background-image:  url('../assets/map_marquee_icon_selected.svg');

    &:hover {
      background-image:  url('../assets/map_marquee_icon_selected_hover.svg');
      cursor: crosshair;
    }
  }

  .map-background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

}

.map-d3-tip {
  font-size: small;
  line-height: 1.2;
  padding: 5px;
  pointer-events: none !important;
  color: #203d5d;
  box-shadow: 0 4px 20px 4px rgba(0, 20, 60, .1), 0 4px 80px -8px rgba(0, 20, 60, .2);
  background-color: rgba(251, 251, 176, 0.7);
  border-radius: 4px;
}
