.leaflet-popup-content-wrapper {
  background: #2e4d1e; /* Dark green background */
  color: #fff; /* White text color */
  border-radius: 12px; /* Rounded corners */
}

/* Change the background color of the popup tip */
.leaflet-popup-tip-container .leaflet-popup-tip {
  background: #2e4d1e; /* Replace #yourColor with the same color as the popup background */
}

.leaflet-popup-content {
  font-size: 14px; /* Adjust font size as needed */
}

.leaflet-top.leaflet-right {
  width: 140px;
}

.year-select {
  background: #44633f; /* Muted green background for the dropdown */
  color: #fff; /* White text color for the dropdown */
  border: none; /* Remove default border */
  padding: 5px; /* Add some padding */
  margin-bottom: 10px; /* Add some space below the dropdown */
}

/* Style the dropdown when it's focused */
.year-select:focus {
  outline: none; /* Remove default focus outline */
  box-shadow: 0 0 5px #aaccaa; /* Add a subtle glow effect */
}

/* DataTable Custom Styles */
.dataTables_wrapper {
  margin-top: 20px;
}

#sitesTable {
  font-family: Arial, sans-serif;
  font-size: 12px;
}

#sitesTable th {
  background-color: #2c5f2d;
  color: white;
  font-weight: bold;
  text-align: center;
  padding: 12px 8px;
  border-bottom: 2px solid #1a4d1e;
}

#sitesTable td {
  padding: 8px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

#sitesTable tbody tr:hover {
  background-color: #f0f8f0;
  cursor: pointer;
}

#sitesTable tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* DataTables control styling */
.dataTables_length,
.dataTables_filter,
.dataTables_info,
.dataTables_paginate {
  margin: 10px 0;
}

.dataTables_filter input {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 12px;
  margin-left: 10px;
}

.dataTables_length select {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 8px;
  margin: 0 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #sitesTable {
    font-size: 11px;
  }
  
  #sitesTable th,
  #sitesTable td {
    padding: 6px 4px;
  }
}

/* Section heading style */
h2 {
  color: #2c5f2d;
  border-bottom: 2px solid #2c5f2d;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

/* Gradient-specific styling */
#sitesTable tbody tr[data-year-count]:hover {
  background-color: rgba(44, 95, 45, 0.2) !important;
  transform: translateX(2px);
  transition: all 0.2s ease;
}

/* Gradient toggle styling */
.gradient-toggle {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gradient-toggle label {
  margin: 0;
  font-size: 14px;
  user-select: none;
}

.gradient-toggle input[type="checkbox"] {
  accent-color: #2c5f2d;
}

/* Year count badge (optional enhancement) */
.year-count-badge {
  display: inline-block;
  background-color: #2c5f2d;
  color: white;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: bold;
  margin-left: 5px;
}

/* Enhanced hover effect for gradient mode */
#sitesTable.gradient-mode tbody tr:hover {
  transform: scale(1.002);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

/* Ensure readability of text over gradient backgrounds */
#sitesTable tbody tr[data-year-count] td {
  position: relative;
  z-index: 1;
}

/* Year Count column styling */
.year-count-cell {
  font-weight: bold;
  color: #2c5f2d;
  text-align: center;
  background-color: rgba(44, 95, 45, 0.05);
}

#sitesTable th:nth-child(11) {
  background-color: #1a4d1e !important;
  position: relative;
}

#sitesTable th:nth-child(11):after {
  content: " 📊";
  font-size: 12px;
}

/* Hover effect for year count cells */
.year-count-cell:hover {
  background-color: rgba(44, 95, 45, 0.15);
  transform: scale(1.05);
  transition: all 0.2s ease;
}

/* Sort indicator enhancement for Year Count column */
#sitesTable th:nth-child(11).sorting,
#sitesTable th:nth-child(11).sorting_asc,  
#sitesTable th:nth-child(11).sorting_desc {
  background-color: #1a4d1e !important;
  font-weight: bold;
}

/* Clickable site code styling */
.site-code-link {
  color: #2c5f2d;
  font-weight: bold;
  cursor: pointer;
  text-decoration: underline;
  transition: all 0.2s ease;
  padding: 2px 4px;
  border-radius: 3px;
}

