/* ChlamAtlas — custom styles (no @apply — CDN Tailwind doesn't support it) */

/* ─── Desktop nav tabs ──────────────────────────────────── */
.nav-tab {
  padding: 0.375rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  transition: all 0.15s;
  cursor: pointer;
  background: transparent;
  border: none;
}
.nav-tab:hover  { color: #fff; background: rgba(255,255,255,0.12); }
.nav-tab.active { color: #fff; background: rgba(255,255,255,0.18); }

/* ─── Mobile bottom tab bar ─────────────────────────────── */
.mobile-tab {
  color: #9ca3af;
  transition: color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0;
  gap: 0.125rem;
  flex: 1;
  background: transparent;
  border: none;
  cursor: pointer;
}
.mobile-tab .tab-icon-wrap {
  width: 2rem; height: 2rem;
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.mobile-tab.active { color: #1a6b4a; }
.mobile-tab.active .tab-icon-wrap { background: #dcfce7; }

/* ─── Selector list rows ────────────────────────────────── */
.selector-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer; transition: background 0.15s;
  background: transparent; width: 100%; text-align: left;
}
.selector-row:last-child { border-bottom: none; }
.selector-row:hover { background: #f9fafb; }

/* ─── Gene list ─────────────────────────────────────────── */
.gene-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.2rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer; transition: background 0.15s;
}
.gene-row:last-child { border-bottom: none; }
.gene-row:hover { background: #f9fafb; }

.gene-thumb {
  width: 2rem; height: 2rem;
  border-radius: 0.375rem; object-fit: cover;
  background: #f3f4f6; flex-shrink: 0;
}

/* Functional category gene name colors */
.gene-t3ss      { font-weight: 600; color: #0d9488; }   /* T3SS effectors/secreted — teal */
.gene-inc       { font-weight: 600; color: #7c3aed; }   /* Inc membrane proteins — purple */
.gene-division  { font-weight: 600; color: #d97706; }   /* Cell division / metabolic — amber */
.gene-reg       { font-weight: 600; color: #c2410c; }   /* Regulatory / sigma factors — burnt orange */
.gene-named     { font-weight: 600; color: #1a6b4a; }   /* Other characterized — green */
.gene-unnamed   { font-weight: 500; color: #9ca3af; }   /* Uncharacterized — muted gray */

.gene-locus   { font-family: "DM Mono", monospace; font-size: 0.8125rem; color: #6b7280; }
.gene-product { font-size: 0.75rem; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.125rem; }

/* ─── Detail two-column rows ────────────────────────────── */
.detail-row {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.875rem;
}
.detail-label { width: 9rem; flex-shrink: 0; color: #9ca3af; font-size: 0.875rem; line-height: 1.4; }
.detail-value { flex: 1; color: #111827; }

.section-head {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1rem; font-weight: 700; color: #111827;
  padding-top: 1.25rem; padding-bottom: 0.5rem;
  border-bottom: 2px solid #f3f4f6; margin-bottom: 0.25rem;
}

/* ─── Pipeline pills (6 colored rectangles) ─────────────── */
.ppill {
  width: 1.5rem; height: 0.5rem;
  border-radius: 9999px; flex-shrink: 0;
}
.ppill-done     { background: #22c55e; }
.ppill-active   { background: #f59e0b; }
.ppill-pending  { background: #e5e7eb; }

/* ─── Mutation type badges ───────────────────────────────── */
.badge-tn     { background: #fce7f3; color: #9d174d; font-size: 0.6875rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 9999px; }
.badge-chem   { background: #dbeafe; color: #1e40af; font-size: 0.6875rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 9999px; }
.badge-deletion { background: #dcfce7; color: #166534; font-size: 0.6875rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 9999px; }
.badge-other  { background: #f3f4f6; color: #6b7280; font-size: 0.6875rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 9999px; }

/* ─── Mutant list ───────────────────────────────────────── */
.mutant-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer; transition: background 0.15s;
}
.mutant-row:last-child { border-bottom: none; }
.mutant-row:hover { background: #f9fafb; }

/* ─── Pipeline rows ─────────────────────────────────────── */
.pipeline-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer; transition: background 0.15s;
}
.pipeline-row:last-child { border-bottom: none; }
.pipeline-row:hover { background: #f9fafb; }

/* ─── Skeleton ──────────────────────────────────────────── */
.skeleton {
  background: #f3f4f6; border-radius: 0.375rem;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ─── Back button ───────────────────────────────────────── */
.back-btn {
  display: flex; align-items: center; gap: 0.375rem;
  color: #1a6b4a; font-size: 0.875rem; font-weight: 500;
  padding: 0.75rem 0; cursor: pointer; transition: color 0.15s;
  border: none; background: transparent;
}
.back-btn:hover { color: #0f4530; }

/* ─── External links ────────────────────────────────────── */
.ext-link { color: #1a6b4a; text-decoration: underline; transition: color 0.15s; }
.ext-link:hover { color: #0f4530; }

/* ─── User chip ─────────────────────────────────────────── */
.user-chip {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.625rem 0.25rem 0.25rem;
  border-radius: 9999px;
  background: rgba(255,255,255,0.15);
  color: #fff; font-size: 0.8125rem; font-weight: 500;
  cursor: pointer; border: none; transition: background 0.15s;
}
.user-chip:hover { background: rgba(255,255,255,0.25); }
.user-chip-avatar {
  width: 1.75rem; height: 1.75rem; border-radius: 9999px;
  background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #0f4530;
  overflow: hidden; flex-shrink: 0;
}

/* ─── iOS safe area for bottom nav ─────────────────────── */
.safe-area-pb { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ─── Phenotype images ──────────────────────────────────── */
.phenotype-img {
  width: 6rem; height: 6rem;
  border-radius: 0.5rem; object-fit: cover;
  border: 1px solid #f3f4f6;
}

/* SwissBioPics: highlight the active subcellular compartment */
#swissbiopics-svg .subcell_present path,
#swissbiopics-svg .subcell_present circle,
#swissbiopics-svg .subcell_present ellipse,
#swissbiopics-svg .subcell_present polygon,
#swissbiopics-svg .subcell_present rect {
  fill: rgba(74, 222, 128, 0.5) !important;
  stroke: #16a34a !important;
}

/* ─── Mutants tab two-panel layout ──────────────────────── */
.mut-list-panel {
  display: flex; flex-direction: column;
  border-right: 1px solid #e5e7eb;
  overflow: hidden; background: #fff;
  min-width: 0;
}
.mut-detail-panel {
  overflow-y: auto; background: #f8f8f8;
  min-width: 0;
}

/* Collection strip */
.mut-strip {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fff; flex-shrink: 0;
}
.mut-strip-icon {
  width: 2rem; height: 2rem;
  object-fit: contain; flex-shrink: 0;
}
.mut-strip-name { font-weight: 600; font-size: 0.9375rem; color: #111; flex: 1; }
.mut-strip-count { font-size: 0.75rem; color: #9ca3af; }
.mut-switch-btn {
  padding: 0.25rem 0.625rem; border-radius: 0.375rem;
  border: 1px solid #e5e7eb; background: #fff;
  font-size: 0.75rem; color: #374151; cursor: pointer;
  transition: background 0.15s;
}
.mut-switch-btn:hover { background: #f9fafb; }

/* List rows */
.mut-row {
  display: flex; flex-direction: row; align-items: center; gap: 0.375rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer; transition: background 0.15s;
  border-left: 3px solid transparent;
  text-align: left; background: transparent; width: 100%;
}
.mut-row:last-child { border-bottom: none; }
.mut-row:hover { background: #f9fafb; }
.mut-row.selected { background: #f0fdf4; border-left-color: #16a34a; }
.mut-row-id { font-size: 0.6875rem; color: #9ca3af; font-family: ui-monospace, monospace; }
.mut-row-name { font-size: 0.875rem; font-weight: 600; color: #111; }

/* Type filter pills */
.mut-type-pill {
  padding: 0.25rem 0.75rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 500; cursor: pointer;
  border: 1px solid #e5e7eb; background: #fff; color: #374151;
  transition: all 0.15s; white-space: nowrap;
}
.mut-type-pill:hover { background: #f3f4f6; }
.mut-type-pill.active { background: #166534; border-color: #166534; color: #fff; }

/* Detail panel */
.mut-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 1rem;
  color: #9ca3af; font-size: 0.9375rem;
}
.mut-placeholder-icon { width: 4rem; height: 4rem; object-fit: contain; opacity: 0.5; }

/* Lab-access pill — indigo outline, appears on lab-only section headers and unpublished list rows */
.mut-lab-pill {
  display: inline-block; font-size: 0.46875rem; font-weight: 700;
  letter-spacing: 0.05em; padding: 0.0625rem 0.4375rem;
  border-radius: 9999px; text-transform: uppercase;
  color: #4338ca; border: 1px solid rgba(99,102,241,0.4);
  background: rgba(238,242,255,0.6); vertical-align: middle;
}

/* Gene cards */
.mut-gene-card {
  display: flex; align-items: flex-start; gap: 0.875rem;
  padding: 0.875rem; border-radius: 0.5rem;
  background: #f9fafb; margin-bottom: 0.75rem;
}
.mut-gene-card:last-child { margin-bottom: 0; }
.mut-gene-thumb {
  width: 3rem; height: 3rem; border-radius: 0.375rem;
  object-fit: cover; background: #e5e7eb; flex-shrink: 0;
}
.mut-gene-thumb-placeholder {
  width: 3rem; height: 3rem; border-radius: 0.375rem;
  background: #e5e7eb; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 700; color: #9ca3af;
  font-family: ui-monospace, monospace;
}
.mut-gene-tag { font-size: 0.875rem; font-weight: 700; color: #111; font-family: ui-monospace, monospace; }
.mut-gene-desc { font-size: 0.8125rem; color: #6b7280; margin-top: 0.125rem; }
.mut-gene-link {
  font-size: 0.75rem; color: #1a6b4a; font-weight: 500;
  cursor: pointer; margin-top: 0.25rem; display: inline-block;
  text-decoration: none; background: transparent; border: none; padding: 0;
}
.mut-gene-link:hover { color: #0f4530; text-decoration: underline; }

/* Func badges */
.func-badge {
  display: inline-block; font-size: 0.625rem; font-weight: 600;
  padding: 0.125rem 0.5rem; border-radius: 9999px; margin-top: 0.25rem;
}
.func-badge-hypo   { background: #f3f4f6; color: #6b7280; }
.func-badge-inc    { background: #fce7f3; color: #9d174d; }
.func-badge-t3     { background: #ede9fe; color: #5b21b6; }
.func-badge-char   { background: #dcfce7; color: #166534; }

/* Info grid (recombinant/genotyping) */
.mut-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
}
.mut-info-row { display: flex; flex-direction: column; gap: 0.125rem; }
.mut-info-label {
  font-size: 0.46875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #9ca3af;
}
.mut-info-value { font-size: 0.71875rem; color: #222; font-weight: 500; }

/* Pipeline bar */
.mut-pipeline { display: flex; gap: 0.375rem; }
.mut-stage { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.mut-stage-bar {
  height: 6px; border-radius: 9999px;
}
.mut-stage-bar.done    { background: #16a34a; }
.mut-stage-bar.pending { background: #e5e7eb; }
.mut-stage-name {
  font-size: 0.625rem; font-weight: 500; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mut-stage-name.done    { color: #166534; }
.mut-stage-name.pending { color: #9ca3af; }
.mut-stage-date {
  font-size: 0.5625rem; text-align: center; color: #9ca3af;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Phenotype cards */
.mut-pheno-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mut-pheno-card {
  border-radius: 0.5rem; padding: 0.875rem;
  background: #f9fafb;
}
.mut-pheno-label { font-size: 0.6875rem; font-weight: 700; color: #374151; margin-bottom: 0.5rem; }
.mut-pheno-status { font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.375rem; }
.mut-pheno-status.positive { color: #16a34a; }
.mut-pheno-status.none     { color: #9ca3af; }
.mut-pheno-status.untested { color: #d97706; }
.mut-pheno-desc { font-size: 0.8125rem; color: #6b7280; }
.mut-pheno-imgs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

/* Stocks */
.mut-stocks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.mut-stock-item { display: flex; align-items: center; gap: 0.5rem; }
.mut-stock-dot {
  width: 0.625rem; height: 0.625rem; border-radius: 9999px; flex-shrink: 0;
}
.mut-stock-dot.yes { background: #16a34a; }
.mut-stock-dot.no  { background: #e5e7eb; }
.mut-stock-name { font-size: 0.8125rem; color: #374151; }

/* ── Shared nav popovers ─────────────────────────────────── */
.nav-popover {
  position: fixed;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #f0f0f0;
  min-width: 220px;
  z-index: 9999;
}
.nav-popover::before {
  content: '';
  position: absolute;
  top: -6px;
  left: var(--caret-left, 20px);
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #f0f0f0;
  border-top: 1px solid #f0f0f0;
  transform: rotate(45deg);
}
.nav-popover-label {
  padding: 10px 14px 4px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d1d5db;
}
.nav-popover-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  font-family: inherit;
}
.nav-popover-row:hover { background: #f0fdf4; border-left-color: #1a6b4a; }
.nav-popover-row-icon  { font-size: 15px; }
.nav-popover-row-name  { font-size: 0.875rem; font-weight: 500; color: #111; flex: 1; }
.nav-popover-row-count { font-size: 0.75rem; color: #9ca3af; }
.nav-popover-footer {
  display: block;
  padding: 8px 14px;
  border: none;
  border-top: 1px solid #f3f4f6;
  border-left: 3px solid transparent;
  font-size: 0.75rem;
  color: #1a6b4a;
  font-weight: 500;
  cursor: pointer;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.nav-popover-footer:hover { background: #f0fdf4; }

/* ── Nav search ─────────────────────────────────────────── */
.nav-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 4px 10px;
  min-width: 200px;
  transition: min-width 0.2s;
}
.nav-search-input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 12px;
  width: 100%;
  font-family: inherit;
}
.nav-search-input::placeholder { color: rgba(255,255,255,0.5); }
.nav-search-dropdown {
  position: fixed;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #f0f0f0;
  z-index: 9999;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 340px;
  max-height: 420px;
}
.nav-search-section-label {
  padding: 8px 14px 4px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d1d5db;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}
.nav-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.1s, border-color 0.1s;
}
.nav-search-row:hover { background: #f0fdf4; border-left-color: #1a6b4a; }
.nav-search-row-icon  { font-size: 14px; color: #9ca3af; }
.nav-search-row-main  { flex: 1; min-width: 0; }
.nav-search-row-title { font-size: 0.8125rem; font-weight: 500; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-search-row-sub   { font-size: 0.725rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-search-empty     { padding: 14px; font-size: 0.8125rem; color: #9ca3af; text-align: center; }

/* Mobile: back button inside detail panel */
.mut-mobile-back {
  display: none;
  padding: 0.75rem 1rem 0;
}
@media (max-width: 767px) {
  .mut-mobile-back { display: block; }
  .mut-list-panel  { width: 100%; }
  .mut-detail-panel { width: 100%; }
}

/* ─── Chimera: genome map ruler + exchange panel ─────────── */
.chimera-map-wrap {
  background: #fafafa;
  border: 1px solid #efefef;
  border-radius: 6px;
  padding: 10px 12px 12px;
  overflow: hidden;
}

.chimera-exchange-panel {
  height: 420px;
  overflow-y: auto;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  background: #fff;
}

.chimera-exchange-header {
  position: sticky;
  top: 0;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  gap: 0;
  z-index: 2;
  padding: 6px 10px;
}

.chimera-exchange-col-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6b7280;
}

.chimera-exchange-row {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  border-bottom: 1px solid #f3f4f6;
  min-height: 44px;
  transition: background 0.1s;
}

.chimera-exchange-row:hover {
  background: #f9fafb;
}

.chimera-exchange-row.no-ortholog {
  background: #fffbeb;
}

.chimera-exchange-row.no-ortholog:hover {
  background: #fef3c7;
}

.chimera-gene-cell {
  padding: 6px 10px;
  border-left: 3px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}

.chimera-gene-cell.right {
  border-left: 3px solid transparent;
  border-right: none;
}

.chimera-gene-locus {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(55,65,81,0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.chimera-gene-locus:hover {
  color: #1a6b4a;
  text-decoration-color: #1a6b4a;
}

.chimera-gene-name-inline {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.chimera-gene-name {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chimera-gene-product {
  font-size: 0.625rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chimera-no-ortholog-pill {
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 1px 5px;
  align-self: center;
  white-space: nowrap;
}

.chimera-exchange-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.875rem;
  font-weight: 600;
}
