.banner-image {
  background-image:
    linear-gradient(rgba(2, 36, 84, 0), rgba(2, 36, 84, 0.9)),
    image-set(
      var(--banner-webp) type("image/webp"),
      var(--banner-jpg) type("image/jpeg")
    );
  background-size: cover;
  background-position: center;
}

/* Prevent unpaginated content while the page is still transferring and before JS initializes.
		The body gets(njs-hide) server-side, JS will remove it after pagination are applied. */
body.njs-hide #tableView tbody tr[data-uid],
body.njs-hide #cardGrid > div[data-uid] {
  display: none !important;
}

/* keep the loading label visible when JS hasn't initialized - show spinner + text */
@keyframes nbaq-spin {
  to {
    transform: rotate(360deg);
  }
}

/* spinner (visual) shown via ::before, label via ::after for accessibility when server-side hiding is active */
body.njs-hide #tableBody::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0.75rem auto 0;
  border: 4px solid rgba(75, 85, 99, 0.12);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: nbaq-spin 1s linear infinite;
}

body.njs-hide #tableBody::after {
  content: attr(data-loading-label);
  display: block;
  padding: 0.75rem 1rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #4b5563;
  font-weight: 500;
}

a.link {
  color: #2563ebff;
}

a.link:hover {
  text-decoration: underline;
}

body > header img {
  width: auto !important;
  height: auto !important;
  max-height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.toggle-dir-ltr {
  direction: ltr;
}

@media (min-width: 640px) {
  body > header img {
    max-height: 64px;
  }
}

/* Triangle buttons for first/last page */
.triangle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s;
  width: 36px;
  height: 36px;
  background: #ffffff;
}

.triangle-btn:hover {
  background: #f9fafb;
}

.triangle-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.triangle-btn:disabled {
  background: #f3f4f6;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

.triangle-left,
.triangle-right {
  width: 0;
  height: 0;
}

.triangle-left {
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 10px solid #374151;
}

.triangle-right {
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid #374151;
}

.triangle-btn:disabled .triangle-left {
  border-right-color: #9ca3af;
}

.triangle-btn:disabled .triangle-right {
  border-left-color: #9ca3af;
}

/* Chevron orientation down when closed, up when open */
#toggleAdvanced #advChevron {
  transition: transform 0.2s ease;
}

/* When open, rotate the base down-chevron to point up */
#toggleAdvanced[aria-expanded="true"] #advChevron {
  transform: rotate(180deg);
}

/* Decisions-like inputs coloring */
#filtersBox input[type="text"],
#filtersBox select {
  background-color: #3f5d8f;
  border-color: #4d6a96;
  color: #ffffff;
}

/* Advanced filters area inputs override */
#advancedBox input[type="text"],
#advancedBox select {
  background-color: #26436b;
  border-color: #4d6a96;
  color: #ffffff;
}

/* Placeholders to white for dark inputs */
#countryInput::placeholder,
#filterUniversity::placeholder,
#filterMajor::placeholder,
#filterSpeciality::placeholder {
  color: #ffffff;
  opacity: 1;
}

#countryInput::-webkit-input-placeholder,
#filterUniversity::-webkit-input-placeholder,
#filterMajor::-webkit-input-placeholder,
#filterSpeciality::-webkit-input-placeholder {
  color: #ffffff;
}

#countryInput:-ms-input-placeholder,
#filterUniversity:-ms-input-placeholder,
#filterMajor:-ms-input-placeholder,
#filterSpeciality:-ms-input-placeholder {
  color: #ffffff;
}

#countryInput::-ms-input-placeholder,
#filterUniversity::-ms-input-placeholder,
#filterMajor::-ms-input-placeholder,
#filterSpeciality::-ms-input-placeholder {
  color: #ffffff;
}

/* note icon styling */
.note-icon {
  position: relative;
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fc9c3c;
  color: #fff;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  cursor: help;
  transition: background-color 0.15s;
}

.note-icon:hover,
.note-icon:focus {
  background: #e6862a;
}

