/**
 * MemGraph Explorer - Visualization Panel
 * Estilos do painel de visualização do grafo
 */

/* Visualization Controls */
.visualization-controls {
  display: none;
}

/* ============================================================
   Empty State — exibido quando não há dados no grafo
   ============================================================ */

.vis-canvas-empty-state {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(145deg, #eef4fb 0%, #e4edf8 50%, #dce8f4 100%);
  border-radius: 0 0 10px 10px;
  padding: 24px 20px;
  text-align: center;
  animation: emptyStateFadeIn 0.4s ease-out;
}

.vis-canvas-empty-state.vis-hidden {
  display: none;
}

@keyframes emptyStateFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gráfico SVG ilustrativo */
.vis-empty-graphic {
  flex-shrink: 0;
}

.vis-empty-svg {
  width: 180px;
  height: 148px;
}

.vis-empty-line {
  stroke: #93bad8;
  stroke-width: 2.2;
  stroke-dasharray: 6 4;
  stroke-linecap: round;
  opacity: 0.65;
}

.vis-empty-node {
  fill: #c8dff2;
  stroke: #7aafd4;
  stroke-width: 1.8;
}

.vis-empty-node--center {
  fill: #4e79a7;
  stroke: #2c5282;
  stroke-width: 2.5;
  filter: drop-shadow(0 3px 8px rgba(78, 121, 167, 0.45));
}

.vis-empty-node--sm {
  opacity: 0.78;
}

.vis-empty-node-icon {
  fill: #fff;
  font-size: 18px;
  font-family: system-ui, sans-serif;
  font-weight: 700;
  pointer-events: none;
}

/* Texto do empty state */
.vis-empty-title {
  font-size: var(--explorer-fs-base);
  font-weight: 700;
  color: #1e3a5f;
  margin: 0;
  line-height: 1.3;
}

.vis-empty-desc {
  font-size: var(--explorer-fs-sm);
  color: #5a7a9b;
  margin: 0;
  max-width: 380px;
  line-height: 1.6;
}

/* Botões do empty state */
.vis-empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.vis-empty-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--pli-blue, #116593);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: var(--explorer-fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.18s,
    transform 0.12s;
  box-shadow: 0 2px 8px rgba(17, 101, 147, 0.35);
}

