:root {
  --footer-h: 98px;
}

:root {
  --nav-h: 56px;
}

[id^='term-'] {
  scroll-margin-top: 72px;
}

/* Consistent box sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
html {
  overscroll-behavior: none; /* Disables scroll chaining and bounce */
  height: 100%;
  margin: 0;
}

body {
  /* Enables browser window scrollbar to appear;
  Prevents the horizontal "white space" */
  overflow-x: auto;
  display: flex;
  flex-direction: column;
}

/* Hides accidental overflow within the body/row */
.body-container {
  overflow-x: hidden;
}

/* Prevents table/card from overflowing their column */
.table,
.card {
  max-width: 100%;
}

.hero {
  background-color: white;
  padding: 10px;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
  border: 1px solid #cccccc;
  border-top-left-radius: var(--bs-accordion-inner-border-radius);
  border-top-right-radius: var(--bs-accordion-inner-border-radius);
}

.row.body-container,
.container-fluid,
.row {
  margin-left: 0;
  margin-right: 0;
}
.main-content {
  flex: 1; /* Allows the main content section to expand to push the footer down */
  display: flex;
  flex-direction: column;
  background: url(../images/background-tile.png);
  background-color: white;
}

.header-title {
  color: white !important;
  padding: 30px;
  font-size: 35px !important;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold !important;
}

.header-icon {
  margin-top: 20px;
  font-size: 2rem;
}

/* Nav bar */
#navbarID {
  background-color: #c61f16 !important; /* #850001 */
  width: 100%;
  z-index: 999; /* Keeps navbar above other elements */
  min-height: var(--nav-h);
  box-sizing: border-box;
}

#navbarID ul {
  gap: 8px; /* Adds space between icons */
}

#navbarID ul li {
  padding: 0 5px; /* Adds horizontal padding */
}

#navbarID .container-fluid {
  height: 100%;
  display: flex;
  align-items: center;
}

.navbar-toggler {
  background-color: white !important;
}

#navIcons {
  display: flex;
  justify-content: flex-end !important;
  margin-left: auto;
  align-items: center;
}

#navIcons .navbar-nav .nav-item,
#navIcons .navbar-nav .nav-item * {
  transition: none !important;
}

#navIcons .navbar-nav .nav-item {
  padding: 0 !important;
  background: transparent;
  border: 0;
  cursor: pointer;
}

#navIcons .navbar-nav .nav-link {
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

#navIcons .navbar-nav .nav-item > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

#navIcons i {
  font-size: 1.2rem;
  line-height: 1;
  color: #fff !important;
}

#navIcons .navbar-nav .nav-link:hover,
#navIcons .navbar-nav .nav-item > i:hover,
#navIcons .navbar-nav .nav-link:focus-visible,
#navIcons .navbar-nav .nav-item > i:focus-visible {
  background: #fff;
}

#navIcons .navbar-nav .nav-link:hover i,
#navIcons .navbar-nav .nav-item > i:hover,
#navIcons .navbar-nav .nav-link:focus-visible i,
#navIcons .navbar-nav .nav-item > i:focus-visible i {
  color: #0d6efd !important;
}

#navIcons .collapse .show .nav-item {
  margin-bottom: 0.5rem;
}

/* Footer */
#footerDiv {
  color: white;
  padding: 20px;
  height: var(--footer-h);
  background-color: #c61f16 !important;
}

#footerDiv .nav-link {
  padding: 0;
  margin: 0;
  line-height: 1.5rem;
  display: inline-block;
  vertical-align: bottom;
  transition: none;
}

#footerDiv .nav-link:hover {
  cursor: pointer;
  color: #0d6efd !important;
  background-color: white;
  font-weight: bold;
}

.footer-row {
  display: flex;
  align-items: center;
}

.footer-row > .footer-logos {
  justify-content: flex-start;
  margin-left: 3rem;
}

.footer-row > .footer-nav {
  margin-left: auto;
  margin-right: auto;
}

.footer-nav .nav-item a {
  color: white !important;
}

.footer-row div a,
small > a {
  color: transparent;
  text-decoration: none;
}

.footer-row > .footer-licence {
  justify-content: flex-end !important;
}

#docSelectForm {
  margin-left: 20px;
}
#docSelectForm .col {
  width: 250px;
  margin-right: 20px;
}

.card {
  margin-top: 20px;
}

/* Accordion */
.accordion {
  margin-top: 30px;
  margin-bottom: 20px;
}

.accordion .accordion-item {
  margin-bottom: 8px;
  background-color: #fff;
}

.accordion .accordion-header {
  border-radius: 8px 8px 0 0;
}

