/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #007acc;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  font-size: 14px;
  font-weight: bold;
  transition: top 0.3s;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.skip-link:focus {
  top: 0;
}

/* Screen reader only content */
.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;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
  background-color: #f9fafb;
  line-height: 1.5;
  display: flex; /* Use flexbox for sticky footer */
  flex-direction: column; /* Stack elements vertically */
  min-height: 100vh; /* Ensure body takes at least full viewport height */
}

.container {
  max-width: 1500px;
  min-width: 1200px;
  width: 95%;
  margin: 0 auto;
  padding: 0 1rem; 
  flex-grow: 1; /* Allow main content to grow */
}

/* Header */ /* seems to be overwritten */
header {
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 0rem 0.5rem 0rem;
  flex-shrink: 0; /* Prevent header from shrinking */
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;

  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.logo {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.utility-container {
  display: flex;
  flex-direction: row;
  align-items: center;

  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.redirect-logo {
  display: flex;
  cursor: pointer;
  height: 50px;
  margin-right: 0.5rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.redirect-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.title {
  font-size: 1.5rem !important; 
  font-weight: bold !important;
  color: #1f2937 !important;
}

.help-dropdown {
  position: relative;
}

.help-button {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border-left: 1.5px solid black !important;
  background-color: white !important;
  cursor: pointer;
  border: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1f2937;
  transition: all 0.2s ease;
}

.help-button:hover {
  background-color: #f3f4f6;
  border-color: #6b7280;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.help-icon {
  width: 16px;
  height: 16px;
}

.help-dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  margin-top: 1rem;
  width: 320px;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
  display: none;
}

.help-dropdown-content.show {
  display: block;
}

.help-content {
  padding: 1rem;
}

.help-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #d1d5db;
}

.help-section-item {
  margin-bottom: 1rem;
}

.help-section-item:last-child {
  margin-bottom: 0;
}

.help-section-item h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.help-section-item p {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.help-section-item a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.help-section-item a:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Welcome Section */
.welcome-section {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.welcome-title {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  margin-bottom: 0.5rem !important;
}

.welcome-text {
  color: #4b5563 !important;
  white-space: pre-line !important;
}

/* Filters and Search */
.filter-section {
  position: relative;
  background-color: #f9fafb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

fieldset.filter-section {
  margin-bottom: 0;
}

.filter-options-container {
  background-color: white;
  height: 125px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
}

.filter-grid {
  max-width: 95%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .filter-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }
}

.filter-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

/* Legacy dropdown styles - kept for help dropdown and modal compatibility */
.filter-dropdown {
  position: relative;
}

.dropdown-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  cursor: pointer;
  text-align: left;
  font-size: 0.875rem;
}

.dropdown-button-compact {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}

.dropdown-button.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.dropdown-icon {
  width: 16px;
  height: 16px;
}

.dropdown-content {
  position: absolute;
  z-index: 10;
  margin-top: 0.25rem;
  width: 100%;
  background-color: white;
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  max-height: 15rem;
  overflow-y: auto;
  display: none;
}

.dropdown-content.show {
  display: block;
}

.dropdown-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.dropdown-item:hover {
  background-color: #f3f4f6;
}

/* New accessible select styles */
.filter-select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.filter-select {
  width: 100%;
  padding: 0.4rem 2rem 0.4rem 0.6rem; /* Right padding for arrow */
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  font-size: 0.8rem;
  font-family: inherit;
  color: #333;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.filter-select:focus-visible {
  outline: 2px solid #007acc;
  outline-offset: 2px;
  border-color: #007acc;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .filter-select {
    border-width: 2px;
  }
  
  .filter-select:focus-visible {
    outline-width: 3px;
  }
}

/* Windows High Contrast Mode support */
@media (forced-colors: active) {
  .filter-select {
    border: 1px solid ButtonText;
    background-color: Field;
    color: FieldText;
  }
  
  .filter-select:focus-visible {
    outline: 2px solid Highlight;
  }
  
  .filter-select:disabled {
    border-color: GrayText;
    background-color: Field;
    color: GrayText;
  }
  
  .select-arrow {
    color: ButtonText;
  }
}

.filter-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f9fafb;
}

.filter-select:hover:not(:disabled) {
  border-color: #9ca3af;
}

.select-arrow {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #6b7280;
  pointer-events: none; /* Allow clicks to pass through to select */
}

/* For browsers that support :has() */
@supports selector(:has(*)) {
  .filter-select-wrapper:has(.filter-select:disabled) .select-arrow {
    opacity: 0.6;
  }
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(*)) {
  .filter-select:disabled + .select-arrow {
    opacity: 0.6;
  }
}

.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem !important;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.search-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f9fafb;
}

