/* Tree editor mode — visual variation tree authoring. */

.tree-editor-mode {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tree-editor-mode__crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-bg-elevated, #f9fafb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  font-size: 0.85rem;
  color: var(--color-text-muted, #6b7280);
}

.tree-editor-mode__crumb-label { font-weight: 600; }
.tree-editor-mode__crumb-sep { color: var(--color-text-muted, #9ca3af); }

.tree-editor-mode__crumbs code {
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.8rem;
}

.tree-editor-mode__scroll {
  flex: 1;
  overflow: auto;
  padding: 16px;
  background: var(--color-bg, #fff);
}

.tree-editor-mode__svg {
  display: block;
  background: var(--color-bg-canvas, #fafafa);
  border-radius: 8px;
}

.tree-editor-mode__edge {
  fill: none;
  stroke: var(--color-text-muted, #9ca3af);
  stroke-width: 1.5;
  opacity: 0.6;
}

.tree-editor-mode__node-g {
  cursor: pointer;
}

.tree-editor-mode__node {
  fill: #fff;
  stroke: var(--color-border, #d1d5db);
  stroke-width: 1.5;
  transition: fill 0.15s ease;
}

.tree-editor-mode__node-g:hover .tree-editor-mode__node {
  fill: var(--color-primary-bg, #eff6ff);
  stroke: var(--color-primary, #3b82f6);
}

.tree-editor-mode__node--build_item { stroke: #14b8a6; }
.tree-editor-mode__node--scout_decision { stroke: #f59e0b; }
.tree-editor-mode__node--engagement { stroke: #ef4444; }
.tree-editor-mode__node--transition { stroke: #8b5cf6; }
.tree-editor-mode__node--quiz { stroke: #10b981; }

.tree-editor-mode__node-title {
  font-size: 12px;
  font-weight: 600;
  fill: var(--color-text, #1f2937);
  pointer-events: none;
}

.tree-editor-mode__node-type {
  font-size: 10px;
  fill: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.tree-editor-mode__plus { cursor: pointer; }
.tree-editor-mode__plus-circle {
  fill: var(--color-primary, #3b82f6);
  stroke: #fff;
  stroke-width: 2;
}
.tree-editor-mode__plus-txt {
  fill: #fff;
  font-weight: 700;
  font-size: 14px;
  pointer-events: none;
}

.tree-editor-mode__ctx-menu {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 4px 0;
  min-width: 180px;
}

.tree-editor-mode__ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--color-text, #1f2937);
}

.tree-editor-mode__ctx-item:hover { background: var(--color-hover, rgba(0, 0, 0, 0.04)); }

@media (max-width: 768px) {
  .tree-editor-mode__scroll { padding: 8px; }
  .tree-editor-mode__svg { min-width: 600px; }
}
