body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll caused by the hidden sidebar */
    font-family: Arial, sans-serif; /* Default font */
  }

/* Fullscreen map */
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
  }

  /* ✅ Sidebar Smooth Slide */
  #sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px; /* Slightly wider */
    height: 100%;
    background: #f9f9f9;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 1000;
    transform: translateX(-105%); /* Start hidden */
    transition: transform 0.5s ease-in-out; /* ✅ Smooth slide */
  }

   #sidebar .sidebar-container{
    position: relative;
   }
  
  /* Sidebar Section */
  #sidebar label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
  }
  
  #sidebar select,
  #sidebar input[type="date"] {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    outline: none;
  }
  
  #sidebar button {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 14px;
    color: #fff;
    background: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }
  
  #sidebar button:hover {
    background: #0056b3;
  }  

/* ✅ Sidebar Open Animation */
#sidebar.open {
  transform: translateX(0); /* Slide in smoothly */
}


  /* Divider */
  #sidebar .divider {
    border-bottom: 1px solid #ddd;
    margin: 20px 0;
  }
  
  /* Close Button Inside Sidebar */
  #close-sidebar {
    position: absolute;
    top: 0;
    left: 10px;
    z-index: 1001;
    cursor: pointer;
    background: white;
    padding: 15px;
  }
  
  #close-sidebar i {
    font-size: 22px;
    color: #333;
  }
  

/* Hamburger Icon */
#hamburger {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  padding: 15px;
  cursor: pointer;
}

#hamburger i {
  font-size: 22px;
  color: #333;
}

#hamburger.hidden {
    display: none;
  }  
  
  /* ✅ Ensure Dashboard Button Looks Correct */
#dashboard-btn {
  display: block;
  text-align: center;
  padding: 10px;
  margin: 10px auto;
  background-color: #007bff;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

#dashboard-btn:hover {
  background-color: #0056b3;
}
  /* Search Bar */
  #map-search {
    position: absolute;
    top: 10px;
    left: 70px; /* Space for the hamburger menu */
    width: calc(100% - 80px); /* Adjust based on hamburger size */
    max-width: 500px;
    display: flex;
    background: white;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    padding: 5px;
    z-index: 1000;
    height: 40px;
  }
  
  #map-search-bar {
    flex: 1;
    border: none;
    border-radius: 30px 0 0 30px;
    padding: 10px;
    font-size: 16px;
    outline: none;
  }
  
  #map-search-button {
    background: #333;
    color: white;
    border: none;
    border-radius: 0 30px 30px 0;
    padding: 10px 20px;
    cursor: pointer;
  }
  
  #map-search-button i {
    font-size: 16px;
  }
  
  .mapboxgl-popup-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    padding: 10px;
    max-width: 285px !important; /* ✅ Forces popup to be exactly 300px */
    width: 285px !important; /* ✅ Ensures it doesn't shrink */
}

/* ✅ Filter */

#filter-button {
  position: absolute;
  top: 10px;
  right: 10px; /* Ensure it's visible in the top-right corner */
  background: #007bff;
  color: white;
  padding:15px;
  font-size: 22px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 1000; /* Ensure it stays above the map */
}

#filter-button:hover {
  background: #0056b3;
}

/* ✅ filter menu*/

#filter-menu {
  position: absolute;
  top: 50px;
  right: 10px;
  width: 250px;
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  opacity: 0; /* ✅ Invisible */
  visibility: hidden; /* ✅ Prevents interaction */
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

/* ✅ When menu is active, make it fade in */
#filter-menu.active {
  opacity: 1; /* ✅ Fully visible */
  visibility: visible; /* ✅ Allow interaction */
}


#filter-menu label {
  display: block;
  font-size: 14px;
  margin-top: 10px;
  font-weight: bold;
}

#filter-menu select {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  margin-bottom: 10px;
}

#filter-menu button {
  width: 100%;
  background: #28a745;
  color: white;
  border: none;
  padding: 8px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
}

#filter-menu button:hover {
  background: #218838;
}

/* POP UP */
.mapboxgl-popup-content h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.mapboxgl-popup-content p {
    margin: 0 0 8px;
    font-size: 14px;
    color: #555;
}

.mapboxgl-popup-content ul {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}

.mapboxgl-popup-content ul li {
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.popup-section {
  border-top: 1px solid #ddd;
  padding-top: 5px;
  margin-top: 5px;
}

.popup-section h4 {
  margin: 5px 0;
  font-size: 14px;
}

.epc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin: 5px 0;
}

.epc-box {
  text-align: center;
  font-size: 12px;
  padding: 5px;
  color: white;
  font-weight: bold;
  border-radius: 4px;
}

.mapboxgl-popup-content svg text {
  font-family: Arial, sans-serif !important;
  font-size: 29px !important;
}


/* ✅ Marker Styles */
.marker-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

/* ✅ Fix Overlay Position & Remove White Background */
.marker-overlay {
  position: absolute;
  top: -10px;
  right: -10px;
  background: none; /* ✅ Removes white bubble */
  font-size: 16px;
  font-weight: bold;
  color: white; /* ✅ Makes overlay more readable */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6); /* ✅ Adds readability */
}


.marker img {
  transform: translate(-50%, -50%);
  position: absolute;
}

/* ✅ Improve Loading Spinner */
.spinner {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 6px solid rgba(0, 0, 0, 0.1);
  border-top: 6px solid #007BFF;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 0.8s linear infinite; /* ✅ Faster animation */
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