.search-icon {
  position: absolute;
  cursor: pointer;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #9ca3af;
}
.search-icon:hover {
  color: #608bd1;
}

.copy-section {
  position: absolute;
  right: 20px;
  top: 0;
  bottom: 0;
  height: 100%;
  padding-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 40px;
  height: 36px;
}

.copy-button:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.copy-button:active {
  background-color: #e5e7eb;
}

.copy-icon {
  width: 16px;
  height: 16px;
  color: #6b7280;
}

/* Results Count & Pagination Container */
.results-pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem; /* Space below this combined row */
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 0.5rem; /* Add gap for wrapping */
}

.results-count {
  font-size: 0.875rem;
  color: #6b7280;
  /* Removed margin-bottom */
}

/* Item Grid */
.item-grid {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative; /* Add position relative for loading overlay */
}

/* Item Grid Loading Overlay */
.item-grid-loading-overlay {
  position: absolute;
  top: -60px; /* Move up 60px to be closer to filters */
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* Align to top instead of center */
  padding-top: 80px; /* Add padding to position spinner nicely */
  z-index: 10;
  border-radius: 8px;
}

.item-grid-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.item-grid-loading-text {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.table-container {
  overflow-x: auto;
}

table {
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* Ensure columns keep their width */
}

thead {
  background-color: #f9fafb;
}

th {
  padding: 0.75rem 0rem 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap; /* Prevent header text wrapping */
}

td {
  padding: 1rem 1rem;
  font-size: 0.875rem;
  border-top: 1px solid #e5e7eb;
  vertical-align: middle; /* Align cell content vertically */
}

tr:hover {
  background-color: #e9ecef;
}

.item-id {
  font-weight: 500;
}

.item-id-link {
  color: #1d4ed8; /* Darker blue for better contrast (4.5:1 ratio) */
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  display: inline;
}

.item-id-link:hover {
  text-decoration: underline;
}

.item-id-link:focus-visible {
  outline: 2px solid #1d4ed8; /* Update focus outline to match */
  outline-offset: 2px;
  border-radius: 2px;
}

.item-actions {
  color: #144bb8;
  cursor: pointer;
}

.action-preview-button {
  background: none;
  border: none;
  padding: 4px;
  margin-left: 20%;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.action-preview-button:hover {
  background-color: rgba(20, 75, 184, 0.1);
}

.action-preview-button:focus-visible {
  outline: 2px solid #144bb8;
  outline-offset: 2px;
}

.even-item-row {
  background-color: #f8f9fa;
}

td.item-year,
td.item-number,
td.item-type,
td.item-category {
  color: black;
}

.item-year,
.item-number,
.item-type,
.item-category {
  color: #6b7280;
}

th.item-id {
  width: 11%;
}
th.item-year {
  width: 7%;
}
th.item-number {
  width: 7%;
}
th.item-type {
  width: 8%;
}
th.item-description {
  width: 30%;
}

th.item-category {
  width: 12%;
}

th.item-science-practice-category {
  width: 7%;
}

th.item-header.item-science-practice-category .header-text {
  flex-shrink: 1;
}

th.item-header.item-science-practice-category .header-content {
  white-space: normal;
}

td.item-category {
  min-width: 200px;
}


th.item-header {
  min-width: 100px;
  position: relative;
  cursor: default;
}

/* Only sortable columns should have pointer cursor */
th.item-header:not([data-sortable="false"]) {
  cursor: pointer;
}

/* Header button styles */
.header-sort-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  position: relative;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-filter-button {
  background: none;
  border: none;
  padding: 2px;
  margin: 0;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  border-radius: 2px;
  color: #6b7280;
}

.header-filter-button:focus-visible {
  outline: 2px solid #007acc;
  outline-offset: 2px;
  opacity: 1;
}

/* Focus styles for all interactive elements */
button:focus-visible,
.pagination-button:focus-visible,
.filter-button:focus-visible,
.copy-button:focus-visible,
.help-button:focus-visible,
.header-sort-button:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.search-icon:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
  border-radius: 2px;
}

th.item-header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  white-space: nowrap;
  position: relative;
}

