.layer-switcher {
  position: absolute;
  top: 2.5em;
  right: 0.5em;
  text-align: left;
}

.layer-switcher .panel {
  margin: 0;
  border: 4px solid #eee;
  border-radius: 4px;
  background-color: white;
  display: none;
  max-height: inherit;
  box-sizing: border-box;
  overflow-y: auto;
}

.layer-switcher button:focus,
.layer-switcher button:hover {
  background-color: white;
}

.layer-switcher.shown {
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 5.5em);
}

.layer-switcher.shown.ol-control {
  background-color: transparent;
}

.layer-switcher.shown.ol-control:hover {
  background-color: transparent;
}
.layer-switcher.shown .panel {
  display: block;
}

.layer-switcher.shown button {
  display: none;
}

.layer-switcher.shown.layer-switcher-activation-mode-click > button {
  display: block;
  background-image: unset;
  right: 2px;
  position: absolute;
  background-color: #eee;
  margin: 1px;
}

.layer-switcher.shown button:focus,
.layer-switcher.shown button:hover {
  background-color: #fafafa;
}

.layer-switcher ul {
  list-style: none;
  margin: 1.6em 0.4em;
  padding-left: 0;
}
.layer-switcher ul ul {
  padding-left: 1.2em;
  margin: 0.1em 0 0 0;
}
.layer-switcher li.group + li.group {
  margin-top: 0.4em;
}

.layer-switcher li.group > label {
  font-weight: bold;
}

.layer-switcher.layer-switcher-group-select-style-none li.group > label {
  padding-left: 1.2em;
}

.layer-switcher li {
  position: relative;
  margin-top: 0.3em;
}

.layer-switcher li input {
  position: absolute;
  left: 1.2em;
  height: 1em;
  width: 1em;
  font-size: 1em;
}
.layer-switcher li label {
  padding-left: 3em;
  padding-right: 1em;
  display: inline-block;
  margin-top: 1px;
}

.layer-switcher label.disabled {
  opacity: 0.4;
}

.layer-switcher input {
  margin: 0px;
}

.layer-switcher.touch ::-webkit-scrollbar {
  width: 4px;
}

.layer-switcher.touch ::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.layer-switcher.touch ::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}

li.layer-switcher-base-group > label {
  padding-left: 1.5em;
}

.layer-switcher .group button {
  position: absolute;
  left: 0;
  display: inline-block;
  vertical-align: top;
  float: none;
  font-size: 1em;
  width: 1em;
  height: 1em;
  margin: 0;
  background-position: center 2px;
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAW0lEQVR4nGNgGAWMyBwXFxcGBgaGeii3EU0tXHzPnj1wQRYsihqQ+I0ExDEMQAYNONgoAN0AmMkNaDSyQSheY8JiaCMOGzE04zIAmyFYNTMw4A+DRhzsUUBtAADw4BCeIZkGdwAAAABJRU5ErkJggg==");
  -webkit-transition: -webkit-transform 0.2s ease-in-out;
  -ms-transition: -ms-transform 0.2s ease-in-out;
  transition: transform 0.2s ease-in-out;
}

.layer-switcher .group.layer-switcher-close button {
  transform: rotate(-90deg);
  -webkit-transform: rotate(-90deg);
}

.layer-switcher .group.layer-switcher-fold.layer-switcher-close > ul {
  overflow: hidden;
  height: 0;
}

/*layerswitcher on the right*/
.layer-switcher.shown.layer-switcher-activation-mode-click {
  padding-left: 34px;
}
.layer-switcher.shown.layer-switcher-activation-mode-click > button {
  left: 0;
  border-right: 0;
}

