/* ---------------------------------------------------------------------------
   Base theme. The maroon rgb(110, 39, 61) and Oxford blue #002147 are the IOI
   house colours; change them here to re-skin the whole app.
   --------------------------------------------------------------------------- */
@font-face {
  font-family: 'Franklin Gothic ATF';
  src: url('/static/assets/fonts/franklin-gothic-atf-regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

a { color: rgb(110, 39, 61); }
p { color: #002147; }
body {
  font-family: 'Franklin Gothic ATF', Arial, sans-serif;
  font-size: 20px;
}

/* Footer typography (used by the Ineos footer block in base.html) */
.address {
  color: #fff;
  font-size: 12px;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.social {
  color: #fff;
  font-size: 14px;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.my-custom-bold {
  font-weight: 700;
  font-size: 14px;
  color: rgb(255, 255, 255);
}

/* ---------------------------------------------------------------------------
   Tooltip trigger icon (Bootstrap "info-circle"); pair with data-bs-toggle.
   --------------------------------------------------------------------------- */
.help-icon {
  color: rgb(110, 39, 61);
  cursor: help;
  margin-left: 0.35rem;
}

/* ---------------------------------------------------------------------------
   Collapsible "help callout" accordion — a click-to-expand explainer box.
   --------------------------------------------------------------------------- */
.help-callout {
  border-left: 4px solid rgb(110, 39, 61);
  background-color: #f8f5f6;
  margin: 1rem 0;
}

.help-callout-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: transparent;
  border: none;
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 18px;
  color: rgb(110, 39, 61);
  text-align: left;
  cursor: pointer;
}

.help-callout-toggle:hover,
.help-callout-toggle:focus { background-color: #f1e9ec; }

.help-callout-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.help-callout-toggle[aria-expanded="true"] .help-callout-chevron { transform: rotate(180deg); }

.help-callout-content { padding: 0 1.25rem 1rem 1.25rem; }

.help-callout p,
.help-callout li { font-size: 18px; }

.help-callout ul { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   Colourful navigation buttons used on the results / waiting pages.
   --------------------------------------------------------------------------- */
.job-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.job-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgb(110, 39, 61);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  border: 2px solid #e7e7e7;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.job-nav-btn:hover,
.job-nav-btn:focus {
  background-color: #8a3550;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(110, 39, 61, 0.3);
}

.job-nav-btn i { font-size: 1.3rem; }

/* ---------------------------------------------------------------------------
   BLAST app controls and results.
   --------------------------------------------------------------------------- */
.tool-version-panel {
  border-left: 4px solid #002147;
  background: #f4f7fb;
  padding: 1rem 1.25rem;
}

.tool-version-panel li,
.tool-version-panel p {
  font-size: 18px;
}

.upload-zone {
  border: 2px dashed rgb(110, 39, 61);
  border-radius: 8px;
  background-color: #f9f9f9;
  min-height: 112px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #002147;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.upload-zone:hover,
.upload-zone-active {
  background-color: #f1e9ec;
  border-color: #8a3550;
}

.sequence-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

.parameter-grid label {
  color: #002147;
  font-weight: 600;
}

.job-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: rgb(110, 39, 61);
  color: #fff;
  border-radius: 8px;
  border: 2px solid #e7e7e7;
  min-width: 150px;
  height: 48px;
  font-size: 1.05rem;
  font-weight: 700;
}

.job-action-btn:hover,
.job-action-btn:focus {
  background-color: #8a3550;
  color: #fff;
}

.job-action-btn-disabled {
  background-color: rgba(110, 39, 61, 0.55);
}

.waiting-title {
  color: rgb(110, 39, 61);
}

.waiting-panel,
.waiting-progress-panel,
.waiting-log-panel {
  border: 1px solid rgba(0, 33, 71, 0.16);
  padding: 24px 28px;
  height: 100%;
  background: #fff;
}

.waiting-panel h2 {
  color: rgb(110, 39, 61);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.waiting-panel p,
.waiting-panel li {
  font-size: 1rem;
}

.waiting-panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.waiting-panel-heading i {
  color: rgb(110, 39, 61);
  font-size: 2rem;
  line-height: 1;
}

.waiting-flow {
  margin-top: 1.2rem;
}

.waiting-flow ol {
  color: #002147;
  margin-bottom: 0;
  padding-left: 1.35rem;
}

.waiting-progress {
  height: 20px;
  background: #f2edf0;
}

.waiting-progress .progress-bar {
  width: 0%;
  background-color: rgb(110, 39, 61);
  transition: width 0.8s ease;
}

.waiting-log-panel pre {
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8f9fa;
  border: 1px solid rgba(0, 33, 71, 0.12);
  padding: 16px;
  margin: 0;
  font-size: 0.9rem;
}

.job-details-table th,
.job-details-table td {
  border-bottom: 0 !important;
  color: #002147;
  padding: 0.35rem 0.5rem;
}

.result-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem 1.2rem;
  border-top: 1px solid rgba(0, 33, 71, 0.12);
  border-bottom: 1px solid rgba(0, 33, 71, 0.12);
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.result-meta-grid p {
  margin: 0;
  overflow-wrap: anywhere;
}

.results-table-wrap {
  border: 1px solid rgba(0, 33, 71, 0.12);
  padding: 0.75rem;
}

.results-table-wrap table {
  font-size: 0.9rem;
}

.results-table-wrap #blastResultsTable thead th,
.results-table-wrap #blastResultsTable.dataTable thead th,
.results-table-wrap .dt-scroll-head thead th {
  background-color: #f1eef0;
  color: rgb(110, 39, 61) !important;
  font-weight: 700;
  white-space: nowrap;
}

.results-table-wrap #blastResultsTable thead th span,
.results-table-wrap #blastResultsTable.dataTable thead th span,
.results-table-wrap .dt-scroll-head thead th span {
  color: rgb(110, 39, 61) !important;
}

.alignment-viewer {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  border: 1px solid rgba(0, 33, 71, 0.16);
  background: #fff;
  max-width: 100%;
  max-height: 734px;
  overflow-y: auto;
}

.alignment-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(110, 39, 61, 0.35);
  border-radius: 8px;
  overflow: hidden;
  margin: 0.3rem 0 0.8rem;
  background: #fff;
}

.alignment-mode-btn {
  border: 0;
  background: #fff;
  color: rgb(110, 39, 61);
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.alignment-mode-btn + .alignment-mode-btn {
  border-left: 1px solid rgba(110, 39, 61, 0.25);
}

.alignment-mode-btn:hover,
.alignment-mode-btn:focus {
  background: #f8f5f6;
}

.alignment-mode-btn.active {
  background: rgb(110, 39, 61);
  color: #fff;
}

.alignment-label-column {
  border-right: 1px solid rgba(0, 33, 71, 0.16);
  background: #f8f9fa;
  overflow: hidden;
}

.alignment-ruler-label {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgb(110, 39, 61);
  border-bottom: 1px solid rgba(0, 33, 71, 0.16);
}

.alignment-sequence-label {
  height: 28px;
  line-height: 28px;
  padding: 0 10px;
  color: #002147;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid rgba(0, 33, 71, 0.06);
}

.alignment-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.d3-alignment-viewer svg {
  display: block;
}

.alignment-ruler-tick {
  fill: rgb(110, 39, 61);
  font-size: 0.72rem;
  font-weight: 700;
}

.alignment-row-guide {
  stroke: rgba(0, 33, 71, 0.14);
  stroke-width: 1px;
  shape-rendering: crispEdges;
  pointer-events: none;
}

.alignment-cell rect {
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1px;
}

.alignment-cell text {
  fill: #10233f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  pointer-events: none;
}

.alignment-cell-variable rect {
  stroke: rgba(110, 39, 61, 0.45);
}

.alignment-cell-query rect {
  stroke: rgba(0, 33, 71, 0.38);
}

.alignment-cell-difference rect {
  stroke: rgba(110, 39, 61, 0.72);
  stroke-width: 1.4px;
}

.alignment-cell-hidden {
  pointer-events: none;
}

.alignment-cell-hidden rect,
.alignment-cell-hidden text {
  opacity: 0;
}

.download-table td {
  vertical-align: middle;
}

@media (max-width: 768px) {
  .alignment-viewer {
    grid-template-columns: minmax(130px, 40vw) minmax(0, 1fr);
  }

  .alignment-sequence-label {
    font-size: 0.7rem;
  }
}