th.item-header .header-text {
  flex-shrink: 0;
}

th.item-header .header-icons {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  opacity: 1;
  flex-grow: 1;
  justify-content: flex-start;
}

th.item-header .header-icon {
  color: #6b7280;
  flex-shrink: 0;
  cursor: pointer;
}

/* Show filter buttons on hover or focus */
th.item-header:hover .header-filter-button,
.header-filter-button:focus {
  opacity: 1;
}

th.item-header .sort-icon {
  margin-top: 2px;
  fill: #0066cc;
  opacity: 1;
}

th.item-header .sort-icon.hidden {
  display: none;
}


/* Individual icon hover effects */
th.item-header .header-icon.filter-icon:hover {
  color: #374151;
}

.item-description {
  max-width: 24rem;
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center; /* Center within its flex item space */
  align-items: center;
  padding: 0; /* Removed padding */
  margin: 0; /* Removed margin */
}

.pagination-button {
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border: 1px solid #d1d5db;
  background-color: white;
  color: #374151;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.pagination-button:disabled {
  color: #4b5563; /* Better contrast for disabled state (was #9ca3af) */
  cursor: not-allowed;
  background-color: #f9fafb;
}

.pagination-button.active {
  background-color: #007acc; /* Darker blue background for better contrast with white text */
  color: white;
  border-color: #007acc;
  font-weight: 600;
}

/* Modal */

.dil-modal-iframe {
  width: 100%;
  height: 100%;
  max-width: 1045px;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dil-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
  display: none; /* Initially hidden */
}

#globalLoadingSpinner {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Footnote Section */
.footnote-section {
  margin: 1.5rem 0rem 1.5rem -0.5rem;
  padding: 1rem 1.5rem;
  background-color: #f9fafb;
  border-left: 4px solid #e5e7eb;
  border-radius: 0 0.375rem 0.375rem 0;
}

.footnote-text {
  font-size: 0.875rem;
  color: #4b5563; /* Darker gray for better contrast (was #6b7280) */
  margin: 0;
  line-height: 1.5;
}

.footnote-text strong {
  color: #374151;
  font-weight: 600;
}

/* Footer */
footer {
  background-color: #f3f4f6;
  border-top: 1px solid #e5e7eb;
  text-align: justify;
  font-size: 0.875rem;
  color: black;
  margin-top: auto;
  flex-shrink: 0;
  justify-items: center;
}

.global-loading-spinner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  z-index: 1001;
}

.button-spinner {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.copyright,
.contact-terms-privacy
{
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.digital-item-library-footer
{
    position:relative;
    top:10px;
    right: auto;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

/* Filter Modal Styles */
.results-count-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #007acc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-count {
  display: none; 
  padding-left: 0.5rem; 
  font-weight: normal;
  color: white;
  border-left: 2px solid black;
}

.filter-button:hover {
    background: #005a9e;
}

.filter-button .filter-icon {
    width: 16px;
    height: 16px;
}

.filter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.filter-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.filter-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.filter-modal-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 0;
}

.filter-modal-close:hover {
  color: #4b5563;
}

.filter-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.filter-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.filter-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

fieldset>legend {
    font-weight: bold;
    color: black;
    padding: 0 5px;
}

.filter-input-container {
    position: relative;
}

.filter-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-input:focus-visible {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.1);
}