.accordion .accordion-header .accordion-button {
  background-color: #e3e3e3;
  color: #000;
  font-weight: bold;
  font-size: 30px;
  padding: 10px 15px;
  font-family: 'Source Code Pro', 'SF Mono', 'Monaco, Inconsolata', 'Fira Mono',
    'Droid Sans Mono', monospace, monospace;
}

.accordion-button {
  white-space: normal; /* Allow wrapping inside the button */
  align-items: flex-start;
  display: flex;
}

.accordion-button .info-note {
  display: block;
  line-height: 1.2;
  color: #6c757d;
  font-size: 0.6em;
  margin-top: 0.25rem !important;
  padding-left: 6.8rem;
  word-break: break-word;
}

/* Prevent wrapping for the first cell in each table row
 i.e. the row title e.g. Name */
.card-body table td:first-child {
  white-space: nowrap;
  padding-right: 0.5rem;
}

/* Add wrapping for every other cell */
.card-body table td:last-child {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* Colours */
.text-white {
  color: white !important;
}

/* General CSS */
.text-hover:hover + .tooltip-message {
  display: block;
}

.text-hover {
  cursor: pointer;
  text-decoration: underline dotted;
}

.text-bold {
  font-weight: bold;
}

/* Hide elements */
.hide-div {
  display: none !important;
}

/* Buttons, icons and links */
#downloadManifestBtn {
  border-color: #850001 !important;
  text-decoration: none;
  background-color: #c61f16;
  color: white;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out;
}

#downloadManifestBtn:hover {
  background-color: #a81a13;
  color: white;
}

#sampleInfoLink {
  color: #0d6efd;
}

.sample-info-icon {
  margin-right: 0.5rem;
  color: black; /* #0d6efd */
}

/* Positions and spacing */
.fl-right {
  float: right;
}

.position-absolute {
  position: absolute !important;
}

.top-0 {
  top: 0 !important;
}

.end-0 {
  right: 0 !important;
}

.mr-1 {
  margin-right: 1.5rem !important;
}

.mr-2 {
  margin-right: 2rem !important;
}

.mb-10 {
  margin-bottom: 10px;
}

.mt-1 {
  margin-top: 1rem !important;
}

.ml-1 {
  margin-left: 1rem !important;
}

.top-margin {
  margin-top: 100px;
}

.bottom-margin {
  margin-bottom: 50px;
}

.ml-10 {
  margin-left: 10px;
}

/* Navigate to top button CSS */
.navigate-to-top {
  position: fixed;
  bottom: -40px;
  right: 40px;
  display: block;
  width: 50px;
  height: 50px;
  line-height: 50px;
  background: #0d6efd;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 50%;
  opacity: 0;
  -webkit-transform: scale(0.3);
  -ms-transform: scale(0.3);
  transform: scale(0.3);
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 9;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
}

.navigate-to-top:focus {
  color: #fff;
}

.navigate-to-top.show {
  bottom: 40px;
  right: 40px;
  opacity: 1;
  -webkit-transform: scale(1);
  -ms-transform: scale(1);
  transform: scale(1);
}

.navigate-to-top.show:hover {
  color: #fff;
  bottom: 30px;
  opacity: 1;
}

.navigate-to-top:hover .up-arrow {
  animation-name: upArrowBounceAlpha;
  animation-duration: 1.4s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

.navigate-to-top:hover .up-arrow:nth-child(2) {
  animation-name: upArrowBounceAlpha;
  animation-duration: 1.4s;
  animation-delay: 0.2s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
.up-arrow {
  background-image: url('../images/right-arrow.svg');
  position: absolute;
  width: 12px;
  height: 12px;
  background-size: contain;
  transform: rotate(-90deg);
  top: 30%;
  left: 40%;
}

.up-arrow:nth-child(2) {
  top: 42%;
}

@keyframes upArrowBounceAlpha {
  0% {
    opacity: 1;
    transform: rotate(-90deg) translateX(0px) scale(1);
  }
  25% {
    opacity: 0;
    transform: rotate(-90deg) translateX(10px) scale(0.9);
  }
  26% {
    opacity: 0;
    transform: rotate(-90deg) translateX(-10px) scale(0.9);
  }
  55% {
    opacity: 1;
    transform: rotate(-90deg) translateX(0px) scale(1);
  }
}

/* Dropdown menus */
.dropdown-menu-info-icon {
  position: relative;
  bottom: 8px;
  cursor: pointer;
}

#techDropdown .dropdown-menu {
  max-width: 300px; /* Set a maximum width for the dropdown */
  word-wrap: break-word; /* Break long words that can't fit */
  white-space: normal; /* Allow wrapping of text */
}

#techDropdown .dropdown-item {
  white-space: normal; /* Allow text in the item to wrap */
  word-wrap: break-word; /* Ensure long words break to new lines */
  overflow-wrap: break-word; /* Break word overflow if it's too long */
}

