* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
}

.container {
  max-width: 1640px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background-color: #4CAF50;
  color: #fff;
  padding: 1rem 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-weight: 300;
  font-size: 1.2rem;
}

#map {
  height: 800px;
  width: 100%;
  margin: 2rem 0;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  position: relative; 
}

#filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}


#filter button {
  padding: 10px 5px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  flex: 1 0 calc(25% - 10px); /* This will create 4 buttons per row on larger screens */
  max-width: calc(25% - 10px);
  min-width: 120px; /* Ensures buttons don't get too small */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  #filter button {
    flex: 1 0 calc(50% - 10px); /* This will create 2 buttons per row on smaller screens */
    max-width: calc(50% - 10px);
  }
}

@media (max-width: 480px) {
  #filter button {
    flex: 1 0 100%; /* This will create 1 button per row on very small screens */
    max-width: 100%;
  }
}

#filter button.active {
  font-weight: bold;
  transform: scale(1.02);
}

#filter button:hover {
  opacity: 0.8;
}

#filter button:focus {
  outline: none;
}

#locationList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 50px;
}

.location-item {
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.location-item:hover {
  transform: translateY(-5px);
}

.location-header {
  padding: 15px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
}

.location-body {
  padding: 15px;
}

.location-description {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.location-status {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.location-link {
  display: inline-block;
  padding: 8px 15px;
  background-color: #4CAF50;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.location-link:hover {
  background-color: #45a049;
}

.status-icon {
  margin-right: 5px;
}

#mapControls {
  position: absolute;
  top: 10px;
  right: 10%;
  z-index: 1000;
}

.toggle-btn {
  background-color: #fff;
  border: 2px solid #4CAF50;
  color: #4CAF50;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
}

.toggle-btn:hover {
  background-color: #4CAF50;
  color: #fff;
}

.toggle-btn.active {
  background-color: #4CAF50;
  color: #fff;
}

#pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px;
}

.page-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 0 10px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.page-btn:hover {
  background-color: #45a049;
}

.page-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

#currentPage {
  font-size: 1rem;
  font-weight: bold;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #4CAF50;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.location-item.not-found {
  background-color: #ffebee;
  border: 1px solid #ef9a9a;
}

.location-error {
  color: #c62828;
  font-weight: bold;
}

@media (max-width: 768px) {
  #locationList {
      grid-template-columns: 1fr;
  }
  #filter button {
      max-width: calc(50% - 10px);
  }
}

.location-item {
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  font-size: 16px; /* Increased base font size */
}

.location-item:hover {
  transform: translateY(-5px);
}

.location-header {
  padding: 15px;
  font-size: 1.4rem; /* Increased from 1.2rem */
  font-weight: bold;
  color: #fff;
}

.location-body {
  padding: 20px; /* Increased from 15px */
}

.location-description {
  margin-bottom: 15px; /* Increased from 10px */
  font-size: 1.1rem; /* Increased from 0.9rem */
}

.location-address,
.location-phone,
.location-status {
  margin-bottom: 10px;
  font-size: 1rem; /* Increased from 0.9rem */
}

.location-error {
  color: #c62828;
  font-weight: bold;
  font-size: 1rem;
}

.google-maps-btn {
  display: inline-block;
  background-color: #4285F4;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  margin-top: 15px;
  transition: background-color 0.3s ease;
}

.google-maps-btn:hover {
  background-color: #3367D6;
}


.location-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

.google-maps-btn,
.highlight-map-btn {
  display: inline-block;
  padding: 10px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  margin: 5px;
}

.google-maps-btn {
  background-color: #4285F4;
  color: white;
}

.google-maps-btn:hover {
  background-color: #3367D6;
}

.highlight-map-btn {
  background-color: #34A853;
  color: white;
}

.highlight-map-btn:hover {
  background-color: #2E8B57;
}



.location-item {
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  font-size: 16px;
  display: flex;
  flex-direction: column;
  height: 100%; /* Ensure the card takes full height of its container */
}

.location-item:hover {
  transform: translateY(-5px);
}

.location-header {
  padding: 15px;
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
}

.location-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Allow content to grow and push buttons to bottom */
}

.location-body {
  padding: 20px;
  flex-grow: 1; /* Allow body to grow and push buttons to bottom */
}

.location-description {
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.location-address,
.location-phone,
.location-status {
  margin-bottom: 10px;
  font-size: 1rem;
}

.location-error {
  color: #c62828;
  font-weight: bold;
  font-size: 1rem;
}

.location-buttons {
  display: flex;
  justify-content: space-between;
  padding: 15px;
  background-color: #f8f8f8; /* Light gray background to separate from content */
  border-top: 1px solid #e0e0e0; /* Light border to separate from content */
}

.google-maps-btn,
.highlight-map-btn {
  flex: 1;
  margin: 0 5px;
  padding: 10px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
}

.google-maps-btn {
  background-color: #4285F4;
  color: white;
}

.google-maps-btn:hover {
  background-color: #3367D6;
}

.highlight-map-btn {
  background-color: #34A853;
  color: white;
}

.highlight-map-btn:hover {
  background-color: #2E8B57;
}

#locationList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  max-width: 100%;
}
@media (min-width: 1200px) {
  #locationList {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1199px) and (min-width: 900px) {
  #locationList {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 899px) and (min-width: 600px) {
  #locationList {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 599px) {
  #locationList {
    grid-template-columns: 1fr;
  }
}
.status-change {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px;
}

.status-dropdown {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.status-dropdown:hover, .status-dropdown:focus {
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
  outline: none;
}

.change-status-btn {
  padding: 8px 16px;
  font-size: 14px;
  color: #fff;
  background-color: #4CAF50;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s;
}

.change-status-btn:hover {
  background-color: #45a049;
}

.change-status-btn:active {
  transform: translateY(1px);
}

@media (min-width: 768px) {
  .status-change {
      flex-direction: row;
      align-items: center;
  }

  .status-dropdown {
      flex: 1;
  }

  .change-status-btn {
      flex: 0 0 auto;
  }
}
#dateFilter {
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.filter-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 15px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

#dateFilter label {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

#dateFilter input[type="date"] {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s ease;
  width: 100%;
}

#dateFilter input[type="date"]:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

#fetchAll {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

#fetchAll:hover {
  background-color: #45a049;
}

#fetchAll:active {
  transform: translateY(1px);
}

@media (max-width: 768px) {
  .filter-row {
      flex-direction: column;
  }

  #dateFilter input[type="date"],
  #fetchAll {
      width: 100%;
  }
}