.site-code-link:hover {
  background-color: #2c5f2d;
  color: white;
  text-decoration: none;
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(44, 95, 45, 0.3);
}

.site-code-link:active {
  transform: scale(0.95);
  background-color: #1a4d1e;
}

/* Add a map icon indicator */
.site-code-link:after {
  content: " 🎯";
  font-size: 12px;
  opacity: 0.7;
}

.site-code-link:hover:after {
  opacity: 1;
}

/* Map container improvements */
#map {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 30px;
  border: 2px solid #2c5f2d;
}

/* Body and page layout improvements */
body {
  margin: 0;
  padding: 20px 0;
  background-color: #f8f9fa;
  font-family: Arial, sans-serif;
}

/* Better section spacing */
.table-section {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin: 0 20px;
  padding: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #map {
    margin: 0 10px;
    margin-bottom: 20px;
  }
  
  .table-section {
    margin: 0 10px;
    padding: 15px;
  }
  
  body {
    padding: 10px 0;
  }
}

/* Shapefile availability highlighting - orange shadows, strong borders */
#sitesTable tbody tr.has-shapefile,
#sitesTable.gradient-mode tbody tr.has-shapefile {
  box-shadow: 0 0 12px rgba(44, 95, 45, 0.8) !important;
  /* No background-color override - let gradient show through */
}

#sitesTable tbody tr.has-shapefile td,
#sitesTable.gradient-mode tbody tr.has-shapefile td {
  border-top: 1px solid #2c5f2d !important;
  border-bottom: 1px solid #2c5f2d !important;
  position: relative !important;
}

#sitesTable tbody tr.has-shapefile td:first-child,
#sitesTable.gradient-mode tbody tr.has-shapefile td:first-child {
  border-left: 1px solid #2c5f2d !important;
}

#sitesTable tbody tr.has-shapefile td:last-child,
#sitesTable.gradient-mode tbody tr.has-shapefile td:last-child {
  border-right: 1px solid #2c5f2d !important;
}

#sitesTable tbody tr.has-shapefile:hover,
#sitesTable.gradient-mode tbody tr.has-shapefile:hover {
  box-shadow: 0 0 16px rgba(26, 77, 30, 1.0) !important;
}

#sitesTable tbody tr.has-shapefile:hover td,
#sitesTable.gradient-mode tbody tr.has-shapefile:hover td {
  border-top: 1px solid #1a4d1e !important;
  border-bottom: 1px solid #1a4d1e !important;
}

#sitesTable tbody tr.has-shapefile:hover td:first-child,
#sitesTable.gradient-mode tbody tr.has-shapefile:hover td:first-child {
  border-left: 1px solid #1a4d1e !important;
}

#sitesTable tbody tr.has-shapefile:hover td:last-child,
#sitesTable.gradient-mode tbody tr.has-shapefile:hover td:last-child {
  border-right: 1px solid #1a4d1e !important;
}

/* Download link styling */
.download-link {
  display: inline-block;
  background-color: #2c5f2d;
  color: white !important;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s ease;
  border: 1px solid #2c5f2d;
}

.download-link:hover {
  background-color: #1a4d1e;
  border-color: #1a4d1e;
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(26, 77, 30, 0.3);
  color: white !important;
  text-decoration: none;
}

.download-link:active {
  transform: scale(0.95);
  background-color: #0d2e0f;
}

/* Download column header styling */
#sitesTable th:nth-child(13) {
  background-color: #1a4d1e !important;
  text-align: center;
}

#sitesTable th:nth-child(13):after {
  content: " 📥";
  font-size: 12px;
}

/* Map control buttons styling */
.reset-view-btn,
.toggle-shapefiles-btn {
  background-color: #2c5f2d;
  color: white;
  border: none;
  padding: 8px 12px;
  margin: 5px 2px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.reset-view-btn:hover,
.toggle-shapefiles-btn:hover {
  background-color: #1a4d1e;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.reset-view-btn:active,
.toggle-shapefiles-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Toggle shapefiles button states */
.toggle-shapefiles-btn.active {
  background-color: #ff6b35;
  color: white;
}

.toggle-shapefiles-btn.active:hover {
  background-color: #e55a2b;
}