/* Header text */
#header-blast-text {
  margin: 120px 0 50px 20vw;
  color: var(--header-text);
}
#header-blast-text h1 {
  color: var(--header-text);
  font-size: 5.5rem;
  font-family: 'Teko', sans-serif;
  font-weight: normal;
  letter-spacing: 14pt;
  line-height: 0.6;
  margin-bottom: 0;
}
#header-blast-text p {
  font-size: 1.8rem;
  font-family: 'Abel', sans-serif;
  letter-spacing: 8pt;
  line-height: 1rem;
  font-weight: normal;
}
#header-blast-text span {
  position: relative;
  top: 2px;
  margin-left: 10px;
  font-size: 2rem;
  font-family: 'Abel', sans-serif;
  font-weight: 600;
  letter-spacing: 6pt;
}

/* Main */
.crustome-info {
  margin: 20px 10px;
  padding: 20px;
  justify-content: center;
  text-align: center;
  color: var(--transparent-input);
  background-color: var(--navbar-dark);
  border-color: #1f2b3d;
  border-radius: 15px;
}
.sequence {
  font-size: 12pt;
  font-family: monospace;
  width: 96%;
  margin: 40px;
  margin-bottom: 75px;
}
.text-box {
  width: 75%;
  padding: 10px 20px 10px 10px;
  margin: 15px auto;
  font-size: 14pt;
  color: #111;
  background-color: white;
  word-wrap: break-word;
  border-radius: 10px;
}
.query-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  max-width: calc(100% - 20px);
  font-size: 16px;
  line-height: 1.4;
  max-height: 600px;
  overflow-y: auto;
}
.link-box {
  background-color: #ccc;
}
#sample-sequence {
  color: var(--inverse);
  float: right;
  margin: 0 25px 10px 0;
}
#blast-info {
  height: 40px;
  float: right;
}
#alg-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 35px;
}
#evalue {
  max-width: 220px;
  margin: 0 auto;
}
#btn-submit {
  display: block;
  width: 200px;
  margin: 15px auto;
}

/* DB tabs */
div.db-tab {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 25px 100px 0 100px;
  margin-bottom: 25px;
  color: var(--text-main);
  background-color: var(--inner-pane);
  border: 2px solid var(--bg-color);
  border-radius: 15px;
}
.form-group {
  width: 100%;
}
.db-group {
  margin-top: 25px;
}
.db-search {
  max-width: 400px;
  margin-top: 15px;
  padding: 3px 5px;
  color: var(--navbar-dark);
  background-color: var(--transparent-input);
  border-color: #1f2b3d;
}
.db-search:focus {
  background-color: white;
}
div.row.multi-panes p {
  margin-top: 10px;
}
div.row.multi-panes > .col {
  padding: 5px;
  margin: 0 5px;
  border: 2px solid rgba(120,120,120,0.25);
  border-radius: 10px;
  min-height: 300px;
}
.db-group {
  color: #222;
  text-align: left;
  max-width: 800px;
  max-height: 500px;
  overflow-y: scroll;
}
img.db.loader {
  display: none;
  position: absolute;
  top: calc(50% - 5vw);
  left: calc(50% - 5vw);
}
p.no-dbs {
  display: none;
}
.db-tab p.errorlist {
  text-align: center;
  font-size: 1.5rem;
  margin-top: 20px;
}
#browser-btn {
  position: relative;
  height: fit-content;
  margin: 9px 10px 0 0;
}