/* Modals */
#searchModal .modal-header,
#emailModal .modal-header,
#infoModal .modal-header {
  background-color: #c61f16; /* #0d6efd */
}

#warningModal .modal-title,
#searchModal .modal-title,
#emailModal .modal-title,
#infoModal .modal-title {
  color: white;
}

#emailModal .modal-body,
#infoModal .modal-body {
  margin-left: 15px;
  margin-right: 15px;
}

#warningModal .btn-close,
#searchModal .btn-close,
#emailModal .btn-close,
#infoModal .btn-close {
  background-color: white;
}

/* Search modal */
#searchCriteria {
  display: none;
  padding-top: 15px;
}

#searchInput {
  pointer-events: all;
}

.search-box {
  width: 250px;
}

.search-dialog {
  max-width: 500px;
  margin: 20px auto;
}

.search-result-header {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.search-results {
  max-height: 300px;
  overflow-y: auto;
}

.search-result-item {
  cursor: pointer;
}

.search-result-link {
  text-decoration: none;
  color: #0d6efd;
}

#totalMatches {
  background-color: #ededec;
  color: #ededec;
  font-size: 0.8rem;
  line-height: 1.8rem;
  padding: 0 0.8rem;
  scroll-snap-align: start;
}

/* Warning modal */
#warningModal .modal-header {
  background-color: #ffc107;
}

/* Info modal */
#infoModal .modal-header {
  position: sticky;
  top: 0;
  z-index: 1055;
}
#infoModal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}
#infoModal .modal-body .info-modal-toc-link {
  margin-left: 20px;
}

#introduction,
#sampleMetadataInfo {
  text-decoration: underline;
}

#infoModalLink {
  cursor: pointer;
  color: #0d6efd;
  text-decoration: underline;
}
#infoModalLink:hover {
  color: #0a58ca;
}
#infoAccordion .accordion-button {
  width: 100%;
  font-size: 20px;
}

.tooltip-message {
  display: none;
  position: absolute;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px;
  border-radius: 5px;
  font-size: 14px;
  z-index: 10;
  white-space: nowrap;
}

@keyframes highlightFlash {
  0% {
    background-color: yellow;
  }
  100% {
    background-color: transparent;
  }
}

.highlight-flash {
  animation: highlightFlash 2s ease-out;
}

#singleCellInfoModalListID li,
#stxInfoModalListID li {
  padding-top: 10px;
}

/* Media queries */
@media (max-width: 1207px) {
  small > br {
    display: none;
  }
}

@media (max-width: 1172px) {
  /* Footer */
  #footerDiv {
    display: flex;
    flex-direction: column; /* Stack vertically on small screens */
    justify-content: center;
    width: 100%;
  }

  #footerDiv .container-fluid {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-row {
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    gap: 5px;
  }

  /* Logos */
  .footer-row > .footer-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center !important;
    gap: 10px;
    margin-left: 0;
  }

  .footer-logos img {
    height: 30px;
  }

  /* Navigation links */
  .footer-logos,
  .footer-nav {
    justify-content: center;
  }
  .footer-nav {
    text-align: center;
  }

  .nav-link {
    padding-bottom: 0 !important;
  }

  .footer-nav .nav {
    flex-wrap: wrap; /* Wrap nav items on small screens */
    justify-content: center;
    gap: 10px;
  }

  /* Licence details */
  small > a > img {
    height: 15px;
  }

  small > br {
    display: none;
  }

  .footer-row > .footer-licence {
    flex-direction: column;
    justify-content: center !important;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 995px) {
  .accordion-button .info-note {
    padding-left: 3.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: block;
  }
}

@media (max-width: 992px) {
  #navIcons {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #c61f16;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    border-color: #000;
    border: 1px solid #cccccc;
    min-width: max-content;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  /* Show when toggle button is clicked */
  #navIcons.show {
    display: flex;
  }
}

@media (max-width: 768px) {
  .search-box {
    width: 100%;
  }
}

@media only screen and (max-width: 575px) {
  .navigate-to-top {
    width: 40px;
    height: 40px;
    line-height: 40px;
  }

  .navigate-to-top.show {
    bottom: 10px;
    right: 10px;
  }

  .navigate-to-top.show:hover {
    bottom: 10px;
  }
}

@media (max-width: 520px) {
  .footer-nav .nav {
    gap: 0;
  }
}
