/* Header container */
.synima-header {
  background: #111827;       /* gray-900 */
  color: #e5e7eb;            /* gray-200 */
  border-bottom: 1px solid #1f2937; /* gray-800 */
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1),
              0 4px 6px -2px rgba(0,0,0,0.05);
}

/* Inner width + padding */
.synima-header-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;   /* controls banner height */
  position: relative;
}

/* Top row: logo + title + hamburger alignment */
.synima-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.synima-logo-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.synima-title-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.synima-badge {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.1;
}

/* Title text */
.synima-title {
  font-size: 2.25rem;        /* ~ text-4xl */
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Desktop nav row */
.synima-nav-row {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 2rem;                 /* spacing between links */
  font-size: 1.5rem;         /* ~ text-2xl */
  font-weight: 500;
}

/* Nav link colours */
.synima-nav a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.synima-nav a:hover {
  color: #fb923c;            /* orange-400 */
}

.synima-nav a.synima-nav-active {
  color: #228791;
}

.synima-nav a.synima-nav-active:hover {
  color: #fb923c;
}

.synima-nav-divider {
  color: #64748b;
}

.synima-user-dropdown-link {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.synima-user-dropdown-link:hover {
  color: #fb923c;
}

/* Simple responsive visibility helpers */
.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

/* Mobile menu panel (small overlay) */
.mobile-menu {
  position: absolute;
  right: 1.5rem;
  top: 100%;
  margin-top: 0.5rem;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 20;
}

.mobile-menu.open {
  display: flex;
}

/* Hamburger button */
.hamburger-btn {
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  background: #1f2937;
  color: #e5e7eb;
  font-size: 1.75rem;
  margin-left: auto;
  line-height: 1;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: #374151;
}

/* Breakpoint for mobile: stack + use hamburger */
@media (max-width: 760px) {
  .desktop-only { display: none; }
  .mobile-only { display: block; }

  .synima-top-row {
    justify-content: flex-start;
    width: 100%;
  }

  .synima-logo-title {
    max-width: calc(100% - 3.25rem);
    overflow: hidden;
  }

  .synima-header-inner {
    padding: 1rem;
  }

  .synima-title {
    font-size: 1.2rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .synima-badge {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ---------------- */
/* Logo sizing      */
/* ---------------- */

.synima-logo {
  height: 110px;      /* desktop */
  width: auto;
  object-fit: contain;
}

/* Tablet */
@media (max-width: 1024px) {
  .synima-logo {
    height: 110px;
  }
}

/* Mobile */
@media (max-width: 760px) {
  .synima-logo {
    height: 52px;
  }
}

/* ---------------------------------------- */
/*   GLOBAL PAGE THEME                      */
/* ---------------------------------------- */

body {
  background: #0f172a;        /* slate-900 / deep navy */
  color: #e2e8f0;             /* slate-200 */
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
}

body.synima-page-light {
  background: #f3f4f6;
  color: #111827;
}

/* Main content wrapper */
#app {
  background: #1e293b;        /* slate-800 */
  border-radius: 1rem;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow:
    0 0 20px rgba(0,0,0,0.25),
    0 0 10px rgba(0,0,0,0.15);
}

/* Page headings */
#app h1 {
  color: #38bdf8;             /* sky-400 */
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* Paragraphs */
#app p {
  color: #cbd5e1;             /* slate-300 */
  font-size: 1.1rem;
}

/* Code blocks / JSON / preformatted text */
#app pre {
  background: #0f1b30;        /* deep navy/indigo */
  border: 1px solid #334155;  /* slate-700 */
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  color: #94a3b8;             /* slate-400 */
}

/* Links inside pages */
#app a {
  color: #38bdf8;
  text-decoration: none;
}

#app a:hover {
  color: #f472b6;             /* rose/pink highlight */
}

#app ul,
#app ol,
#app li {
  color: #cbd5e1;
}

/* Section spacing */
.section {
  margin-bottom: 2rem;
}

/* Make form labels readable inside sections */
.section label {
  color: #ffffff !important;
}

/* submit button for registration */
.section #reg-submit {
  background: #111827 !important; /* gray-900 */
  color: #ffffff !important;
}

/* Register message text readable */
#reg-msg {
  color: #ffffff !important;
}

/* Table styling */
.ortho-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.ortho-table th {
  background: #334155;
  color: #e2e8f0;
  padding: 0.5rem;
  text-align: left;
}

.ortho-table td {
  background: #1e293b;
  border-top: 1px solid #334155;
  padding: 0.5rem;
}