/* radiobutton */
label.list-group-item {
  width: 100%;
  user-select: none;
  padding: 5px 15px;
  cursor: pointer;
}
.list-group-item.selected {
  color: #fff;
  background-color: #0275D8;
}
.list-group-item.selected span {
  color: #ddd;
}
.db-group label:first-of-type {
  border-radius: 1rem 0 0 0;
}
.db-group label:last-child {
  border-radius: 0 0 0 1rem;
}
.db-group label.only-child {
  border-radius: 1rem 0 0 1rem;
}
.condition {
  float: right;
  color: #6c757d;
  font-size: 80%;
  line-height: 18pt;
  padding-left: 20px;
}
.access-glyph {
  width: 10px;
  float: right;
  margin: 8px 0 8px 15px;
}
input[type="radio"] {
  display: none;
}
input[type="radio"] + .list-group-item {
  cursor: pointer;
}
input[type="radio"]:checked + .list-group-item {
  background-color: #0275D8;
  color: #fff;
}
input[type="radio"]:checked + .list-group-item .condition {
  color: #fff;
}
input[type="radio"]:checked + .list-group-item:before {
  color: inherit;
}

/* Loading animation */
#animation {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: rgba(0,0,0,0.9);
  z-index: 9;
}
#animation canvas {
  margin-top: 150px;
}
#animation .text {
  position: absolute;
  text-align: center;
  top: 20vh;
  margin-left: -100px;
  z-index: 10;
  overflow: hidden;
  white-space: nowrap;
}
#animation .text .lead {
  color: #ccc;
}
.run-text {
  text-align: left;
  font-family: monospace;
  font-size: 1.8rem;
  border-right: .15rem solid white;
  letter-spacing: .2rem;
  animation: typing 2s steps(16, end),
    blink-caret .75s step-end infinite;
}
  @keyframes typing {
    from { width: 0 }
    to { width: 255px }
  }
  @keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: white; }
  }


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  TAXONOMY TREE                                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */

.taxon-tree-wrapper {
  width: 100%;
  margin-bottom: 18px;
}

.taxon-tree-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.taxon-tree-reset {
  font-size: 0.78rem;
  padding: 2px 10px;
  border-radius: 20px;
  line-height: 1.4;
}

/* Scrollable container */
.taxon-tree-scroll {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--navbar-dark, #111c2d);
  border: 2px solid rgba(120, 140, 180, 0.18);
  border-radius: 12px;
  padding: 10px 6px 10px 12px;
  /* Subtle inner shadow to hint scrollability */
  box-shadow: inset 0 8px 12px -8px rgba(0,0,0,0.5),
              inset 0 -8px 12px -8px rgba(0,0,0,0.5);
}

/* Custom scrollbar */
.taxon-tree-scroll::-webkit-scrollbar {
  width: 6px;
}
.taxon-tree-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
}
.taxon-tree-scroll::-webkit-scrollbar-thumb {
  background: rgba(120,160,220,0.35);
  border-radius: 3px;
}
.taxon-tree-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(120,160,220,0.6);
}

/* Base tree list resets */
ul.taxon-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.taxon-tree--child {
  padding-left: 18px;
  border-left: 1px solid rgba(120,160,220,0.15);
  margin-left: 6px;
  margin-top: 2px;
}

/* Tree nodes */
.taxon-node {
  margin: 1px 0;
}

/* Shared label styles */
.taxon-node__label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  color: rgba(200, 215, 235, 0.85);
  font-family: 'Abel', sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.taxon-node__label:hover {
  background-color: rgba(2, 117, 216, 0.18);
  color: #e8f0ff;
}

.taxon-node__label--active {
  background-color: rgba(2, 117, 216, 0.38) !important;
  color: #ffffff !important;
  font-weight: 600;
}

/* Root node */
.taxon-node--root {
  margin-bottom: 4px;
}

.taxon-node__label--root {
  font-size: 1.0rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(220, 235, 255, 0.95);
  padding: 5px 8px;
}

/* Internal node: style the <summary> to suppress browser arrow & use ours */
.taxon-details {
  /* no extra styling needed on the details element itself */
}

details.taxon-details > summary {
  /* Remove default browser disclosure triangle */
  list-style: none;
}
details.taxon-details > summary::-webkit-details-marker {
  display: none;
}

