body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  overflow-y: auto; /* Enable vertical scrolling when needed */
  position: relative;
  display: flex;
  flex-direction: column;
}

body.no-scroll {
  overflow: hidden;
}

/* Header */
.header {
  background-color: #fff;
  color: black;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  position: fixed;
  height: 40px; /* Set a fixed height */
}

.header a {
  display: flex;
  align-items: center;
}

.header img {
  margin-left: 10px;
  height: 40px;
}

.header h1 {
  margin: 0;
  flex-grow: 1;
  padding-left: 20px;
}

/* Buttons */
button {
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  border: none;
}

.logout-btn, #selectAnotherBatch, #viewUserDetails {
  background-color: white;
  color: black;
}

.logout-btn:hover, #selectAnotherBatch:hover , #viewUserDetails:hover {
  background-color: #ddd;
}

/* User Profile */
.user-menu {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  gap: 10px;
}

.profile-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.username {
  font-size: 16px;
  margin-right: 10px;
}

.dropdown-toggle {
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 5px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
  border-radius: 5px;
  z-index: 1000;
  min-width: 150px;
  padding: 10px 0;
}

.user-menu:hover .dropdown-menu {
  display: block;
}

.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 10px 20px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.dropdown-menu button:hover {
  background-color: #f0f0f0;
}
/* Sidebar */
.sidebar {
  position: fixed;
  top: 52px; /* Adjust this to match your header height */
  right: 0;
  width: 300px; /* Adjust width as needed */
  height: calc(100vh - 140px); /* Prevent overlap with the header */
  background: white;
  padding: 15px;
  overflow-y: auto;
  display: none; /* Initially hidden */
  z-index: 1000; /* Ensure it's above other elements */
}

.sidebar.open {
  transform: translateX(0); /* Slide in */
}

.sidebar h3 {
  margin-top: 0;
}

.sidebar strong {
  display: block;
  margin: 5px 0;
}
.sidebar .submit-btn {
  position: absolute;
  top: 570px;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: white;
  background-color: #007bff;
}

.sidebar .submit-btn:hover {
  color: red;
}
.sidebar .submit-btn:hover {
  background-color: white;
}
.sidebar button {
  background-color: white;
  color: red;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
}

.sidebar button:hover {
  background-color: white;
}
.close-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: black;
  font-weight: bold;
}

.close-btn:hover {
  color: black;
  background-color: white;
}
.map-container {
  width: 100%;
  height: 85% !important;
  position: fixed; /* Keep it fixed so the map stays visible */
  top: 50px; /* Push it below the fixed header */
  left: 0;
  overflow: hidden; /* Prevent map from scrolling */
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;  /* Takes up the remaining space */
}

.map-container #map {
  width: 100%;
  height: 100%;
}

/* Map */
#map {
  flex-grow: 1;
  width: 100%;
  height: 100%; /* Adjust to fit the main container */
}
/* Sidebar Toggle */
.toggle-sidebar-btn {
  position: fixed;
  top: 70px;
  left: 10px;
  background-color: #3498db;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1001;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7); /* Dark overlay */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal Content - Full Screen */
.modal-content {
  width: 100vw; /* Full width */
  height: 100vh; /* Full height */
  background-color: white;
  border-radius: 0; /* Remove border-radius for full screen */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: auto !important; /* Allow scrolling if needed */
  padding: 20px;
}

.modal-content-footer {
  width: 100vw;
  background-color: white;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: auto !important;
}
#batchNumber {
  width: 80%;
  max-width: 400px;
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
}
/* Submit Button */
.submit-btn {
  padding: 15px 30px;
  font-size: 1.2rem;
  background-color: #2c3e50;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s ease;
}
.submit-btn:hover {
  background-color: #1a252f;
}
#batchModal {
  display: none;
}
@media (max-width: 768px) {
  #voterListModal {
    display: none;
    position: fixed;
    top: 0; /* Full screen modal */
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    padding: 20px;
    z-index: 2000;
    overflow-y: auto; /* Scroll if content overflows */
    box-sizing: border-box;
  }

  #voterListModal h2 {
    position: sticky;
    top: 0;
    background: white;
    padding: 15px;
    font-size: 18px;
    text-align: center;
    border-bottom: 2px solid #ddd; /* Add border to separate heading */
    z-index: 10;
  }

  #voterListModal ul {
    padding: 10px;
    list-style: none;
  }
}
/* Responsive Design */
@media (max-width: 768px) {
  .table1 {
    font-size: 0.5rem;
  }
  .header {
    padding: 10px;
    justify-content: space-between;
  }

  .header h1 {
    text-align: center;
    padding-left: 0;
  }

  h1 {
    font-size: 1.0rem; 
  }

  .user-menu {
    margin-top: 10px;
  }

  .logo {
    width: 80px; 
    height: 20px;
    margin-left: 5px;
  }

  .title {
    font-size: 1rem;
  }

  .username {
    display: none;
  }
  .user-icon {
    display: inline-block;
  }

  .profile-img {
    width: 30px;
    height: 30px;
  }

  .dropdown-menu {
    right: 0;
    border-radius: 5px;
    padding: 10px;
    display: none;
    text-align: center;
  }

  .dropdown-username {
    display: block;
    font-weight: bold;
  }

  .mobile-only {
    display: block;
    width: 100%;
    margin-top: 10px;
  }

  .desktop-only {
    display: none;
  }

  .modal-content {
    width: 100vw;
    height: 100vh;
    padding: 20px;
  }

  #batchNumber {
    font-size: 1.2rem;
    width: 90%;
  }

  .submit-btn {
    font-size: 1rem;
    padding: 10px 20px;
  }
  .map-container #map {
    width: 100%;
    height: 95%;
  }
  
}

