/* Variables */
:root {
  --primary: #1e40af;
  --primary-light: #2563eb;
  
  --border: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #6b7280;
}

/* Base Styles */
html {
  scrollbar-gutter: stable;
}

body {
  background-color: #fefefe;
  font-family: "Fira Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

hr {
  color: #a0a0a0;
}

.hover-underline:hover {
  text-decoration: underline !important;
}

/* Bootstrap Overrides */
.btn {
  font-weight: 500;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-light);
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}

.site-header {
  background-color: #fbfbfb;
  /* border-bottom: 1px solid var(--border); */
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); */
}

.navbar {
  /* background-color: var(--surface); */
  padding: 0;
  min-height: 80px;
  position: relative;
}

.navbar .container {
  display: flex;
  align-items: center;
}

.navbar-brand {
  /* padding: 1rem 0; */
  margin-right: 3rem;
}

.navbar-logo {
  height: 100px;
  width: auto;
  max-width: none;
  object-fit: contain;
}

@media (max-width: 767.98px) {
  .navbar-logo {
    height: 58px;
  }
}

.navbar-collapse {
  display: flex;
  align-items: center;
}

.navbar-nav {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.2s ease;
}

/* Style dropdown toggle arrow separately from underline */
.dropdown .nav-link::after {
  display: none; /* Hide the default underline effect */
}

.dropdown .nav-link {
  padding-right: 1.5rem; /* Make space for the dropdown arrow */
}

/* Add a separate pseudo-element for the dropdown arrow */
.dropdown .nav-link::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.2s ease;
  opacity: 0;
}

/* Show and animate underline on hover */
.dropdown .nav-link:hover::before {
  width: calc(100%); /* Extend underline further */
  opacity: 1;
}

.nav-link:hover {
  color: var(--text-primary);
  background: none;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: var(--primary);
  background: none;
}

.nav-link.active::after {
  width: 100%;
}

/* Don't show underline for active dropdown */
.dropdown .nav-link.active::after {
  display: none;
}

.dropdown .nav-link.active::before {
  width: 0;
  opacity: 0;
}

/* Show underline on hover even when active */
.dropdown .nav-link.active:hover::before {
  width: calc(100%); /* Match the hover state width */
  opacity: 1;
}

.nav-link i {
  font-size: 0.75rem;
}

.nav-link-text {
  position: relative;
}

@media (max-width: 767.98px) {
  .navbar {
    padding: 0.5rem 0;
  }
  
  .navbar-collapse {
    /* position: absolute; */
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--surface);
    padding: 1rem;
    border-top: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 1000;
  }

  .navbar-nav {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
}

@media (max-width: 767.98px) {
  .nav-item .fa-question-circle {
    padding-left: 0.5rem !important;
  }
}

/* Navbar Dropdown */
.navbar .dropdown-menu {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 0.5rem 0;
}

.navbar .dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar .dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary);
}

/* Navbar Mobile Toggle */
.navbar-toggler {
  padding: 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
  background-color: transparent;
  border: none;
  border-radius: 0.25rem;
  color: var(--text-primary);
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

.breadcrumb {
  margin: 0;
  padding: 0;
  font-size: 0.625rem;
}

.breadcrumb-item a {
  color: var(--text-secondary);
  text-decoration: none;
}

/* Search Component */
.search-container {
  margin-bottom: 2rem;
}

.search-container .input-group {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.search-container .form-control {
  border: none !important;
  height: 36px !important;
  padding: 0 1rem !important;
  font-size: 0.75rem;
  box-shadow: none !important;
}

.search-filter-container span {
  color: black;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.search-filter-container span:hover {
  color: white !important;
  background-color: var(--primary) !important;
}

.search-filter-active {
  color: white !important;
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  font-weight: 600;
}

/* Table Component */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 2px;
}

table th:last-child,
table td:last-child {
  width: auto;
}

thead {
  border-radius: 0;
  background-color: #6b7280;
  color: white;
}

thead a {
  color: white;
  text-decoration: none;
}
thead a:hover {
  color: white;
  text-decoration: underline;
}

thead th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  padding: 1rem;
}

thead tr {
  border: none;
  box-shadow: none;
}

thead th:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

thead th:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

tbody tr {
  background-color: #f6f6f7;
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.15s ease-in-out;
}

tbody tr:hover {
  background-color: #e2e8f0 !important;
}

td {
  padding: 0.75rem 1rem;
}

td:first-child a {
  color: #1a237e;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
}

td:first-child a::after {
  content: "📄";
  margin-left: 0.5rem;
  font-size: 0.9em;
} */

/* Pagination Component */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;  /* Remove the top/bottom margin since it's handled by container */
}

.pagination li {
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.15s;
}

.pagination a:hover {
  background-color: #f3f4f6;
  border-color: var(--border);
  text-decoration: none;
}

