/* Gene expression viewer (viewer.html) */

.viewer-controls { max-width: 900px; }

.viewer-options { display: flex; flex-wrap: wrap; gap: 8px 40px; }
.viewer-options fieldset { min-width: 0; }
.viewer-options legend {
  font-size: 14px; font-weight: bold; border: 0; margin-bottom: 2px; width: auto;
}

/* two equal columns; each UMAP starts at the left of its column. The 38px gap
   plus the plots' 12px inner margin gives at least ~50px between the dots. */
.umap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 38px;
  max-width: 85%;
}
@media (max-width: 800px) {
  .umap-grid { grid-template-columns: minmax(0, 1fr); max-width: none; }
}
.label-toggle { display: block; font-weight: normal; margin: 4px 0 0; padding-top: 0; }

/* wider than Bootstrap's fixed container so the UMAPs can be larger */
.viewer-container { width: auto; max-width: 1300px; padding-left: 30px; padding-right: 30px; }
.umap-panel { margin: 0; min-width: 0; }
.umap-panel figcaption { margin-bottom: 8px; font-weight: bold; }
#lblGeneSymbol { font-size: 95%; }
#lblPositive { font-weight: normal; margin-left: 8px; }

.canvas-wrap { position: relative; width: 100%; }
.canvas-wrap canvas { display: block; width: 100%; background: #fff; }

.is-loading .canvas-wrap, .is-loading .violin-plot { opacity: 0.4; transition: opacity 0.2s; }

.viewer-tooltip {
  position: absolute; pointer-events: none; white-space: pre;
  background: rgba(34, 34, 34, 0.9); color: #fff; font-size: 12px;
  padding: 4px 8px; border-radius: 3px;
}

.gradient-legend { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; }
.gradient-bar { display: inline-block; width: 200px; height: 12px; border: 1px solid #ccc; }

.cluster-legend {
  list-style: none; padding: 0; margin: 8px 0; font-size: 13px;
  /* two columns, filled top to bottom, each as wide as its longest name */
  display: grid; grid-auto-flow: column; grid-auto-columns: max-content;
  justify-content: start; column-gap: 32px;
}
.cluster-legend li { margin-bottom: 2px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

.violin-plot { width: 100%; overflow-x: auto; margin: 10px 0 20px; }
.violin-plot svg { display: block; font-size: 12px; font-family: Lato, sans-serif; }
.violin-axis .grid { stroke: #e5e5e5; }
.violin-axis text { fill: #555; }
.violin-dot { fill: #555; fill-opacity: 0.35; }
.violin-median { stroke: #222; stroke-width: 2; }
.violin-label { fill: #333; }

.split-select { margin-top: 10px; }
.split-select label { margin-right: 8px; }
#geneMessage.text-danger { color: #a94442; }
.umap-image { display: block; max-width: 100%; height: auto; }

.gene-row { display: flex; align-items: flex-start; gap: 16px; }
.gene-row .input-group { flex: 1; }
.viewer-options .radio { margin-top: 0; margin-bottom: 4px; }
.expr-panel { margin-bottom: 24px; }
.expr-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
/* display rules above (flex, .btn) would otherwise override the hidden attribute */
#viewer [hidden] { display: none !important; }

.expr-panel { max-width: 760px; }
.umap-grid .umap-panel figcaption { min-height: 46px; }
.norm-info { margin-bottom: 16px; }
.norm-info .msgBox { margin-top: 8px; max-width: 900px; }