@media (max-width: 480px) {
  .modal-content {
    width: 90vw;
    height: 100vh;
    padding: 15px;
  }

  #batchNumber {
    font-size: 1rem;
    width: 80%;
  }

  .submit-btn {
    font-size: 0.9rem;
    padding: 8px 15px;
  }
}
@media (max-width: 768px) {
  #map {
    height: 90vh; /* Adjust for mobile */
    min-height: 300px; /* Ensure it doesn’t shrink too much */
  }
}

.mobile-only {
  display: none;
}
@media (min-width: 769px) {
  .mobile-only {
    display: none; /* Hide "Select Another Batch" inside dropdown on desktop */
  }

  .desktop-only {
    display: inline-block; /* Show "Select Another Batch" as a button on desktop */
  }
}

/* Footer Styles */
footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #f1f1f1;
  text-align: center;
  padding: 10px;
  box-shadow: 0px -2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 10px;
  z-index: 1000;
  height: 40px; /* Set a fixed height */
}

/* Button Styling */
button {
  padding: 10px 15px;
  font-size: 16px;
  border: none;
  cursor: pointer;
  background-color: #007bff;
  color: white;
  border-radius: 5px;
}

button:hover {
  background-color: #000000;
}
/* Full-Screen Modal Styling (Below Header) */
#voterListModal {
  display: none;
  position: fixed;
  top: 60px; /* Adjust to match your header height */
  left: 0;
  width: 100vw; /* Full width */
  height: calc(100vh - 60px); /* Take full height except header */
  background: white; /* Ensures clean background */
  padding: 20px;
  box-shadow: none; /* Removes any box shadows */
  z-index: 2000; /* Ensure it's above everything */
  border: none; /* Removes all borders */
  outline: none; /* Ensures no outline */
  box-sizing: border-box; /* Prevents content overflow */
  overflow: auto; /* Prevents scrollbars */
}

/* Optional: Improve Text Layout */
#voterListModal ul {
  padding: 0;
  margin: 0;
  list-style-position: inside; /* Align bullet points properly */
}

/* Responsive Design */
@media (max-width: 600px) {
  footer {
    padding: 8px;
  }

  button {
    font-size: 14px;
    padding: 8px 12px;
  }

  #voterListModal {
    width: 100%;
    max-height: 100%;
  }

  .sidebar {
    width: 80%;
  }
}
/* Responsive Adjustments */
@media (max-width: 600px) {
  header {
    font-size: 18px;
    padding: 10px;
  }

  footer {
    padding: 8px;
  }

  button {
    font-size: 14px;
    padding: 8px 12px;
  }
}
@media (max-width: 768px) {
  #sidebar {
    margin-top: 50px;
    height: 100vh; /* Full height */
    left: 0 !important;
    top: 0 !important;
    position: relative !important; /* Ensure it covers the whole screen */
    background: white;
    z-index: 10000 !important; /* Bring it above everything */
    padding: 20px;
    overflow-y: auto;
  }

  #closeSidebarBtn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
  }
}
.routeModal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.routeModal-content {
  text-align: center;
}
.close {
  float: right;
  cursor: pointer;
}
.suggestions-list {
  position: absolute;
  background: white;
  width: 250px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}
.suggestion-item {
  padding: 10px;
  cursor: pointer;
}
.suggestion-item:hover {
  background: #f0f0f0;
}
.location-btn {
  position: relative;
  background: #007bff;
  color: white;
  border: none;
  padding: 10px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
}
.location-btn .btn-text {
  display: none; /* Hide text by default */
  margin-left: 8px;
}
.location-btn:hover .btn-text {
  display: inline; /* Show text on hover */
}
/* General input styles */
input[type="text"] {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;  /* Light gray border */
  border-radius: 5px;
  outline: none;
  margin-bottom: 10px;
  background: white;
  color: black;
}

/* Specific styles for start and end location inputs */
.startLocation, .endLocation {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 5px;
  outline: none;
  background: white;
  color: black;
}

/* Focus effect */
.startLocation:focus, .endLocation:focus {
  border-color: #007bff;  /* Blue border when focused */
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

#route-sidebar {
  display: none; /* Initially hidden */
  position: fixed;
  top: 60px;
  right: 0;
  width: 300px;
  height: 86%;
  background: white;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease-in-out;
  overflow-y: scroll;
}

#route-sidebar.open {
  display: block; /* Make sure it shows when class is added */
}
