/* Spinner/Loader styles */
.loader-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.spinner {
  border: 8px solid #f3f3f3; /* Light grey */
  border-top: 8px solid #3498db; /* Blue */
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

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

/* Modal styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  background-color: white;
  padding: 20px;
  width: 80%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  background-color: #d9534f;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.close-button:hover {
  background-color: #c9302c;
}

/* Sidebar and facet styles */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 1000;
  display: block;
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #f5f5f5;
  border-right: 1px solid #eee;
}

.facet-title {
  font-weight: bold;
  margin-top: 20px;
}

.facet-link {
  display: block;
  margin-bottom: 10px;
  color: #337ab7;
  cursor: pointer;
  text-decoration: underline;
}

.facet-link:hover {
  color: #23527c;
}

/* Selected facets styles */
.selected-facets-container {
  margin-top: 20px;
}

.selected-facet {
  display: inline-block;
  background-color: #e7f1ff;
  padding: 5px 10px;
  margin: 5px;
  border-radius: 5px;
  font-size: 14px;
}

.remove-facet {
  margin-left: 8px;
  color: #d9534f;
  cursor: pointer;
  font-weight: bold;
}

.remove-facet:hover {
  color: #c9302c;
}

.facet-link-container {
  display: flex;
  align-items: center;
}

.remove-facet {
  margin-left: 5px;
  color: #d9534f;
  cursor: pointer;
  font-weight: bold;
  display: inline-block;
}

.remove-facet:hover {
  color: #c9302c;
}

.search-container {
  display: flex;
  gap: 10px; /* Space between input and button */
}

#scientificNameSearch {
  flex: 1; /* Input takes up available space */
  padding: 8px;
  font-size: 16px;
}

#searchButton {
  flex: 0 0 auto; /* Button takes only the space it needs */
  padding: 8px 8px;
  font-size: 10px;
  cursor: pointer;
}

/* Ensure the HTML and body take up the full height of the viewport */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Set the container-fluid class to full height */
.container-fluid {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Make the row inside the container-fluid fill available space */
.row {
  flex: 1;
  display: flex;
}

/* Sidebar adjustments to ensure proper layout */
.sidebar {
  overflow-y: auto;
}

/* Main content adjustments for table and map views */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Set the map container to fill available height */
#mapContainer {
  flex: 1; /* Allows the map to expand within its container */
}

/* Set the map itself to fill the entire height of its container */
#map {
  height: 100%; /* Ensures the map takes up the full height */
}

/* Selection Bar Styles */
.toggle-bar {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  gap: 10px;
}

/* Custom button styles for a softer, more muted appearance */
.btn-custom-table {
  background-color: #6c757d; /* Muted blue-gray */
  border: none;
  color: white;
  transition: background-color 0.3s, color 0.3s;
}

.btn-custom-table:hover {
  background-color: #5a6268; /* Slightly darker on hover */
}

.btn-custom-map {
  background-color: #6c757d; /* Muted green-gray */
  border: none;
  color: white;
  transition: background-color 0.3s, color 0.3s;
}

.btn-custom-map:hover {
  background-color: #5a6268; /* Slightly darker on hover */
}

.toggle-bar #resultsHeading {
  font-weight: normal;
  font-size: 14px;
  margin: 0;
}

/* Basic Pagination Styles */
.pagination-container {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.pagination-container .pagination-button {
  margin: 0 5px;
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f8f9fa;
  cursor: pointer;
  transition: background-color 0.3s;
}

.pagination-container .pagination-button:hover {
  background-color: #e2e6ea;
}

.pagination-container .pagination-button:disabled {
  background-color: #ddd;
  cursor: not-allowed;
}

#humanCheckDialog {
  display: none;
  text-align: center;
}
#humanCheckDialog .robot-icon {
  font-size: 40px;
  color: #3a87ad;
  margin-bottom: 10px;
}
#humanCheckDialog p {
  font-size: 14px;
  margin: 10px 0;
}
.ui-dialog-titlebar-close {
  display: none; /* Hide the close button */
}

/* Increase the size of the chart container for better readability */
.chart-container {
  max-width: 400px; /* Increase this value for larger charts */
  margin: 0 auto;
  padding: 20px;
}

/* Basic table styling */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.table th,
.table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.table-striped tbody tr:nth-child(odd) {
  background-color: #f9f9f9;
}
