.img-fluid {
  width: 100%;
  height: auto;
  margin-bottom: 20px;
}

a {
  color: #007bff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

a:hover {
  color: #0056b3;
  border-bottom: 1px solid #0056b3;
  text-decoration: none;
}

.table-wrapper {
  max-height: 1000px;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
}

.table-wrapper .table-scroll th {
  position: sticky;
  top: 0;
  background: var(--bs-body-bg, #fff);
  z-index: 2;
  border-top: 1px solid #dee2e6;
}

.table-scroll td:first-child,
.table-scroll th:first-child {
  position: sticky;
  left: 0;
  border-right: 1px solid #dee2e6;
  box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.1);
}

.table-scroll td:first-child {
  z-index: 1;
  background-color: var(--bs-table-bg, #fff);
}

.table-scroll th:first-child {
  z-index: 3;
  background-color: var(--bs-body-bg, #fff);
}

.table.table-striped tbody tr:nth-of-type(odd) td:first-child {
  background-color: var(--bs-table-striped-bg);
}

.scroll-indicator {
  display: none;
  text-align: right;
  padding-right: 15px;
  color: #6c757d;
  font-size: 0.875em;
  margin-bottom: 5px;
}

@media (max-width: 767px) {
  .table-wrapper {
    table-layout: fixed;
  }

  .table-scroll thead {
    display: none;
  }

  .table-scroll tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 0.5rem;
  }

  .table-scroll td {
    display: block;
    padding: 0.25rem 0;
    border: none;
  }

  .table-scroll td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-weight: bold;
    margin-bottom: 0.25rem;
  }

  #clearAll {
    width: 100%;
  }

}

.feedback-section {
  margin-top: 40px;
  padding: 20px;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  background-color: #f8f9fa;
}

.feedback-section h2 {
  margin-bottom: 20px;
  color: #007bff;
}


.feedback-section .mb-3 {
  margin-bottom: 15px;
}

.feedback-section .form-control {
  border-radius: 5px;
  border: 1px solid #ced4da;
}

.feedback-section .btn-primary {
  background-color: #007bff;
  border-color: #007bff;
}

.feedback-section .btn-primary:hover {
  background-color: #0056b3;
  border-color: #0056b3;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 8px;
  background: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sort-icon {
  margin-left: 4px;
}

.th-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.th-button:focus {
  outline: 2px solid #0056b3;
  outline-offset: 2px;
}

.last-updated {
  font-size: 0.875em;
  color: #6c757d;
}

#feedbackStatus {
  margin-top: 10px;
}

#feedbackStatus.success {
  color: #155724;
  background-color: #d4edda;
  padding: 0.5rem;
  border-radius: 0.25rem;
}

#feedbackStatus.error {
  color: #721c24;
  background-color: #f8d7da;
  padding: 0.5rem;
  border-radius: 0.25rem;
}

.no-results td {
  text-align: center;
  color: #6c757d;
}

.clamp-text {
  display: block;
}

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-toggle {
  padding: 0;
}

.btn-check:checked + .btn {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.badge-yes {
  background-color: #198754;
  color: #fff !important;
}

.badge-no {
  background-color: #dc3545;
  color: #fff !important;
}

.badge-varies {
  background-color: #ffc107;
  color: #212529 !important;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #f8f9fa;
    --bs-body-bg: #121212;
    --bs-body-color: #f8f9fa;
  }
  a {
    color: #9ecbff;
  }
  a:hover {
    color: #c0e0ff;
    border-bottom-color: #c0e0ff;
  }
  .text-muted {
    color: #adb5bd !important;
  }
  .table {
    --bs-table-bg: #1e1e1e;
    --bs-table-color: #f8f9fa;
    --bs-table-border-color: #444;
    --bs-table-striped-bg: #2a2a2a;
    --bs-table-striped-color: #f8f9fa;
  }
  .table-scroll th {
    background-color: #1e1e1e;
    border-color: #444;
    color: #f8f9fa;
  }
  .table-scroll td,
  .table-scroll th {
    border-color: #444;
  }
  .table-scroll tr {
    border-color: #444;
  }
  .feedback-section {
    background-color: #1e1e1e;
    border-color: #444;
  }
  ::placeholder {
    color: #ced4da;
  }
}

body.theme-dark {
  background-color: #121212;
  color: #f8f9fa;
  --bs-body-bg: #121212;
  --bs-body-color: #f8f9fa;
  color-scheme: dark;
}
body.theme-dark a {
  color: #9ecbff;
}
body.theme-dark a:hover {
  color: #c0e0ff;
  border-bottom-color: #c0e0ff;
}
body.theme-dark .table {
  --bs-table-bg: #1e1e1e;
  --bs-table-color: #f8f9fa;
  --bs-table-border-color: #444;
  --bs-table-striped-bg: #2a2a2a;
  --bs-table-striped-color: #f8f9fa;
}
body.theme-dark .table-scroll th {
  background-color: #1e1e1e;
  border-color: #444;
  color: #f8f9fa;
}
body.theme-dark .table-scroll td,
body.theme-dark .table-scroll th {
  border-color: #444;
}
body.theme-dark .table-scroll tr {
  border-color: #444;
}
body.theme-dark .feedback-section {
  background-color: #1e1e1e;
  border-color: #444;
}
body.theme-dark ::placeholder {
  color: #ced4da;
}
body.theme-dark .text-muted {
  color: #adb5bd !important;
}

body.theme-light {
  background-color: #ffffff;
  color: #212529;
  --bs-body-bg: #ffffff;
  --bs-body-color: #212529;
  color-scheme: light;
}
body.theme-light a {
  color: #007bff;
}
body.theme-light a:hover {
  color: #0056b3;
  border-bottom-color: #0056b3;
}
body.theme-light .table {
  --bs-table-bg: #ffffff;
  --bs-table-color: #212529;
  --bs-table-border-color: #dee2e6;
  --bs-table-striped-bg: rgba(0, 0, 0, 0.05);
  --bs-table-striped-color: #212529;
}
body.theme-light .table-scroll th {
  background-color: #ffffff;
  border-color: #dee2e6;
  color: inherit;
}
body.theme-light .table-scroll td,
body.theme-light .table-scroll th {
  border-color: #dee2e6;
}
body.theme-light .table-scroll tr {
  border-color: #dee2e6;
}
body.theme-light .feedback-section {
  background-color: #f8f9fa;
  border-color: #dee2e6;
}