.plot-image {
  max-width: 70%;   /* or 60%, 50%, etc */
  height: auto;     /* keeps proportions */
  display: block;
  margin: 1.5rem auto;
  border-radius: 0.5rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.35);
}

/* PDF viewer */
.pdf-viewer {
  width: 100%;
  height: 500px;
  margin: 1rem 0;
  border: 1px solid #334155;
  border-radius: 0.5rem;
}

.rscript-block {
  background: #0f1b30;
  border: 1px solid #334155;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.copy-btn {
  background: #1e40af;
  color: #e2e8f0;
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #3b82f6;
}

.synima-colour-input {
  width: 2.5rem;
  height: 1.8rem;
  padding: 0;
  border: 1px solid #334155;
  border-radius: 0.35rem;
  background: #111827;
  cursor: pointer;
}

.orthologs-page {
  color: var(--synima-ortho-text, #ffffff);
}

.orthologs-page .ortho-table th,
.orthologs-page .param-table th {
  background: var(--synima-ortho-bg, #0f1b30);
  background: color-mix(in srgb, var(--synima-ortho-bg, #0f1b30) 65%, #334155 35%);
  color: var(--synima-ortho-text, #ffffff) !important;
}

.orthologs-page .ortho-table td,
.orthologs-page .param-table td {
  background: var(--synima-ortho-bg, #0f1b30);
  background: color-mix(in srgb, var(--synima-ortho-bg, #0f1b30) 80%, #1e293b 20%);
  color: var(--synima-ortho-text, #ffffff) !important;
}

.orthologs-page .tree-view {
  background: var(--synima-ortho-bg, #0f1b30);
}

.synima-footer {
  margin-top: 1.5rem;
  padding: 1rem;
  text-align: center;
  color: #94a3b8;
  border-top: 1px solid #1f2937;
}

.synima-footer a {
  color: #38bdf8;
  text-decoration: none;
}

.synima-footer a:hover {
  color: #fb923c;
}


/* Force content headings to white */
#app h1,
#app h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.75rem;
  border-bottom: 1px solid #334155;
  padding-bottom: 0.25rem;
}
#app h3,
#app h4 {
  color: #ffffff !important;
}

/* Force table header text to white */
#app table th {
  color: #ffffff !important;
}

/* Make table cell text light */
#app table td {
  color: #e2e8f0 !important;   /* light slate */
}

/* Make labels above PDF and R script readable */
.section h2,
.section h3 {
  color: #ffffff !important;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.param-table th {
  text-align: left;
  padding: 0.5rem;
  background: #334155;
  color: #fff;
  width: 30%;
}

.param-table td {
  padding: 0.5rem;
  background: #1e293b;
  color: #e2e8f0;
  border-top: 1px solid #334155;
}

.rscript-block {
  font-size: 0.9rem;
  white-space: pre-wrap;    /* key change */
  word-break: break-word;
  overflow-x: hidden;
  max-height: 400px;
}


/* TREE */
/* background: #0f1b30; */
.tree-view {
  background: var(--synima-tree-bg, #0f1b30);
  border: 1px solid #334155;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow: hidden;
  min-height: 300px;
  margin-bottom: 1.5rem;
}

.tree-svg {
  width: 100%;
  height: auto;
}

/* 
  stroke: #64748b;
   slate-500 */
.tree-lines line {
  stroke-width: 2px;
}

/*.tree-label {
  fill: #e2e8f0;  
  font-size: 0.9rem;
}
*/

/* Newick block styling, similar to R script */
.newick-block {
  background: #0f1b30;
  border: 1px solid #334155;
  padding: 0.75rem;
  border-radius: 0.5rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.25rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}

/* TREE pt2 */

.tree-controls button {
  background: #1e40af;
  color: #e2e8f0;
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  border: none;
  cursor: pointer;
  margin-right: 0.5rem;
}

.tree-controls button:hover {
  background: #3b82f6;
}

.tip-dialog {
  background: #0f1b30;
  border: 1px solid #334155;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

.tip-dialog.hidden {
  display: none;
}

.tip-dialog button {
  display: block;
  width: 100%;
  text-align: left;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 0.3rem 0.5rem;
  margin: 0.2rem 0;
  border-radius: 0.3rem;
}

.tip-dialog button:hover {
  background: #475569;
}

.tree-controls label,
.tree-controls label span {
  color: white !important;
}

/* for updating taxa labels */

.tree-label-selected {
  fill: yellow;
  stroke: black;
  stroke-width: 0.5;
}

#annotate-btn.annotate-active {
  background-color: #444;
  border-color: #aaa;
  box-shadow: inset 0 0 3px rgba(0,0,0,0.5);
}

.hidden { display: none; }
.tree-label-selected { fill: yellow; stroke: black; stroke-width: 0.4; }

#synteny-tree-mini {
  width: 100%;
  display: block;
  height: auto;
}

#synteny-main, #synteny-main svg {
    background: none !important;
    border: none !important;
}

/* new tree for organising */

.tree-controls-group {
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
  margin-top: 0.6rem;
}

.tree-controls-group legend {
  padding: 0 0.4rem;
  color: white;
  font-weight: 600;
}

.tree-controls-group label {
  margin-right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: white;
}

.annotate-wrap {
  position: relative;
  display: inline-block;
}

.annotate-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  width: 180px;
  background: white;
  color: black;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  padding: 8px;
  z-index: 9999;
}

/* Synteny etc. */

.panel-view {
  background: var(--synima-synteny-bg, #0f1b30);
  border: none !important;
  padding: 0.75rem;
  overflow: hidden;
}

/*border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #0f1b30;*/

.synteny-figure {
  background: var(--synima-synteny-bg, #0f1b30);
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 1rem;
  overflow: hidden;
}

/*choice-group*/
.synteny-controls label {
  color: #ffffff;
}

.synteny-controls button {
  background: #1e40af;
  color: #e2e8f0;
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  border: none;
  cursor: pointer;
  margin-right: 0.5rem;
}

.synteny-controls button:hover {
  background: #3b82f6;
}

.synteny-controls-group {
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
  margin-top: 0.6rem;
}

.synteny-controls-group legend {
  padding: 0 0.4rem;
  color: white;
  font-weight: 600;
}

.synteny-controls-group label {
  margin-right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: white;
}

/* contig select 
.synteny-ctg rect {
  stroke: #ffffff;
  stroke-width: 1px;
}*/

.synteny-ctg.is-selected rect {
  stroke: #facc15;      /* yellow highlight */
  stroke-width: 3px;
}

/* synteny contig editor */
.synima-contig-editor {
  position: absolute;
  z-index: 100000;
}

.synima-contig-editor .card {
  min-width: 260px;
  background: #0f1b30;
  color: #ffffff;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.synima-contig-editor input,
.synima-contig-editor select {
  background: #111827;
  color: #ffffff;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px;
  width: 100%;
}

.synima-contig-editor button {
  background: #111827;
  color: #ffffff;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}

.synima-contig-editor .close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 18px;
}

.synima-genes-categories {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.synima-gene-card {
  border: 1px solid #334155;
  border-radius: 0.6rem;
  padding: 0.9rem;
  background: #0f1b30;
}

.synima-gene-card-row {
  display: flex;
  gap: 0.7rem;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.synima-gene-card label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: #ffffff;
}

.synima-gene-card input[type="text"],
.synima-gene-card input[type="number"],
.synima-gene-card select,
.synima-gene-card textarea {
  background: #111827;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 0.4rem;
  padding: 0.45rem 0.55rem;
}

.synima-gene-card input[type="text"] {
  min-width: 12rem;
}

.synima-gene-card textarea {
  min-height: 9rem;
  width: min(44rem, 100%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.35;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  white-space: pre;
  overflow-x: auto;
}

.synima-gene-status-list {
  border: 1px solid #334155;
  border-radius: 0.4rem;
  padding: 0.5rem 0.55rem;
  background: #111827;
  min-width: 18rem;
  max-height: 14.5rem;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.35;
}

.synima-gene-status-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  min-height: 1.35em;
  line-height: 1.35;
}

.synima-gene-status-line {
  width: 2.1rem;
  text-align: right;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.synima-gene-status-icon {
  width: 1.15rem;
  display: inline-flex;
  justify-content: center;
  font-weight: 700;
  line-height: 1.35;
}

.synima-gene-found {
  color: #86efac;
}

.synima-gene-missing {
  color: #fca5a5;
}

.synima-gene-empty {
  color: #94a3b8;
  margin: 0;
}

.synima-gene-status-row-muted {
  opacity: 0.75;
}

.synima-gene-io-row {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.synima-gene-io-label {
  flex: 1 1 30rem;
}

.synima-gene-status-col {
  flex: 1 1 22rem;
  min-width: 18rem;
}

.synima-gene-status-title {
  color: #ffffff;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.synima-gene-status-gene {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: #e5e7eb;
  white-space: pre;
}

@media (max-width: 980px) {
  .synima-gene-status-list {
    min-width: 100%;
    max-height: 11rem;
  }
}