/*style for layer stwitch button */
.layer-switcher button {
  background-image: url("/static/public/img/map_icon.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  padding: 5px;
  width: 32px;
  height: 32px;
  color: transparent; /* Hide text if any */
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.custom-layer-toggle {
  right: 10px; /* Adjust the horizontal position as needed */
}

.layer-toggle-panel {
  margin-top: 5px;
}

/* Styles for the popup container */
.ol-popup {
  position: absolute;
  background-color: #fff; /* Clean white background */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Softer shadow for better depth */
  padding: 15px; /* Consistent padding */
  border-radius: 8px; /* Subtle rounded corners */
  border: 1px solid #ddd; /* Light border for definition */
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%); /* Center the popup horizontally */
  min-width: 500px; /* Minimum width */
  max-width: 90%; /* Adjust width based on screen size */
  font-family: "Arial", sans-serif;
  color: #333; /* Darker text for readability */
  line-height: 1.4;
  z-index: 1000;
  word-wrap: break-word; /* Prevent text overflow */
  overflow: hidden; /* Prevent content overflow */
}

/* Media query for mobile devices */
@media screen and (max-width: 767px) {
  .ol-popup {
    padding: 10px; /* Adjust padding for smaller screens */
    bottom: 10px; /* Slightly reduced bottom margin */
  }
}

/* Popup closer button */
.ol-popup-closer {
  position: absolute;
  top: 5px;
  right: 10px;
  text-decoration: none;
  font-size: 20px;
  font-weight: bold;
  color: #333;
  border: none;
  background: none;
  padding: 5px;
  cursor: pointer;
}

.ol-popup-closer:hover {
  color: red; /* Highlight close button on hover */
}

/* Popup header */
.ol-popup-header {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 12px;
  text-align: center;
  color: #003299; /* Blue header color */
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

/* Wrapper for table for horizontal scrolling */
.table-wrapper {
  overflow-x: auto;
  max-width: 100%; /* Allow the wrapper to adapt to available space */
  margin-top: 10px;
}
.popup-title {
  color: #003299; /* Blue for titles */
  font-weight: bold;
}

.popup-value {
  color: #333; /* Darker color for values */
}

/* Table for feature info */
.feature-info-table {
  width: 100%; /* Full width */
  border-collapse: collapse;
  background-color: #f9f9f9;
  font-size: 14px; /* Adjust font size */
}

.feature-info-table th {
  background-color: #003299; /* Blue header */
  color: #fff; /* White text */
  padding: 10px;
  text-align: left;
  font-weight: bold;
}

.feature-info-table td {
  padding: 12px;
  border: 1px solid #ddd; /* Light border for separation */
  text-align: left;
  background-color: #f7f7f7; /* Light gray background for rows */
}

.feature-info-table tr:nth-child(even) td {
  background-color: #e9ecef; /* Alternate row coloring */
}

.feature-info-table tr:nth-child(odd) td {
  background-color: #f7f7f7; /* Default row background */
}

/* Adjustments for larger screens */
@media screen and (min-width: 768px) {
  .feature-info-table {
    font-size: 16px; /* Slightly larger font size */
  }
}

/* Media query for mobile devices (max-width: 767px) */
@media screen and (max-width: 767px) {
  /* Adjust popup dimensions */
  .ol-popup {
    padding: 10px; /* Reduce padding */
    min-width: 250px; /* Slightly smaller minimum width for mobiles */
    max-width: 95%; /* Ensure popup fits within the viewport */
    bottom: 10px;
    font-size: 14px; /* Smaller text for mobile screens */
  }

  /* Table wrapper for horizontal scrolling */
  .table-wrapper {
    overflow-x: auto; /* Enable horizontal scrolling */
    max-width: 100%; /* Ensure the wrapper takes full width */
  }

  /* Adjust table for mobile */
  .feature-info-table {
    font-size: 12px; /* Smaller font size for compact view */
  }

  .feature-info-table th,
  .feature-info-table td {
    padding: 8px; /* Reduce padding for better fit */
  }

  /* Optional: Adjust table header text alignment if needed */
  .feature-info-table th {
    text-align: center; /* Center-align header text for smaller screens */
  }

  /* Content layout adjustments */
  .ol-popup-content div {
    flex-direction: column; /* Stack key-value pairs for better fit */
  }

  .ol-popup-content strong {
    font-size: 14px; /* Reduce key size */
    margin-bottom: 4px; /* Add spacing between keys and values */
  }

  .ol-popup-content span {
    font-size: 14px; /* Reduce value size */
    word-break: break-word; /* Ensure long values break properly */
  }
}

/* Popup content layout adjustments */
.ol-popup-content {
  overflow: hidden; /* Prevent overflow within content */
}

.ol-popup-content strong {
  color: #003299; /* Highlight keys */
  font-weight: bold;
}

/*layerswitcher on the left*/
/*
.layer-switcher.shown.layer-switcher-activation-mode-click {
  padding-right: 34px;
}
.layer-switcher.shown.layer-switcher-activation-mode-click > button {
  right: 0;
  border-left: 0;
}
*/

/* Full-screen map */
#map {
  height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  background-color: #f4f4f4;
}

/* General button styling */
.ol-control button {
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  color: #333;
  font-size: 14px;
  cursor: pointer;
}

/* Mouse position at the top */
.custom-mouse-position {
  position: absolute;
  top: 10px;
  left: 50px;
  padding: 5px 10px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
}

/* Fullscreen button in the top-right corner */
.ol-full-screen {
  top: 10px;
  right: 10px;
}

/* Layer switcher icon on the left */
.ol-layerswitcher {
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
}

/* Scale line at the bottom */
.ol-scale-line {
  position: absolute;
  bottom: 10px;
  left: 10px;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .custom-mouse-position {
    font-size: 10px;
  }

  .ol-control button {
    font-size: 12px;
  }
}
