
/* ======================================================
   Baseline
   ====================================================== */
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#app-root {
  width: 100vw;
  height: 100vh;
  background: #000019;
}

#graph {
  width: 100%;
  height: 100%;
}

/* ======================================================
   Panel skin
   ====================================================== */
.popover,
#nav-bar {
  background-color: #141726;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--scuba-muted);
}


/* ======================================================
   Controls stack
   ====================================================== */
#control-stack {
  display: flex;
  flex-direction: column;
}

#search-wrap,
#search-wrap *,
#my-multi-dropdown,
#my-multi-dropdown * {
  pointer-events: auto !important;
}

/* ── Input / dropdown icons ─────────────────────────────────────── */
.input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 1;
  pointer-events: none;
  z-index: 2;
}

#search-input-container #search-input {
  padding-left: 32px !important;
}

#palette-icon {
  z-index: 4001;
}

#my-multi-dropdown .dash-dropdown-trigger {
  padding-left: 32px !important;
  padding-right: 4px !important;
}

/* ======================================================
   Custom search input
   ====================================================== */
#search-wrap {
  position: relative;
  width: 100%;
  background-color: #141726;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  box-sizing: border-box;
  z-index: 5000;
}

/* dbc.Input renders <input id="search-input" class="form-control"> directly */
#search-input,
#search-input:focus,
#search-input:active,
#search-input:focus-visible {
  width: 100%;
  box-sizing: border-box;
  color: var(--scuba-muted) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 8px 28px 8px 10px;
  min-height: 3.4vw;
  font-size: 14px;
  font-weight: 400;
  outline: none !important;
  box-shadow: none !important;
  caret-color: var(--scuba-text);
}

#search-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.4);
}

#btn-clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--bs-secondary-color, rgba(255,255,255,0.5));
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  z-index: 1;
}

#btn-clear-search:hover {
  color: var(--bs-body-color, rgba(255,255,255,0.9));
}

#search-input::placeholder {
  color: var(--scuba-muted);
  font-weight: 400;
  opacity: 1;
}

/* Search results dropdown */
#search-results {
  position: absolute;
  top: 100%;
  left: 7;
  right: 7;
  max-height: 450px;
  overflow-y: auto;
  margin-top: 4px;
  background: #141726;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  z-index: 5000;
}

#search-results:empty {
  display: none;
}

.search-result-item {
  color: #bbb;
  padding: 1px 10px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  border-radius: 4px;
  margin: 1px 4px;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #bbb;
}

/* ======================================================
   Category dropdown (my-multi-dropdown)
   ====================================================== */
#my-multi-dropdown {
  width: 100%;
  max-width: 100%;
  background-color: #141726 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 4px !important;
  box-sizing: border-box !important;
  min-height: 3.4vw !important;
  z-index: 4000 !important;
  color: #ffffff !important;
}

#my-multi-dropdown,
#my-multi-dropdown * {
  outline: none !important;
  box-shadow: none !important;
}

#my-multi-dropdown:focus-within {
  border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Trigger text */
#my-multi-dropdown .dash-dropdown-trigger,
#my-multi-dropdown [class*="singleValue"],
#my-multi-dropdown [class*="placeholder"],
#my-multi-dropdown span {
  color: #ddd !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

#my-multi-dropdown input {
  color: #ffffff !important;
}

/* Arrow + clear X */
#my-multi-dropdown svg {
  fill: #DDD !important;
  color: #DDD !important;
}

#my-multi-dropdown [class*="indicatorContainer"] svg {
  fill: #DDD !important;
}

#my-multi-dropdown [class*="clearIndicator"],
#my-multi-dropdown [class*="dropdownIndicator"] {
  color: #DDD !important;
  padding: 4px !important;
}

#my-multi-dropdown [class*="indicatorContainer"] {
  padding: 0 6px !important;
}

/* Popover menu */
.dash-dropdown-content {
  background-color: #141726 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 4px !important;
  padding: 4px !important;
  z-index: 9999 !important;
  color: #ddd !important;
  width: 280px !important;
  min-width: 280px !important;
  max-width: 280px !important;
  max-height: 450px !important;
  box-sizing: border-box !important;
}

/* Options */
.dash-dropdown-options {
  padding: 2px !important;
}

.dash-dropdown-option {
  color: #ddd !important;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 400;
  padding: 4px 10px;
}


.dash-dropdown-option:hover,
.dash-dropdown-option[data-highlighted] {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

.dash-dropdown-option[aria-selected="true"] {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

/* ── Disease toggle (CD / UC / Both) ──────────────────────────────── */
.disease-toggle-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  gap: 8px;
}


.disease-toggle-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--scuba-muted);
  white-space: nowrap;
}



/* ======================================================
   Inline edit panel (in info box)
   ====================================================== */
#edit-panel label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  margin-bottom: 2px;
  margin-top: 6px;
}

#edit-panel label:first-child {
  margin-top: 0;
}

#edit-panel .dash-input-container,
#edit-panel .dash-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

#edit-panel .dash-input-element {
  width: 100%;
  box-sizing: border-box;
  color: var(--scuba-text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  outline: none !important;
  box-shadow: none !important;
}

#edit-panel .dash-input-element:focus {
  border-color: rgba(255, 255, 255, 0.4) !important;
  background: rgba(255, 255, 255, 0.12);
}

#btn-save-edit {
  flex: 1;
  background: rgba(50, 140, 70, 0.35);
  border: 1px solid rgba(80, 180, 100, 0.5);
  border-radius: 4px;
  color: rgba(150, 230, 150, 0.9);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#btn-save-edit:hover {
  background: rgba(50, 140, 70, 0.55);
}

