/*
 * GI-DB: UI utilities — VEP badges, sticky headers, copy buttons, consequence tooltips,
 * container normalisation. No dark-mode logic.
 */

/* ═══════════════ CONTAINER — single shared card for all inner pages ══ */
.gidb-main-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 30px;
  padding: 30px 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  box-sizing: border-box;
}
@media (max-width: 768px) {
  .gidb-main-content { margin: 0 10px 20px; padding: 20px 16px; border-radius: 8px; }
}
@media (max-width: 480px) {
  .gidb-main-content { margin: 0 6px 16px; padding: 12px 10px; }
}

/* ═══════════════════════ VEP BADGES ══════════════════════════════════ */
/* Canonical class names used by gene/region variant tables */
.vep-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.vep-badge.HIGH,     .vep-badge.vep-high     { background: #fed7d7; color: #c53030; }
.vep-badge.MODERATE, .vep-badge.vep-moderate { background: #fefcbf; color: #975a16; }
.vep-badge.LOW,      .vep-badge.vep-low      { background: #c6f6d5; color: #276749; }
.vep-badge.MODIFIER, .vep-badge.vep-modifier { background: #e2e8f0; color: #4a5568; }

/* ════════════════ STICKY TABLE HEADER ═══════════════════════════════ */
/* gene_Table2 only. #variant_Table runs with scrollY, and DataTables moves that
   table's real thead into an id-less clone table to build its fixed header, so
   this selector stops matching once it initialises. Including it here only ever
   painted a black bar during the brief pre-init loading state. */
#gene_Table2 thead tr th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #2d3748;
  color: #e2e8f0;
}

/* #variant_Table's header while its rows are still loading: keep it consistent
   with the light header DataTables renders once the rows arrive. */
#variant_Table thead tr th {
  background: #f7fafc;
  color: #2d3748;
  border-bottom: 1px solid #cbd5e0;
}

/* ═══════════════════ COPY BUTTON ════════════════════════════════════ */
.copy-btn-inline {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  background: #f7fafc;
  color: #4a5568;
  cursor: pointer;
  margin-left: 6px;
  transition: border-color 0.15s, color 0.15s;
  vertical-align: middle;
  line-height: 1.5;
}
.copy-btn-inline:hover { border-color: #3182ce; color: #3182ce; }
.copy-btn-inline.copied { color: #38a169; border-color: #38a169; }

/* ═══════════════════ CONSEQUENCE TOOLTIP ════════════════════════════ */
.conseq-tip { position: relative; }

/* ═══════════════════ COMPACT VARIANT TABLE ══════════════════════════ */
/* gnomAD-style: tight rows, monospace coords, frequency bar */
#variant_Table td,
#variant_Table th,
#gene_Table2 td,
#gene_Table2 th {
  padding: 4px 8px;
  font-size: 0.82rem;
  line-height: 1.4;
}
#variant_Table td:first-child,
#gene_Table2 td:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  white-space: nowrap;
  color: #2b6cb0;
}
#variant_Table .freq-cell,
#gene_Table2 .freq-cell {
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* Frequency mini-bar inside table cell */
.freq-bar-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}
.freq-bar {
  display: inline-block;
  height: 6px;
  background: #3182ce;
  border-radius: 3px;
  min-width: 2px;
  vertical-align: middle;
}
/* Alternating row shade for readability */
#variant_Table tbody tr:nth-child(even),
#gene_Table2 tbody tr:nth-child(even) {
  background: #f7fafc;
}
#variant_Table tbody tr:hover,
#gene_Table2 tbody tr:hover {
  background: #ebf4ff;
}
