/* Final V5 */
html,
body,
#map {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}

#loading {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  z-index: 1000;
}

/* Layer control panel styling */
#layer-control {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 300px;
  z-index: 1000;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  display: block; /* Show by default on startup */
}

/* Layer control toggle button */
#layer-control-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 999;
  border-radius: 4px;
  padding: 8px 12px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

#selection-display {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 998;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.card-body-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
}

.dot-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px 10px;
}

/* Custom popup styling */
.custom-popup {
  max-width: 300px;
}

.popup-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.popup-content {
  font-size: 14px;
}

.popup-row {
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
}

.popup-label {
  font-weight: bold;
}

/* Hover popup styling */
.hovering-popup {
  z-index: 1000; /* Ensure it's above other elements */
}

.hovering-popup .leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.3);
}

.hovering-popup .leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.95);
}

/* Facility popup styling */
.facility-popup {
  width: 280px;
}

.facility-popup-header {
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #ddd;
}

.facility-popup-title {
  font-weight: bold;
  font-size: 16px;
}

.facility-popup-subtitle {
  color: #666;
  font-size: 12px;
}

.facility-popup-item {
  display: flex;
  margin-bottom: 8px;
}

.facility-popup-icon {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

/* Legend styling */
.info.legend {
  background: white;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  max-height: 300px;
  overflow-y: auto;
  transition: max-height 0.3s;
}

.legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  cursor: pointer;
}

.legend-toggle {
  color: #555;
  font-size: 16px;
}

.legend-content {
  overflow: hidden;
  transition: max-height 0.3s;
  max-height: 250px;
}

.legend-collapsed .legend-content {
  max-height: 0;
}

.info.legend i {
  width: 18px;
  height: 18px;
  float: left;
  margin-right: 8px;
  opacity: 0.7;
}

/* Select2 customization for the layer control */
.select2-container {
  width: 100% !important;
}

.select2-dropdown {
  z-index: 9999;
}

/* Card header styling */
.card-body-header {
  display: flex; /* Enable flexbox */
  align-items: center; /* Vertically align items in the center */
  padding: 10px; /* Add some padding */
}

.card-body-header img {
  margin-right: 10px; /* Add some space between the image and the text */
}

.dot-header {
  display: flex; /* Enable flexbox */
  align-items: center; /* Vertically align items in the center */
  justify-content: center;
}

#close-layer-control {
  filter: invert(1); /* Makes the default close icon white */
  opacity: 1; /* Ensures full opacity */
}