.pagination li.active {
  background-color: var(--primary);
  color: white;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.pagination li.active a {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

.pagination .disabled span {
  background-color: #f3f4f6;
  color: var(--text-secondary);
  cursor: not-allowed;
}

.pagination .cardinality {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin: 0 0.5rem;
}

/* Utilities */
.details-arrow {
  display: inline-block;
  opacity: 0;
  transition: all 0.2s ease-in-out;
  margin-left: 0.5rem;
}

tr:hover .details-arrow {
  opacity: 1;
  transform: translateX(4px);
}

.details-arrow:hover {
  transform: translateX(8px);
}

/* Alerts */

/* Dropdowns */
.dropdown-toggle {
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
}

/* Focus States */
button:focus,
input:focus {
  outline: none;
  box-shadow: none;
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Layout */
.container {
  /* max-width: 1024px; */
  margin: 0 auto;
}

/* Footer */
.footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
}

main {
  min-height: calc(100vh - 60px - 100px - 200px);
}

/* Utilities */
.letter-btn {
  width: 32px;
}

.arrow-icon {
  transition: transform 0.2s ease-in-out;
}

.arrow-icon.rotated {
  transform: rotate(180deg);
}

/* Test Details */
.test-details {
  background-color: #f8f9fa;
  padding: 1rem;
}

.detail-section {
  margin-bottom: 1rem;
  /* display: flex; */
  align-items: center;
  gap: 1rem;
}

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

.detail-section h6 {
  font-size: 0.625rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.detail-section p, .detail-section ul, .detail-section ol, .detail-section li, .detail-section a, .detail-section span {
  font-size: 0.75rem;
  color: var(--text-primary);
  margin: 0;
}

.actions-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* Favorite button styles */
.favorite-btn {
    transition: all 0.2s ease-in-out;
}

.favorite-btn i {
    color: #ffc107;
}

.favorite-btn.btn-primary i {
    color: #fff;
}

.favorite-btn:hover {
    transform: scale(1.05);
}

/* Favorite button styles */
.favorite-btn-icon {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.favorite-btn-icon i {
    color: #d1d5db;
    transition: color 0.2s ease-in-out;
}

.favorite-btn-icon:hover i {
    color: #ffc107;
}

.favorite-btn-icon.active i {
    color: #ffc107;
}

.favorite-btn-icon:hover {
    transform: scale(1.2);
}

/* Alpha Search */
.alpha-search-container {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.alpha-search {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

@media (max-width: 767px) {
  .alpha-search {
    display: flex !important;
    flex-wrap: nowrap !important;
    padding-bottom: 0.5rem;
  }
}

.letter-btn {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 0.75rem;
  transition: all 0.15s ease-in-out;
  flex-shrink: 0;
}

.letter-btn:hover {
  color: white;
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

@media (min-width: 768px) {
  .alpha-search {
  a {
    color: white;
  }

  td:first-child a::after {
    display: none;
  }

  /* Hide details column and arrow on mobile */
  td[data-label="Details"],
  .details-arrow,
  .arrow-icon {
    display: none !important;
  }

  /* Align checkboxes to the left on mobile */
  td[data-label="Biopharma"] .text-center,
  td[data-label="Clinical"] .text-center {
    text-align: left !important;
  }

  td[data-label="Biopharma"] .form-check-input,
  td[data-label="Clinical"] .form-check-input {
    margin-left: 0;
  }

  /* Disable dropdown functionality */
  .test-details {
    display: none !important;
  }

  /* Allow clicks only on interactive elements */
  .test-row {
    pointer-events: none;
  }

  .test-row a,
  .test-row button,
  .test-row .favorite-btn-icon,
  .test-row .form-check-input {
    pointer-events: auto;
  }

  /* Requisition table specific styles */
  .requisition-table td {
    padding: 1rem !important;
    background-color: #f8fafc;
    display: flex !important;
    flex-direction: column;
  }

  .requisition-table td:before {
    display: none;
  }

  .requisition-table td:first-child {
    background-color: #f8fafc;
    color: inherit;
    border-bottom: 1px solid #e2e8f0;
  }

  .requisition-table td:first-child a {
    color: inherit;
  }

  .requisition-table span.fw-bold {
    font-size: 1rem;
    color: #1e40af;
    margin-bottom: 0.5rem;
  }

  .requisition-table a {
    color: #1e40af;
    text-decoration: none;
    font-weight: 500;
  }

  .requisition-table a:hover {
    text-decoration: underline;
  }

  .requisition-table .methodology-category {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
  }
}

.form-check-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:checked:focus {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:active {
  filter: brightness(95%);
  background-color: var(--primary-light);
  border-color: var(--primary-light);
}

/* Remove the default padding for lists in the detail content */
.detail-content ul,
.detail-content ol {
  padding-left: .75rem;
}