
/* ======================================================
   Baseline
   ====================================================== */
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: Roboto, Inter, Open Sans;
  user-select: none;
  -webkit-user-select: none;
}

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

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

/* ======================================================
   Glass skin
   ====================================================== */
.popover,
#nav-bar,
#floating-legend,
#size-legend-m,
#minimap-panel,
#floating-cont-colorbar .contcb-card {
  background-color: rgba(68, 68, 68, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  color: #DDD;
}

#floating-legend,
#floating-legend *,
#floating-cont-colorbar,
#floating-cont-colorbar * {
  color: #ddd !important;
}

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

/* ======================================================
   Custom search input
   ====================================================== */
#search-wrap {
  position: relative;
  width: 100%;
  background-color: rgba(68, 68, 68, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-sizing: border-box;
  z-index: 5000;
}

/* Strip Dash's wrapper div of all styling */
#search-wrap .dash-input-container,
#search-wrap .dash-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

#search-wrap .dash-input-container:focus-within {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* The actual <input> element */
#search-wrap .dash-input-element,
#search-wrap .dash-input-element:focus,
#search-wrap .dash-input-element:active,
#search-wrap .dash-input-element:focus-visible {
  width: 100%;
  box-sizing: border-box;
  color: #ddd;
  background: transparent !important;
  border: none !important;
  border-radius: 0;
  padding: 8px 28px 8px 10px;
  min-height: 35px;
  font-size: 13px;
  font-weight: 600;
  font-family: Roboto, Inter, Open Sans;
  outline: none !important;
  box-shadow: none !important;
  caret-color: #ddd;
}

#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: 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: rgba(255, 255, 255, 0.9);
}

#search-wrap .dash-input-element::placeholder {
  color: #ddd;
  font-weight: 600;
}

/* Search results dropdown */
#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 450px;
  overflow-y: auto;
  margin-top: 4px;
  background: rgba(50, 50, 50, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  z-index: 5000;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

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

#search-results::-webkit-scrollbar {
  width: 4px;
}

#search-results::-webkit-scrollbar-track {
  background: transparent;
}

#search-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.search-result-item {
  color: #ddd;
  padding: 6px 10px;
  font-size: 13px;
  font-family: Roboto, Inter, Open Sans;
  cursor: pointer;
  border-radius: 4px;
  margin: 2px 4px;
}

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

/* ======================================================
   Category dropdown (my-multi-dropdown)
   ====================================================== */
#my-multi-dropdown {
  width: 100%;
  max-width: 100%;
  background-color: rgba(68, 68, 68, 0.5) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  min-height: 35px !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;
  font-family: Roboto, Inter, Open Sans !important;
}

#my-multi-dropdown input {
  color: #ffffff !important;
  font-family: Roboto, Inter, Open Sans !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: rgba(68, 68, 68, 0.5) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important;
  border-radius: 8px !important;
  padding: 4px !important;
  z-index: 9999 !important;
  color: #ddd !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  max-height: 450px !important;
  box-sizing: border-box !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.dash-dropdown-content::-webkit-scrollbar {
  width: 4px;
}

.dash-dropdown-content::-webkit-scrollbar-track {
  background: transparent;
}

.dash-dropdown-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.dash-dropdown-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

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

.dash-dropdown-option {
  color: #ddd !important;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  font-family: Roboto, Inter, Open Sans;
  padding: 6px 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;
}


/* ======================================================
   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: #ddd;
  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;
  font-family: Roboto, Inter, Open Sans;
  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;
  font-family: Roboto, Inter, Open Sans;
  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;
  font-family: Roboto, Inter, Open Sans;
  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: #ddd;
  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: 2000;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  display: none;
}

#info-box {
  top: 15px;
  right: 15px;
  left: auto;
  width: 275px;
  z-index: 100002;
}

#help-popover {
  top: 15px;
  right: 15px;
  left: auto;
  width: 275px;
  z-index: 100002;
}

#function-drawer {
  top: 15px;
  right: 15px;
  left: auto;
  width: 275px;
  overflow: hidden;
  z-index: 100003;
}

#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 {
  text-decoration: none;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  color: #ddd;
}

/* ======================================================
   Title
   ====================================================== */
#graph-title {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  color: #eee;
  font-size: 15px;
  font-weight: 600;
  z-index: 1000;
  pointer-events: none;
  white-space: nowrap;
}

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

#nav-bar button {
  background: transparent;
  border: none;
  color: #ddd;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
}

#nav-bar button:hover {
  background-color: rgba(255,255,255,0.1);
}

#nav-bar button:disabled {
  color: #555;
  pointer-events: none;
  opacity: 0.25;
}

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

/* ======================================================
   Floating legend + continuous colorbar
   ====================================================== */
#floating-legend {
  position: fixed;
  z-index: 3000;
  max-height: 70vh;
  overflow-y: auto;
  border-radius: 10px;
  padding: 10px 12px;
  display: none;
  box-sizing: border-box;
}

#floating-cont-colorbar {
  position: fixed;
  z-index: 3000;
  display: none;
  pointer-events: none;
}

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

.contcb-title {
  font-size: 12px;
  text-align: center;
  margin-bottom: 6px;
}

.contcb-txt {
  font-size: 11px;
  text-align: center;
}

.contcb-bar {
  height: 220px;
  width: 12px;
  margin: 0 auto;
  border-radius: 6px;
  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: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

#btn-close-function, #btn-close-info {
  background: transparent;
  border: none;
  color: #ddd;
  cursor: pointer;
  font-size: 16px;
  line-height: 16px;
}

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

/* ======================================================
   Minimap
   ====================================================== */
#minimap-panel {
  background: rgba(0,0,0,1) !important;
  border: 1px solid rgba(255,255,255,0.28) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.65) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