#btn-delete-node {
  flex: 1;
  background: rgba(140, 40, 40, 0.35);
  border: 1px solid rgba(180, 80, 80, 0.5);
  border-radius: 4px;
  color: rgba(230, 130, 130, 0.9);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#btn-delete-node:hover {
  background: rgba(140, 40, 40, 0.55);
}

#delete-confirm-panel {
  margin-top: 6px;
}

#delete-confirm-text {
  font-size: 11px;
  color: rgba(230, 150, 150, 0.9);
  margin-bottom: 6px;
  text-align: center;
}

#btn-delete-cancel {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  color: var(--scuba-text);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#btn-delete-confirm {
  flex: 1;
  background: rgba(140, 40, 40, 0.5);
  border: 1px solid rgba(180, 80, 80, 0.6);
  border-radius: 4px;
  color: rgba(230, 130, 130, 1.0);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#edit-status {
  font-size: 11px;
  color: rgba(100, 200, 100, 0.8);
  margin-top: 4px;
  min-height: 14px;
}

/* ======================================================
   Popovers
   ====================================================== */
.popover {
  position: fixed;
  z-index: 100000;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  display: none;
  max-width: none;
}

#info-box {
  top: 15px;
  right: 15px;
  left: auto;
  width: 300px;
  max-height: 38vw;
  overflow-y: auto;
}

#help-popover {
  top: 15px;
  right: 15px;
  left: auto;
  width: 300px;
}

#function-drawer {
  top: 15px;
  right: 15px;
  left: auto;
  width: 300px;
  overflow: hidden;
}

#info-box .info-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
}

#info-box .info-actions button {
  width: 100%;
  max-width: 200px;
}

#info-box .info-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#hpa-link,
#ot-link {
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: var(--scuba-text);
}

/* ======================================================
   Title
   ====================================================== */
#graph-title {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  pointer-events: none;
  display: flex;
  gap: 0;
  align-items: center;
}
.graph-title-chip {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--scuba-muted);
  background: #141726;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 4px 13px;
  white-space: nowrap;
}
.graph-title-chip--ct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 11px 2px 5px;
}
.graph-title-chip-icon {
  height: 24px;
  width: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ======================================================
   Nav bar
   ====================================================== */
#nav-bar {
  position: fixed;
  display: flex;
  align-items: stretch;
  gap: 2px;
  z-index: 1000;
  height: 3.4vw;
  padding: 2px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 4px;
}

#nav-bar .btn {
  --bs-btn-color:        var(--bs-body-color);
  --bs-btn-hover-color:  #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-focus-box-shadow: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#nav-bar .btn:disabled,
#nav-bar .btn.disabled {
  opacity: 0.25 !important;
  pointer-events: none;
}

#nav-bar .btn:disabled:hover,
#nav-bar .btn:disabled * {
  background-color: transparent !important;
}

#nav-bar img {
  width: 12px;
  height: 12px;
  display: block;
}

.contcb-card {
  padding: 8px;
  border-radius: 4px;
}

.contcb-title {
  font-size: 12px;
  text-align: center;
  margin-bottom: 6px;
  color: var(--scuba-muted);
}

.contcb-txt {
  font-size: 11px;
  text-align: center;
  color: var(--scuba-muted);
}

.contcb-bar {
  height: 220px;
  width: 12px;
  margin: 0 auto;
  border-radius: 4px;
  border: 1px solid #222;
}

/* ======================================================
   Function drawer
   ====================================================== */
#function-drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#function-drawer-title {
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

.btn-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.btn-close:hover {
  color: #fff;
}

#function-drawer-body {
  padding: 12px;
  overflow-y: auto;
  max-height: calc(90vh - 52px);
  white-space: pre-wrap;
  line-height: 1.35;
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* ======================================================
   Landing page
   ====================================================== */
#cell-selector-page {
  position: fixed;
  top: calc(30px + 3.4vw);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

#landing-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 1200px;
  height: 100%;
  padding: 15px 32px 10px;
  box-sizing: border-box;
  gap: 6px;
  overflow: hidden;
}


#landing-body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1 1 0;
  min-height: 0;
  gap: 24px;
}

#landing-controls {
  display: grid;
  grid-template-columns: max-content;
  justify-content: center;
  align-content: center;
  gap: 20px;
  padding: 0 0 32px 0;
  flex: 0 0 auto;
}

.landing-control-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

#landing-controls .seg-radio-v {
  width: 100%;
}

#landing-chart-frame {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #141726;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 4px;
  overflow: hidden;
  padding: 28px 28px 0;
}

#landing-chart {
  cursor: default;
}

#landing-cell-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding-top: 10px;
  padding-bottom: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}

.landing-cat-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: opacity 0.2s;
}

.landing-cat-cells {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1;
  min-width: 0;
}

.landing-svg-slot {
  flex: 1;
  min-width: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.2s;
}

.landing-svg-img {
  display: block;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.landing-svg-slot:hover .landing-svg-img {
  opacity: 1;
}

.landing-svg-label {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
}

.landing-cat-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  font-size: 11px;
  font-weight: 400;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  margin-top: 6px;
  pointer-events: none;
}

.landing-cat-label::before {
  content: '';
  align-self: stretch;
  height: 5px;
  margin: 0 2px 4px;
  border-bottom: 1px solid #999;
  border-left: 1px solid #999;
  border-right: 1px solid #999;
}


.landing-control-label {
  font-size: 11px;
  color: var(--scuba-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

/* Span fills button as flex child — keeps text in flow for correct max-content sizing */
#landing-controls .seg-radio-btn {
  padding: 0;
  display: flex;
}
#landing-controls .seg-radio-btn span[data-tooltip] {
  flex: 1;
  padding: 3px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}


