/* General Reset and Base Styles */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-size: 10pt;
    font-family: 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 0.9;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: subpixel-antialiased;
    overflow-x: hidden;
}

.nav-item{
  line-height: 1.2;
}

select,
input {
  font-size: 10pt;
}

#main-content {
  width: 90%;
  margin: 10px auto;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.99);
  box-sizing: border-box;
  max-width: 1800px;
}

.visualization-title {
  margin: 0.3em 0;
}

p {
  margin: 0.15em 0;
}

/* Table Container */
.table-container {
    /* Remove or comment these out:
  flex-grow: 1;
  height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  */
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px; /* optional spacing below table */
}

/* Main Table */
.main-table {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: auto;
}

table {
  width: 100%;
  margin-top: 5px;
  font-size: 9pt;
}

/* Table Headers and Cells */
th,td {
  padding: 2.5px;
  padding-right: 15px; /* Add padding to the right for vertical dots */
  text-align: left;
  border: 1px solid #CDCDCD;
  /* white-space: nowrap; */
}

td {
  white-space: nowrap;
}

th {
  background-color: #e6eeee;
  font-weight: bold;
  position: sticky;
  top: 0.1em;
  z-index: 2; /* Ensure headers are above other elements */
  line-height: 1.1;
  border: 1px solid #4a6ea9 !important;
  background-clip: padding-box; /* Prevent background from overflowing border */
}

td {
  border-right: 1px solid #ddd;
}

th:last-child,
td:last-child {
  border-right: none;
}

/* Hover and Alternating Row Styles */
tr:nth-child(even) {
  background-color: rgba(242, 242, 242, 0.7);
}

tr:hover {
  background-color: #eef7ff;
  color: #663399; /* Text color similar to previous project */
}

.th-top {
  background-color: white !important;
  color: #4a6ea9 !important;
  text-transform: uppercase !important;
  font-weight: bold !important;
  padding: 2px !important;
  text-align: center !important;
  line-height: 1 !important;
}

/* Flood Tool link icon */
.blra_ft {
  max-width: 20px;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  margin: 0 auto; /* Centers the image horizontally */
}

.blra_ft:hover {
  transform: scale(1.2);
}

/* Sorting styles */
th.th-sortable {
  background-image: url(bg.gif);
  background-repeat: no-repeat;
  background-position: center right;
  cursor: pointer;
  /* position: relative; Allow positioning of child elements */
  padding-right: 20px; /* Adjust padding to accommodate the filter button */
}

th.th-sortable:hover {
  background-color: #8dbdd8;
}

/* Ascending order arrow */
th.th-sort-asc {
  background-image: url(desc.gif);
}

/* Descending order arrow */
th.th-sort-desc {
  background-image: url(asc.gif); 
}

th.th-sort-asc,
th.th-sort-desc {
  background-color: #ffcc66 !important;
}

/* Filter Styles */
.filter-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 9pt;
  color: #555;
  padding: 3px;
  transition: color 0.3s;
  position: absolute;
  right: 15px;
  top: 30%;
}

/* Header dropdown container */
.header-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  background-color: #fff;
  border: 1px solid #ccc;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  width: 200px;
  padding: 5px;
}

/* Show dropdown when visible class is added */
.header-dropdown.visible {
  display: block;
}

/* Disabled sorting option */
.header-dropdown .dropdown-option.disabled {
  pointer-events: none;
  color: #ccc;
  cursor: not-allowed;
}

/* Dropdown option */
.dropdown-option {
  padding: 8px 10px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dropdown-option:hover {
  background-color: #f1f1f1;
}

/* Divider between sort and filter options */
.dropdown-divider {
  height: 1px;
  background-color: #ccc;
  margin: 8px 0;
}

/* Placeholder for filter options */
.dropdown-placeholder {
  padding: 10px;
  color: #888;
  text-align: center;
  font-size: 14px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
}

.rows-per-page {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Button Styles */
button {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  font-size: 10pt;
  font-weight: bold;
}

button:hover,
.controls .metadata-btn:hover {
  background-color: #005ea2;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Responsive Adjustments */
@media screen and (max-width: 1200px) {
  .form-group {
    flex: 1 1 calc(50% - 15px);
    max-width: calc(50% - 15px);
  }
  /* .main-table table {
    font-size: 12px;
  } */
}

@media screen and (max-width: 768px) {
  .form-group {
    flex: 1 1 calc(100% - 10px);
    max-width: 100%;
  }

  #main-content {
    width: 95%;
    padding: 10px;
  }

  select,
  input {
    font-size: 9px;
  }
}

@media screen and (max-width: 480px) {
  .form-group {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .button-group {
    flex-direction: column;
  }

  .search-btn,
  .reset-btn {
    width: 100%;
  }
}
