/* Dropdown Container */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 5px 10px;
}

.dropdown {
  position: relative;
  display: inline-block;
}

select {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Button Styling */
.control-btn,
.controls .metadata-btn {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background-color: #12664f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
}

.controls .metadata-btn {
  margin-left: auto;        /* push Meta data button to the right end */
}

/* Dropdown Menu */
.dropdown-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  max-height: 45vh;
  /* Set max height for the entire dropdown */
  overflow: hidden;
  /* Prevent scrolling of the entire dropdown */
  z-index: 1000;
  min-width: max-content;
}

/* Show dropdown menu when .show is applied */
.show {
  display: block;
}

/* Search Input */
#columnSearch {
  width: calc(93% - 24px);
  margin: 12px;
  padding: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  min-width: 200px;
}

/* Column Toggle Container */
#columnToggleContainer {
  flex: 1;
  overflow-y: auto;
  /* Enable vertical scrolling */
  max-height: 300px;
  /* Limit height for the column list */
  scrollbar-width: thin;
  /* For Firefox */
  scrollbar-color: #ccc #f5f5f5;
  /* For Firefox */
}

/* Webkit Scrollbar (Chrome, Edge, Safari) */
#columnToggleContainer::-webkit-scrollbar {
  width: 8px;
}

#columnToggleContainer::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

#columnToggleContainer::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

#columnToggleContainer::-webkit-scrollbar-track {
  background: #f5f5f5;
}

/* Column Toggle Items */
.column-toggle {
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  /* Prevent text wrapping */
}

.column-toggle:hover {
  background-color: #f5f5f5;
}

/* Category Header */
.category-header {
  font-size: 14px;
  font-weight: bold;
  color: #1f2937;
  /* Dark gray text */
  padding: 6px;
  border-bottom: 2px solid #d1d5db;
  /* Light gray separator */
}

/* Column Toggle Label */
.column-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  /* Prevent text wrapping */
}

/* Checkbox Styling */
.column-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #6b7280;
  border-radius: 50%;
  margin: 0;
  position: relative;
  cursor: pointer;
}

.column-checkbox:checked {
  background-color: #6b7280;
  border-color: #6b7280;
}

.column-checkbox:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
}

/* Optgroup Styling for better visibility */
optgroup {
  font-weight: bold;
  font-size: 13px;
  color: #1f2937;
}

/* Show/Hide Buttons */
.show-hide-btns {
  display: flex;
  justify-content: space-between;
  padding: 6px;
  border-top: 1px solid #e0e0e0;
  background-color: white;
  position: sticky;
  /* Keep it at the bottom */
  bottom: 0;
}

#hideAll,
#showAll,
#default {
  background: none;
  border: none;
  color: #4b5563;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
}

.disabled {
  opacity: 0.4;
  /* Dim the button */
  pointer-events: none;
  /* Prevent clicks/hover/focus */
  cursor: not-allowed;
  /* Show a "no" cursor */
}

#hideAll:hover,
#showAll:hover {
  color: #1f2937;
}

.needs-password {
  font-size: 0.9em;
  color: #c00;
  margin-left: 6px;
  font-weight: bold;
}

/* Table Title Styling */
.table-title {
  flex: 0.9;
  text-align: center;
  align-self: center;
  margin: 0 20px;
}

.table-title h2 {
  margin: 0;
  font-size: 2rem;
  color: #12664f;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}

/* Report Date Styling */
.report-date {
  align-items: center;
  font-size: 1rem;
  color: #4b5563;
}


/* Responsive adjustments */
@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .table-title {
    order: -1;
    margin: 10px 0;
  }
  
  .table-title h2 {
    font-size: 1.2rem;
  }
}