.vis-empty-btn-primary:hover {
  background: var(--pli-navy, #1c3d59);
  transform: translateY(-1px);
}

.vis-empty-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--pli-blue, #116593);
  border: 1.5px solid rgba(17, 101, 147, 0.35);
  border-radius: 8px;
  font-size: var(--explorer-fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.vis-empty-btn-secondary:hover {
  background: #e8f2fb;
  border-color: var(--pli-blue, #116593);
  transform: translateY(-1px);
}

/* Dicas na base do empty state */
.vis-empty-hints {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.vis-empty-hint {
  font-size: var(--explorer-fs-2xs);
  color: #7a9cba;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vis-empty-hint i {
  font-size: var(--explorer-fs-2xs);
  opacity: 0.75;
}

/* ============================================================
   Loading State — exibido durante carregamento
   ============================================================ */

.vis-canvas-loading {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(238, 244, 251, 0.9);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.vis-canvas-loading.vis-hidden {
  display: none;
}

.vis-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid #c8dff2;
  border-top-color: var(--pli-blue, #116593);
  border-radius: 50%;
  animation: visSpin 0.8s linear infinite;
}

@keyframes visSpin {
  to {
    transform: rotate(360deg);
  }
}

.vis-loading-text {
  font-size: var(--explorer-fs-sm);
  font-weight: 600;
  color: #3b6491;
}

.vis-float-panel {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}

/* Mode switcher: seções 2D / 3D empilhadas */
.vis-float-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vis-float-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
  font-size: var(--explorer-fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.vis-float-mode-btn.active {
  background: var(--pli-blue, #116593);
  color: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.vis-float-mode-btn:hover:not(.active) {
  background: #e8f0fe;
  color: #1e3a5f;
}

/* Control buttons inside each mode section */
.vis-float-controls {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  margin-top: 2px;
}

.vis-float-controls.vis-hidden {
  display: none;
}

.vis-float-controls .vis-ctrl-btn.active {
  background: var(--pli-blue, #116593);
  color: #fff;
}

/* Separator line */
.vis-ctrl-sep {
  width: 100%;
  height: 1px;
  background: #e2e8f0;
  margin: 2px 0;
  flex-shrink: 0;
}

/* Control button */
.vis-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-size: var(--explorer-fs-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.vis-ctrl-btn:hover {
  background: #e8f0fe;
  border-color: #93b4d4;
  color: #1e3a5f;
}

.vis-ctrl-btn:active {
  background: #d0dff3;
}

.vis-ctrl-btn.active {
  background: var(--pli-blue, #116593);
  border-color: var(--pli-navy, #1c3d59);
  color: #ffffff;
}

.vis-ctrl-btn.active:hover {
  background: var(--pli-navy, #1c3d59);
  color: #ffffff;
}

.btn-icon-large {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--explorer-fs-md);
  font-weight: 500;
}

.btn-icon-large:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Network Canvas */
.network-canvas-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 480px;
  height: auto;
  display: block;
  transition: height 0.3s ease;
}

.network-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #f0f4fa 0%, #e2eaf6 50%, #dce5f2 100%);
  overflow: hidden;
}

.network-canvas-3d {
  background: linear-gradient(145deg, #f0f4fa 0%, #e2eaf6 50%, #dce5f2 100%);
}

.network-canvas.vis-hidden,
.network-canvas-3d.vis-hidden {
  display: none;
}

/* Visualization Legend */
.visualization-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.legend-item {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--explorer-fs-xs);
  font-family: inherit;
  color: #495057;
  background: #f5f9ff;
  border: 1px solid #d6e5f5;
  border-radius: 999px;
  padding: 4px 8px;
  cursor: default;
  transition: all 0.2s ease;
}

.legend-item:hover {
  background: #e8f2ff;
  border-color: #bad2ec;
}

.legend-item.is-hidden {
  opacity: 0.55;
  text-decoration: line-through;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset -2px -2px 4px rgba(0, 0, 0, 0.15),
    inset 2px 2px 4px rgba(255, 255, 255, 0.3);
}

.legend-pessoa {
  background: #2d8ad3;
}

.legend-usuario {
  background: #1fa971;
}

.legend-arquivo {
  background: #f39c12;
}

.legend-instituicao {
  background: #0f4f7a;
}

/* Results Panel */
.results-view {
  display: none;
  padding: 20px;
  overflow: auto;
  flex: 1;
}

.results-view.active {
  display: block;
}

.results-info {
  padding: 10px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--explorer-fs-md);
  color: #6c757d;
}

.results-controls {
  display: flex;
  gap: 8px;
}

.btn-view {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--explorer-fs-sm);
}

.btn-view.active {
  background: rgba(255, 255, 255, 0.4);
}

.btn-view:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Results Table */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--explorer-fs-md);
}

.results-table th {
  background: #f8f9fa;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
  position: sticky;
  top: 0;
}

.results-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #e9ecef;
}

.results-table tr:hover {
  background: #f8f9fa;
}

/* JSON Display */
.json-display {
  background: #263238;
  color: #aed581;
  padding: 20px;
  border-radius: 6px;
  font-family: "Fira Code", "Monaco", "Courier New", monospace;
  font-size: var(--explorer-fs-md);
  line-height: 1.6;
  overflow-x: auto;
}

.json-display .key {
  color: #82aaff;
}

.json-display .string {
  color: #c3e88d;
}

.json-display .number {
  color: #f78c6c;
}

.json-display .boolean {
  color: #ff5370;
}

.json-display .null {
  color: #697098;
}

/* Value Formatting */
.null-value {
  color: #999;
  font-style: italic;
}

.bool-value {
  color: #f39c12;
  font-weight: 600;
}

.number-value {
  color: #e74c3c;
}

.node-ref {
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: var(--explorer-fs-xs);
  font-weight: 500;
}

.edge-ref {
  background: #e8f3fd;
  color: #0f4f7a;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: var(--explorer-fs-xs);
  font-weight: 500;
}

.empty-message {
  text-align: center;
  padding: 40px 20px;
  color: #adb5bd;
  font-size: var(--explorer-fs-md);
}

/* Node Sidebar (painel direito) */
.node-sidebar {
  position: fixed;
  top: var(--navbar-total-offset, 96px);
  right: 0;
  width: 380px;
  height: calc(100dvh - var(--navbar-total-offset, 96px));
  max-height: calc(100dvh - var(--navbar-total-offset, 96px));
  background: #fff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 10050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

/* Modal (usado para resultados) */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10040;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-content--wide {
  max-width: 900px;
  width: 95%;
  max-height: 85vh;
}

.modal-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #0f4f7a 0%, #1f6fa8 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: var(--explorer-fs-lg);
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  font-size: var(--explorer-fs-sm);
}

.node-sidebar.open {
  transform: translateX(0);
}

.node-sidebar-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #0f4f7a 0%, #1f6fa8 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.node-sidebar-header h3 {
  margin: 0;
  font-size: var(--explorer-fs-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

.node-sidebar-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.node-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.node-sidebar-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  font-size: var(--explorer-fs-sm);
}

.node-sidebar-footer {
  padding: 8px 12px;
  background: #f4f8fc;
  border-top: 1px solid #d9e5f2;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.node-sidebar-footer .btn-sm {
  padding: 6px 8px;
  font-size: var(--explorer-fs-2xs);
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sm {
  padding: 8px 14px;
  font-size: var(--explorer-fs-2xs);
}

/* Relacionamentos na sidebar */
.rel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.rel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f0f6fc;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.rel-item:hover {
  background: #ddeaf7;
  border-color: #9ebfdd;
  transform: translateX(3px);
}

.rel-direction {
  font-size: var(--explorer-fs-md);
  font-weight: 700;
  color: #1f6fa8;
  min-width: 18px;
  text-align: center;
}

.rel-type-badge {
  font-size: var(--explorer-fs-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #1f6fa8;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.rel-target {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.rel-target-label {
  font-size: var(--explorer-fs-xs);
  font-weight: 500;
  color: #12324a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rel-target-type {
  font-size: var(--explorer-fs-2xs);
  color: #6c8a9e;
  white-space: nowrap;
}

.rel-empty {
  font-size: var(--explorer-fs-xs);
  color: #6c8a9e;
  font-style: italic;
  padding: 8px 0;
}

.rel-list::-webkit-scrollbar {
  width: 5px;
}

.rel-list::-webkit-scrollbar-track {
  background: transparent;
}

.rel-list::-webkit-scrollbar-thumb {
  background: rgba(31, 111, 168, 0.25);
  border-radius: 3px;
}

.rel-list::-webkit-scrollbar-thumb:hover {
  background: rgba(31, 111, 168, 0.45);
}

@media (max-width: 640px) {
  .node-sidebar {
    width: 100%;
    top: var(--navbar-height-mobile, 60px);
    height: calc(100dvh - var(--navbar-height-mobile, 60px));
    max-height: calc(100dvh - var(--navbar-height-mobile, 60px));
  }
}

.btn-secondary {
  background: #6c757d;
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: var(--explorer-fs-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

/* Node Details */
.node-details {
  font-size: 7.5px;
  color: #1a3a54;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

.node-details p {
  margin: 0 0 4px 0;
  color: #1a3a54;
  font-size: 7.5px;
  line-height: 1.35;
}

.node-details p strong {
  color: #12324a;
  font-weight: 700;
  font-size: 7.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.node-identity {
  background: linear-gradient(135deg, #f0f6fc 0%, #e8f0fe 100%);
  border: 1px solid #d0dce8;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.node-id-line code {
  background: #e2e8f0;
  color: #2d3748;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 8.5px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.node-id-internal {
  color: #94a3b8;
  font-size: 8.5px;
  margin-left: 4px;
}

.node-details h4 {
  margin: 12px 0 6px 0;
  color: #1f6fa8;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.node-details h4 i {
  margin-right: 4px;
  font-size: 9px;
}

.properties-list {
  display: table;
  width: 100%;
  border-collapse: collapse;
}

.property-row {
  display: table-row;
}

.property-row:hover {
  background: #f0f4f8;
}

.property-row--metric:hover {
  background: #f3e8ff;
}

.node-sidebar .node-details .property-key {
  display: table-cell;
  font-weight: 700;
  color: #334155;
  font-size: 9.5px !important;
  line-height: 1.35;
  padding: 3px 6px 3px 0;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
  border-bottom: 1px solid #eef1f5;
}

.node-details .property-key--metric {
  color: #7c3aed;
}

.node-sidebar .node-details .property-value {
  display: table-cell;
  color: #1e293b;
  font-weight: 500;
  font-size: 9.5px !important;
  line-height: 1.35;
  padding: 3px 0 3px 6px;
  text-align: right;
  vertical-align: top;
  word-break: break-word;
  border-bottom: 1px solid #eef1f5;
}

/* Valores de propriedade — estilo uniforme, sem destaque individual */
.prop-val-null,
.prop-val-date,
.prop-val-size,
.prop-val-number,
.prop-val-text,
.prop-val-cpf,
.prop-val-cnpj,
.prop-val-bool {
  color: inherit;
  font: inherit;
  background: none;
  padding: 0;
  border-radius: 0;
  display: inline;
  letter-spacing: normal;
}

.prop-val-null {
  font-style: italic;
  color: #94a3b8;
}

.prop-val-url {
  color: #2563eb;
  text-decoration: none;
  word-break: break-all;
}

.prop-val-url:hover {
  text-decoration: underline;
}

/* Keywords — inline simples */
.prop-val-keywords {
  display: inline;
}

.keyword-badge {
  display: inline;
  font: inherit;
  color: inherit;
  background: none;
  padding: 0;
  border: none;
}

.keyword-badge::after {
  content: ", ";
}

.keyword-badge:last-child::after {
  content: "";
}

/* Métricas em details/summary colapsável */
.metrics-details {
  margin-top: 12px;
  border: 1px solid #e9d5ff;
  border-radius: 8px;
  overflow: hidden;
}

.metrics-details summary {
  padding: 6px 10px;
  background: #faf5ff;
  color: #7c3aed;
  font-size: 7px;
  font-weight: 600;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.metrics-details summary:hover {
  background: #f3e8ff;
}

.metrics-details summary i {
  margin-right: 6px;
}

.properties-list--metrics {
  padding: 4px;
}

/* ── Tooltip do vis.js (hover sobre nós) ── */
.vis-tooltip {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18) !important;
  border-radius: 6px !important;
  pointer-events: none !important;
  max-width: 360px !important;
  line-height: 1.5 !important;
}

/* ============================================================
   Toolbar de Análise Visual
   ============================================================ */

.vis-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #eef3f9;
  border-bottom: 1px solid #d9e5f2;
}

.vis-layout-help {
  padding: 6px 10px 7px;
  background: #f8fbfe;
  border-bottom: 1px solid #d9e5f2;
  color: #50657a;
  font-size: var(--explorer-fs-xs);
  line-height: 1.4;
}

.vis-layout-guide {
  position: absolute;
  top: 84px;
  left: 12px;
  z-index: 32;
  width: min(940px, calc(100% - 24px));
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(240px, 1fr) minmax(
      220px,
      0.95fr
    );
  gap: 10px;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, #f8fbfe 0%, #f2f7fc 100%);
  border: 1px solid #d9e5f2;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(28, 61, 89, 0.18);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.vis-layout-guide.vis-hidden {
  display: none;
}

.vis-layout-guide.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.vis-layout-guide::before {
  content: "";
  position: absolute;
  top: -8px;
  left: var(--vis-tooltip-anchor-left, 48px);
  width: 14px;
  height: 14px;
  background: #f8fbfe;
  border-left: 1px solid #d9e5f2;
  border-top: 1px solid #d9e5f2;
  transform: rotate(45deg);
}

.vis-layout-guide__block {
  min-width: 0;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #d8e4ef;
  border-radius: 8px;
}

.vis-layout-guide__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  color: #4f6780;
  font-size: var(--explorer-fs-2xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.vis-layout-guide__title {
  margin: 0 0 4px;
  color: #1e3a5f;
  font-size: var(--explorer-fs-sm);
  font-weight: 700;
  line-height: 1.35;
}

.vis-layout-guide__desc {
  margin: 0;
  color: #566f88;
  font-size: var(--explorer-fs-xs);
  line-height: 1.45;
}

.vis-layout-guide__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vis-layout-guide__list li {
  color: #38516b;
  font-size: var(--explorer-fs-xs);
  line-height: 1.45;
}

.vis-layout-guide__state {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.vis-layout-guide__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eaf3fb;
  border: 1px solid #cfe0ef;
  color: #31516d;
  font-size: var(--explorer-fs-2xs);
  font-weight: 600;
  line-height: 1.3;
}

.vis-layout-guide__pill.is-warning {
  background: #fff4df;
  border-color: #f1d7a5;
  color: #7a5818;
}

.vis-layout-guide__pill.is-ok {
  background: #e8f7ee;
  border-color: #b9ddc7;
  color: #226245;
}

@media (max-width: 1180px) {
  .vis-layout-guide {
    grid-template-columns: 1fr;
  }
}

.vis-toolbar-sep {
  width: 1px;
  height: 20px;
  background: #d0dce8;
  margin: 0 2px;
  flex-shrink: 0;
}

/* Quick search group */
.vis-quicksearch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fff;
  border: 1px solid #c8d6e5;
  border-radius: 5px;
  padding: 0 4px 0 6px;
  height: 28px;
}

.vis-quicksearch__label {
  font-size: var(--explorer-fs-xs, 0.68rem);
  font-weight: 600;
  color: var(--pli-blue, #116593);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.vis-quicksearch__input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.56rem;
  color: #1f3f5c;
  width: 130px;
  padding: 0 2px;
  font-family: Inter, system-ui, sans-serif;
}

.vis-quicksearch__input::placeholder {
  color: #9fb3c8;
  font-style: italic;
}

.vis-quicksearch .vis-btn-toggle {
  border: none;
  background: transparent;
  color: var(--pli-blue, #116593);
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.vis-quicksearch .vis-btn-toggle:hover {
  background: #e8f2fa;
  border-radius: 4px;
}

/* Button group (pill radio) */
.vis-btn-group {
  display: flex;
}

.vis-layout-menu {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vis-layout-menu.vis-hidden {
  display: none;
}

.vis-layout-menu__label {
  font-size: var(--explorer-fs-xs);
  font-weight: 700;
  color: #50657a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.vis-layout-group .vis-btn-pill {
  min-width: 0;
}

.vis-btn-group .vis-btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  height: 28px;
  border: 1px solid #c8d6e5;
  background: #fff;
  font-size: var(--explorer-fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #495057;
}

.vis-btn-group .vis-btn-pill:first-child {
  border-radius: 4px 0 0 4px;
}

.vis-btn-group .vis-btn-pill:last-child {
  border-radius: 0 4px 4px 0;
}

.vis-btn-group .vis-btn-pill:not(:first-child) {
  border-left: none;
}

.vis-btn-group .vis-btn-pill.active {
  background: var(--pli-blue, #116593);
  color: #fff;
  border-color: var(--pli-blue, #116593);
}

.vis-btn-group .vis-btn-pill:hover:not(.active) {
  background: #e2e8f0;
}

/* Toggle buttons (icon-only) */
.vis-btn-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #c8d6e5;
  border-radius: 5px;
  background: #fff;
  font-size: var(--explorer-fs-md);
  cursor: pointer;
  transition: all 0.15s ease;
  color: #495057;
}

.vis-btn-toggle:hover:not(.active) {
  background: #e2e8f0;
}

.vis-btn-toggle.active {
  background: var(--pli-blue, #116593);
  color: #fff;
  border-color: var(--pli-blue, #116593);
}

/* Force strength slider group */
.vis-force-slider-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vis-force-slider {
  width: 64px;
  height: 4px;
  cursor: pointer;
  accent-color: var(--pli-blue, #116593);
  vertical-align: middle;
}

.vis-force-slider-label {
  font-size: var(--explorer-fs-sm);
  font-weight: 600;
  color: var(--pli-blue, #116593);
  min-width: 12px;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
}

/* Status bar for path mode */
.vis-status-path {
  padding: 4px 12px;
  background: #fff3cd;
  border-bottom: 1px solid #ffc107;
  color: #856404;
  font-size: var(--explorer-fs-sm);
  text-align: center;
}

/* Mode tooltip on 2D/3D buttons */
.vis-float-mode-btn {
  position: relative;
}

.vis-float-mode-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  font-size: var(--explorer-fs-2xs);
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ============================================================
   Minimap
   ============================================================ */

.vis-minimap {
  position: absolute;
  bottom: 10px;
  left: 10px;
  border: 1px solid #c8d6e5;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 10;
  width: 180px;
  height: 120px;
}

/* ============================================================
   Stats Bar
   ============================================================ */

.vis-stats-bar {
  padding: 4px 14px;
  background: #f0f4f8;
  border-top: 1px solid #d9e5f2;
  font-size: var(--explorer-fs-xs);
  color: #6c757d;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 28px;
}

.vis-stats-counts {
  white-space: nowrap;
  font-size: var(--explorer-fs-xs);
}

.vis-stats-sep {
  color: #cbd5e1;
  font-size: var(--explorer-fs-2xs);
}

.vis-stats-bar strong {
  color: var(--pli-text);
}

.vis-legend-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================================================
   Algorithm Status Indicator
   ============================================================ */

.vis-algo-status {
  display: none;
  padding: 2px 10px;
  border-radius: 4px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #0c4a6e;
  font-size: var(--explorer-fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.vis-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 1px 7px 1px 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #e2e8f0;
  transition:
    opacity 0.18s,
    background 0.18s;
  white-space: nowrap;
  font-size: var(--explorer-fs-2xs);
  color: #475569;
  -webkit-user-select: none;
  user-select: none;
}

.vis-legend-item:hover {
  background: #e2e8f0;
}

.vis-legend-item.dimmed {
  opacity: 0.35;
  text-decoration: line-through;
}

.vis-legend-item strong {
  font-weight: 600;
  color: var(--pli-text);
  margin-left: 1px;
}

.vis-legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  .vis-toolbar {
    gap: 3px;
    padding: 3px 6px;
  }

  .vis-minimap {
    display: none;
  }

  .vis-float-panel {
    left: 6px;
    top: 6px;
  }
}

/* ═══════════════════════════════════════════════════════
   Graph Insight Panel — Explicação de resultados
   ═══════════════════════════════════════════════════════ */

.graph-insight-panel {
  margin-top: 8px;
  background: #fff;
  border: 1px solid #d0dce8;
  border-left: 4px solid var(--pli-blue, #116593);
  border-radius: 6px;
  overflow: hidden;
  animation: insightSlideIn 0.22s ease;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

@keyframes insightSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: linear-gradient(90deg, #eef5fb 0%, #f7fafd 100%);
  border-bottom: 1px solid #d0dce8;
  font-size: var(--explorer-fs-sm, 0.78rem);
  font-weight: 600;
  color: var(--pli-blue, #116593);
}

.insight-header i#insight-icon {
  font-size: 0.88rem;
  flex-shrink: 0;
}

.insight-header #insight-title {
  flex: 1;
  font-size: 0.78rem;
}

.insight-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #7a90a4;
  font-size: 0.82rem;
  padding: 3px 5px;
  border-radius: 3px;
  line-height: 1;
  flex-shrink: 0;
}

.insight-close:hover {
  background: #e4edf5;
  color: #1f3f5c;
}

.insight-body {
  padding: 12px 14px;
  font-size: 0.74rem;
  color: #2d4a60;
  line-height: 1.55;
  text-align: justify;
  overflow-x: hidden;
  word-break: break-word;
}

/* Summary paragraph */
.ins-summary {
  margin: 0 0 10px;
  color: #2d4a60;
  text-align: justify;
}

/* Ranking table */
.ins-table-wrap {
  overflow-x: auto;
  margin-bottom: 10px;
  border-radius: 4px;
  border: 1px solid #e5edf5;
}

.ins-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}

.ins-table th {
  text-align: left;
  font-weight: 600;
  color: #50657a;
  background: #f4f8fb;
  border-bottom: 1px solid #d0dce8;
  padding: 5px 8px;
  white-space: nowrap;
}

.ins-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #eef3f9;
  vertical-align: middle;
}

.ins-table tr:last-child td {
  border-bottom: none;
}

.ins-table tr:hover td {
  background: #f7fbfe;
}

.ins-rank {
  color: #50657a;
  font-weight: 700;
  width: 28px;
  font-size: 0.68rem;
}

.ins-name {
  font-weight: 500;
  color: #1f3f5c;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ins-type {
  color: #50657a;
  white-space: nowrap;
  font-size: 0.68rem;
}

.ins-score {
  font-family: "Courier New", monospace;
  font-size: 0.66rem;
  color: #50657a;
  white-space: nowrap;
}

.ins-bar {
  width: 90px;
}

.ins-bar-fill {
  display: block;
  height: 6px;
  background: linear-gradient(90deg, var(--pli-blue, #116593) 0%, #0d8c6b 100%);
  border-radius: 3px;
  min-width: 3px;
}

/* Callout box */
.ins-callout {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #f0f6fb;
  border-left: 3px solid var(--pli-blue, #116593);
  border-radius: 0 4px 4px 0;
  padding: 8px 12px;
  font-size: 0.7rem;
  color: #2d4a60;
  margin-top: 6px;
}

.ins-callout > i {
  color: var(--pli-blue, #116593);
  margin-top: 2px;
  flex-shrink: 0;
  font-size: 0.78rem;
}

/* Community list */
.ins-comm-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.ins-comm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 10px;
  background: #f8fbfd;
  border-radius: 5px;
  border: 1px solid #e5edf5;
}

.ins-comm-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.ins-comm-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ins-comm-info strong {
  font-size: 0.72rem;
  color: #1f3f5c;
}

.ins-comm-meta {
  font-size: 0.67rem;
  color: #50657a;
}

.ins-comm-names {
  font-size: 0.67rem;
  color: #2d4a60;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ins-more {
  display: inline-block;
  background: #e4edf5;
  color: #50657a;
  font-size: 0.64rem;
  padding: 1px 5px;
  border-radius: 8px;
  font-style: normal;
}

.ins-more-comms {
  font-size: 0.68rem;
  color: #7a90a4;
  text-align: center;
  margin: 2px 0 8px;
}

/* Type badges */
.ins-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.ins-type-badge {
  display: inline-block;
  padding: 3px 9px;
  background: #e8f2fa;
  color: var(--pli-blue, #116593);
  border-radius: 10px;
  font-size: 0.67rem;
  white-space: nowrap;
}

.ins-names-preview {
  font-size: 0.7rem;
  color: #50657a;
  margin: 0 0 8px;
  font-style: italic;
}