.filter-multiselect {
    position: relative;
}

.multiselect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.multiselect-header:hover {
    border-color: #9ca3af;
}

.multiselect-placeholder {
    font-size: 0.875rem;
    color: #6b7280;
    flex: 1;
}

.multiselect-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.multiselect-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.multiselect-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.multiselect-item:last-child {
    border-bottom: none;
}

.multiselect-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.multiselect-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #007acc;
}

.multiselect-item:hover {
    background: #f9fafb;
}

.filter-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.filter-reset-button {
    padding: 0.5rem 1rem;
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-reset-button:hover {
    background: #f3f4f6;
    color: #374151;
}

.filter-action-buttons {
    display: flex;
    gap: 0.75rem;
}

.filter-cancel-button {
    padding: 0.5rem 1rem;
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-cancel-button:hover {
    background: #f3f4f6;
    color: #374151;
}

.filter-apply-button {
    padding: 0.5rem 1rem;
    background: #007acc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-apply-button:hover {
    background: #005a9e;
}

.filter-apply-button:disabled {
    background: #6b7280;
    cursor: not-allowed;
}

.button-text {
    display: inline-block;
}

@media (max-width: 768px) {
    .filter-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .results-count-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Filter section highlight effect */
.filter-section-highlight {
    background-color: rgba(59, 130, 246, 0.1) !important;
    transition: background-color 0.3s ease;
}

.filter-input-container.filter-section-highlight {
    background-color: rgba(59, 130, 246, 0.05) !important;
}

.filter-options-container.filter-section-highlight {
    background-color: rgba(59, 130, 246, 0.05) !important;
}

.standard-name {
    color: #1d4ed8; /* Darker blue for better contrast (4.5:1 ratio) */
    cursor: pointer;
    text-decoration: none;
    border-radius: 3px;
    padding: 1px 2px;
    transition: background-color 0.2s;
    font-weight: 500;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    display: inline;
}

.standard-name:hover {
    background-color: #f0f8ff;
}

.standard-name:focus-visible {
    outline: 2px solid #1d4ed8; /* Update focus outline to match */
    outline-offset: 1px;
}

.standards-popup {
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    max-width: 400px;
    z-index: 1000;
    font-size: 14px;
    line-height: 1.4;
    display: none;
}

.standards-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.standards-popup-title {
    font-weight: bold;
    color: #333;
    margin: 0;
}

.standards-popup-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 4px;
    margin-left: 8px;
    border-radius: 4px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.standards-popup-close:hover {
    color: #333;
    background-color: #f0f0f0;
}

.standards-popup-close:focus-visible {
    outline: 2px solid #007acc;
    outline-offset: 2px;
    color: #333;
    background-color: #f0f0f0;
}

.standards-popup-description {
    color: #555;
    max-height: 70vh;
    overflow-y: auto;
    margin: 0;
}

.standards-popup-description p {
    margin: 8px 0;
    line-height: 1.5;
}

.standards-popup-description p:first-child {
    margin-top: 0;
}

.standards-popup-description p:last-child {
    margin-bottom: 0;
}

.standards-popup-description ul {
    margin: 12px 0;
    padding-left: 20px;
}

.standards-popup-description li {
    margin: 4px 0;
    line-height: 1.4;
}

.standards-popup-description li:first-child {
    margin-top: 0;
}

.standards-popup-description li:last-child {
    margin-bottom: 0;
}

/* Add spacing between paragraphs and lists */
.standards-popup-description p + ul,
.standards-popup-description ul + p {
    margin-top: 12px;
}

.standards-popup-description ul {
    margin: 8px 0;
    padding-left: 20px;
}

.standards-popup-description li {
    margin: 4px 0;
    line-height: 1.4;
}

.standards-popup-description li:first-child {
    margin-top: 0;
}

.standards-popup-description li:last-child {
    margin-bottom: 0;
}

/* Error messaging styles */
.error-container {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 4px;
    padding: 12px;
    margin: 16px 0;
}

.error-content {
    font-weight: bold;
}

/* Modal scroll prevention */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}