/**
 * Open Bids and Surplus Sales Styles
 * WCAG 2.1 AA Compliant - All colors meet minimum contrast ratios
 */

/* Results container */
#ob-results {
  margin-top: 2rem;
}

/* Status messages (screen reader announcements) */
#ob-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* No results message */
.ob-no-results {
  padding: 2rem 1rem;
  text-align: center;
  color: #565c65; /* 7.48:1 contrast - AAA */
  font-style: italic;
}

/* Error message */
.ob-error {
  padding: 1rem;
  background-color: #fff0f0;
  border: 2px solid #b50909; /* Darker red for 4.5:1 contrast */
  border-radius: 4px;
  color: #b50909; /* 4.54:1 contrast - AA compliant */
  font-weight: bold;
}

/* Table styles */
.jcc-ob-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #71767a; /* Darker border for 3:1 contrast */
  margin-top: 1rem;
  margin-bottom: 2rem;
  background-color: #ffffff;
}

/* Visually hidden table caption */
.jcc-ob-table-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Table headers */
.jcc-ob-table thead {
  background-color: #162e51 !important; /* Darker blue for better contrast */
}

.jcc-ob-table th {
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: bold;
  color: #ffffff !important; /* 14.37:1 contrast - AAA */
  background-color: #162e51 !important; /* Force dark background */
  border-bottom: 2px solid #71767a;
}

/* Table body */
.jcc-ob-table tbody tr {
  border-bottom: 1px solid #71767a; /* 3:1 contrast */
}

.jcc-ob-table tbody tr:hover {
  background-color: #e7f2f8; /* Light blue hover with good contrast */
}

.jcc-ob-table td {
  padding: 1rem 0.75rem;
  vertical-align: top;
  color: #1b1b1b; /* Nearly black for maximum contrast */
}

/* Links in table */
.jcc-ob-table a.jcc-ob-link {
  color: #005ea2; /* 8.59:1 contrast - AAA */
  text-decoration: underline;
  text-underline-offset: 0.2em;
  font-weight: 500; /* Medium weight for better visibility */
}

.jcc-ob-table a.jcc-ob-link:hover {
  color: #1b2b85; /* 11.16:1 contrast - AAA */
  text-decoration-thickness: 2px;
  background-color: #e7f2f8;
  outline: 2px solid transparent; /* For Windows High Contrast */
}

.jcc-ob-table a.jcc-ob-link:focus {
  outline: 3px solid #005ea2;
  outline-offset: 3px;
  background-color: #fce8b2; /* Yellow highlight for focus */
}

.jcc-ob-table a.jcc-ob-link:visited {
  color: #54278f; /* 6.5:1 contrast - AAA */
}

/* File download button - styled as link */
.jcc-ob-file-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #005ea2; /* 8.59:1 contrast - AAA */
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
}

.jcc-ob-file-link:hover {
  color: #1b2b85; /* 11.16:1 contrast - AAA */
  text-decoration-thickness: 2px;
  background-color: #e7f2f8;
  outline: 2px solid transparent;
}

.jcc-ob-file-link:focus {
  outline: 3px solid #005ea2;
  outline-offset: 3px;
  background-color: #fce8b2;
}

.jcc-ob-file-link:visited {
  color: #54278f; /* 6.5:1 contrast - AAA */
}

/* Ensure adequate spacing for touch targets (44x44px minimum) */
.jcc-ob-table a,
.jcc-ob-table button {
  display: inline-block;
  min-height: 44px;
  line-height: 1.5;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Responsive design */
@media screen and (max-width: 768px) {
  .jcc-ob-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .jcc-ob-table th,
  .jcc-ob-table td {
    padding: 0.75rem 0.5rem;
  }
}

@media screen and (max-width: 640px) {
  .jcc-ob-table th,
  .jcc-ob-table td {
    padding: 0.5rem 0.375rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .jcc-ob-table {
    border-width: 2px;
    border-color: currentColor;
  }

  .jcc-ob-table th,
  .jcc-ob-table td {
    border: 2px solid currentColor;
  }

  .jcc-ob-table a.jcc-ob-link:focus,
  .jcc-ob-file-link:focus {
    outline-width: 4px;
    outline-color: currentColor;
  }

  .jcc-ob-table tbody tr:hover {
    background-color: transparent;
    outline: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .jcc-ob-table tbody tr,
  .jcc-ob-table a.jcc-ob-link,
  .jcc-ob-file-link {
    transition: none;
  }
}

/* Print styles */
@media print {
  .jcc-ob-table {
    border: 1px solid #000;
  }

  .jcc-ob-table thead {
    background-color: #fff;
    border-bottom: 2px solid #000;
  }

  .jcc-ob-table th {
    color: #000;
    border: 1px solid #000;
  }

  .jcc-ob-table td {
    border: 1px solid #000;
    color: #000;
  }

  .jcc-ob-table tbody tr:hover {
    background-color: transparent;
  }

  /* Hide download forms in print */
  .jcc-ob-table form {
    display: none;
  }

  /* Show filename text instead of button */
  .jcc-ob-file-link::after {
    content: " (Download)";
  }
}

/* Focus trap prevention */
.jcc-ob-table:focus {
  outline: none;
}

/* Ensure links are underlined in all states for accessibility */
.jcc-ob-table a {
  text-decoration: underline;
}

/* Bids content wrapper */
.ob-wrapper {
  margin-top: 1.5rem;
}

/* Section heading */
.ob-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1b2b85; /* Matches JCC heading color - 8.36:1 contrast */
  margin-bottom: 1rem;
  border-bottom: 2px solid #dfe1e2;
  padding-bottom: 0.5rem;
}