/* Add our own toggle arrow via ::before on the label */
.taxon-node__label--internal::before {
  content: '▶';
  font-size: 0.6rem;
  color: rgba(150, 180, 220, 0.7);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-right: 2px;
  display: inline-block;
  width: 10px;
}

details[open] > summary.taxon-node__label--internal::before {
  transform: rotate(90deg);
}

/* Leaf node */
.taxon-node__label--leaf {
  padding-left: 20px; /* indent to align with internal arrow */
}

/* Name text */
.taxon-node__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Assembly count pill */
.taxon-node__count {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-family: monospace;
  background-color: rgba(100, 140, 200, 0.18);
  color: rgba(160, 195, 240, 0.9);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}

.taxon-node__label--active .taxon-node__count {
  background-color: rgba(255,255,255,0.2);
  color: #fff;
}

/* Taxonomy level badges */
.taxon-badge {
  flex-shrink: 0;
  display: inline-block;
  font-size: 0.62rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  min-width: 60px;
  text-align: center;
}

/* Badge colours — matching existing taxon-search span colours */
.taxon-badge--class     { background-color: #273c7e; color: #d8e2ff; }
.taxon-badge--subclass  { background-color: #1a4f72; color: #c5e4f8; }
.taxon-badge--superorder{ background-color: #2c5f3f; color: #c0f0d0; }
.taxon-badge--order     { background-color: #106331; color: #b8f0c8; }
.taxon-badge--infraorder{ background-color: #3a3a00; color: #e8e080; }
.taxon-badge--family    { background-color: #4e2047; color: #f0c8e8; }
.taxon-badge--genus     { background-color: #800f0f; color: #ffc8c8; }
.taxon-badge--species   { background-color: #3a3a3a; color: #cdd2d3; border: 1px solid #666; }

/* Active filter breadcrumb */
.taxon-active-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 5px 12px;
  background-color: rgba(2, 117, 216, 0.12);
  border: 1px solid rgba(2, 117, 216, 0.3);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: 'Abel', sans-serif;
}
.taxon-active-label {
  color: rgba(160, 190, 230, 0.8);
  font-style: italic;
}
.taxon-active-value {
  color: #8bc8ff;
  font-weight: 600;
  font-family: monospace;
}

/* Media queries */
@media (max-width: 1480px) {
  #header-blast-text {
    zoom: 0.75;
  }
  div.db-tab {
    padding: 25px 0 0 0;
  }
  label.list-group-item {
    font-size: 0.8rem;
    padding: 5px 10px: 5px 15px;
  }
}
@media (max-width: 1270px) {
}
@media (max-width: 992px) {
}
@media (max-width: 768px) {
  .taxon-tree-scroll {
    max-height: 220px;
  }
  .sequence {
    margin: 10px 5px 20px 5px;
  }
  #alg-col {
    padding-bottom: 10px;
  }
  .alg-btn {
    min-width: 85px;
    font-size: 1rem;
  }
}
@media (max-width: 576px) {
}
@media (max-width: 533px) {
}
@media (max-width: 485px) {
}
/* ─────────────────────────────────────────────────────────────────────────── */
/*  Algorithm selector button group                                            */
/* ─────────────────────────────────────────────────────────────────────────── */
.alg-btn-group {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.alg-btn {
  background-color: #ddd;
  color: black;
  border-color: #bbb;
  border-style: solid;
  border-width: thin;
  font-size: 1.25rem;
  font-weight: normal;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-width: 110px;
}
.alg-btn:focus {
  outline: none;
  box-shadow: none;
}
.alg-btn:hover {
  background-color: #ccc;
  color: black;
}
.alg-btn.active {
  background-color: #0275D8;
  border-style: none;
  color: white;
}
/* Round outer corners like the blast app's radio button group */
#alg-blastp {
  border-radius: 10px 0px 0px 10px;
}
#alg-diamond {
  border-radius: 0px 10px 10px 0px;
}