.note-icon i {
  pointer-events: none;
}

.majors-label-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* tooltip on hover using data-note attribute */
.note-icon[data-note]:hover::after,
.note-icon[data-note]:focus::after {
  content: attr(data-note);
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translate(-50%, -100%);
  min-width: 240px;
  max-width: 440px;
  white-space: normal;
  z-index: 50;
  background: #0f3060;
  color: #fff;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  direction: ltr;
}

html[dir="rtl"] .note-icon[data-note]:hover::after,
html[dir="rtl"] .note-icon[data-note]:focus::after {
  direction: rtl;
}

/* arrow */
.note-icon[data-note]:hover::before,
.note-icon[data-note]:focus::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #0f3060;
  z-index: 49;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Underlined All Majors text tooltip */
.majors-all-note {
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: help;
  position: relative;
  text-underline-offset: 3px;
}

.majors-all-note[data-note]:hover::after,
.majors-all-note[data-note]:focus::after {
  content: attr(data-note);
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translate(-50%, -100%);
  min-width: 240px;
  max-width: 440px;
  white-space: normal;
  z-index: 50;
  background: #0f3060;
  color: #fff;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  direction: ltr;
}

html[dir="rtl"] .majors-all-note[data-note]:hover::after,
html[dir="rtl"] .majors-all-note[data-note]:focus::after {
  direction: rtl;
}

.majors-all-note[data-note]:hover::before,
.majors-all-note[data-note]:focus::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #0f3060;
  z-index: 49;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Hide pseudo tooltips when JS manager active */
body.js-has-tooltips .majors-all-note[data-note]::after,
body.js-has-tooltips .majors-all-note[data-note]::before {
  display: none !important;
  content: none !important;
}

body.js-has-tooltips .note-icon[data-note]::after,
body.js-has-tooltips .note-icon[data-note]::before {
  display: none !important;
  content: none !important;
}

/* tooltip used by JS */
#nbaq-tooltip {
  position: fixed;
  display: none;
  z-index: 99999;
  background: #0f3060;
  color: #fff;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  max-width: 440px;
  min-width: 160px;
  pointer-events: auto;
  word-break: break-word;
}

/* for JS pagination keep rows visible, use loading overlay when fetching */
#tableView {
  position: relative;
}

/* when loading, dim the table body for a background effect */
#tableView.loading tbody {
  opacity: 0.48;
  transition: opacity 0.18s ease;
}

/* Prevent vertical scrollbars while the loading overlay is visible */
#tableView.loading {
  overflow-x: auto;
  overflow-y: hidden;
}

/* loading overlay positioned over the table body only (header stays visible) */
#tableLoadingOverlay {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  z-index: 60;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.46);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  pointer-events: all;
  flex-direction: column;
}

#tableView.loading #tableLoadingOverlay {
  display: flex;
}

#tableLoadingOverlay .nbaq-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(75, 85, 99, 0.12);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: nbaq-spin 1s linear infinite;
}

#tableLoadingOverlay .nbaq-loading-label {
  margin-top: 10px;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

/* Make table header sticky */
#tableView thead,
#tableView thead th {
  position: sticky;
  top: 0;
  z-index: 90;
  background: #f9fafb;
  will-change: transform;
  contain: paint;
  transform: translateZ(0);
}

/* Ensure tbody rows/cells do not create higher stacking contexts than the header */
#tableView tbody tr,
#tableView tbody td {
  position: relative;
  z-index: 1;
}

.sticky {
  will-change: transform;
  contain: paint;
  transform: translateZ(0);
}

/* Ensure the site header remains on top of table headers/rows */
#header {
  z-index: 1000 !important;
  contain: none;
  transform: none;
  will-change: auto;
}

#tableBody > tr#tableLoadingRow > td {
  padding: 0;
  border: 0;
}

#tableBody > tr#tableLoadingRow #tableLoadingOverlay {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  background: rgba(255, 255, 255, 0.46);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  pointer-events: all;
  z-index: 60;
  flex-direction: column;
}
