/* ═══════════════════════════════════════════════════════════════════════
   SKILL TREE BUILDER — Shared Styles (PoE-Inspired)
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Layout ──────────────────────────────────────────────────────────── */
.builder {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 64px);
  padding-top: 64px;
}
.builder__canvas {
  flex: 1;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, rgba(15,15,25,1) 0%, rgba(8,8,14,1) 100%);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.builder__canvas:active {
  cursor: grabbing;
}
.builder__sidebar {
  width: 300px;
  flex-shrink: 0;
  background: rgba(12,12,20,0.97);
  border-left: 1px solid rgba(255,255,255,0.06);
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
}

/* ─── Zoom Controls ───────────────────────────────────────────────────── */
.zoom-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
}
.zoom-controls button {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(15,15,25,0.9);
  color: rgba(255,255,255,0.6);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  backdrop-filter: blur(8px);
}
.zoom-controls button:hover {
  background: rgba(30,30,50,0.9);
  border-color: rgba(200,162,78,0.3);
  color: rgba(255,255,255,0.9);
}
.zoom-hint {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.2);
  z-index: 10;
  pointer-events: none;
}

/* ─── SVG Tree ────────────────────────────────────────────────────────── */
.skill-tree-svg {
  display: block;
  cursor: inherit;
  transform-origin: 0 0;
}

/* ─── Connections (PoE-style thin lines) ──────────────────────────────── */
.conn {
  stroke: rgba(255,255,255,0.05);
  stroke-width: 1;
  transition: stroke 0.25s, opacity 0.25s;
}
.conn[data-state="active"] {
  stroke-width: 1.4;
  opacity: 1;
}
.conn[data-state="partial"] {
  stroke: rgba(255,255,255,0.12);
}
.conn[data-state="inactive"] {
  stroke: rgba(255,255,255,0.04);
}

/* ─── Nodes (PoE-style: small, clean, understated) ────────────────────── */
.tree-node {
  cursor: pointer;
}

.tree-node__shape {
  fill: rgba(15,15,25,0.9);
  stroke: rgba(255,255,255,0.10);
  transition: fill 0.2s, stroke 0.2s, filter 0.2s;
}
.tree-node:hover .tree-node__shape {
  filter: drop-shadow(0 0 4px var(--path-color));
}

/* ─── Node States (Subtle, PoE-inspired) ──────────────────────────────── */

/* Available — soft colored border, dark fill */
.tree-node[data-state="available"] .tree-node__shape {
  stroke: var(--path-color);
  stroke-opacity: 0.6;
  fill: rgba(15,15,25,0.95);
}

/* Allocated — subtle fill tint, NOT full solid color */
.tree-node[data-state="allocated"] .tree-node__shape {
  fill: color-mix(in srgb, var(--path-color) 25%, rgba(15,15,25,0.9));
  stroke: var(--path-color);
  stroke-opacity: 0.8;
}

/* Unavailable — very dim */
.tree-node[data-state="unavailable"] {
  opacity: 0.25;
  cursor: default;
}

/* Locked gateway — red tint */
.tree-node[data-state="locked"] .tree-node__shape {
  stroke: rgba(232,83,74,0.4);
  fill: rgba(232,83,74,0.06);
}
.tree-node[data-state="locked"] {
  cursor: not-allowed;
}

/* ─── Tooltip (fixed position, non-flashing) ──────────────────────────── */
.st-tooltip {
  position: fixed;
  z-index: 1000;
  width: 260px;
  padding: 14px;
  background: rgba(10,10,18,0.96);
  border: 1px solid rgba(200,162,78,0.15);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  pointer-events: none;
  font-family: Inter, sans-serif;
  transition: opacity 0.12s;
}
.st-tooltip__name {
  font-family: Cinzel, serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 5px;
}
.st-tooltip__badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}.st-tooltip__badge--gateway { background: rgba(196,30,58,0.15); color: #e8534a; }
.st-tooltip__badge--capstone { background: rgba(200,162,78,0.15); color: #c8a24e; }
.st-tooltip__badge--keystone { background: rgba(91,155,213,0.15); color: #5b9bd5; }
.st-tooltip__desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin: 0 0 8px;
}
.st-tooltip__effects {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 6px;
  margin-bottom: 6px;
}
.st-tooltip__effect {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2px;
}
.st-tooltip__effect strong { color: #4fc77a; }
.st-tooltip__status {
  font-size: 0.7rem;
  padding-top: 5px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.st-tooltip__status--avail { color: #4fc77a; }
.st-tooltip__status--alloc { color: #5b9bd5; }
.st-tooltip__status--locked { color: #e8534a; }
.st-tooltip__status--unavail { color: rgba(255,255,255,0.25); }

/* ─── Sidebar ─────────────────────────────────────────────────────────── */
.sb-header {
  font-family: Cinzel, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.sb-points {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
  font-family: Inter, sans-serif;
}
.sb-points--full { color: #4fc77a; }
.sb-remaining {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.sb-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.sb-actions button {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  background: rgba(20,20,35,0.8);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}.sb-actions button:hover {
  background: rgba(30,30,55,0.9);
  border-color: var(--gold);
  color: var(--text);
}
.sb-divider {
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin: 12px 0;
}
.sb-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.sb-group-title {
  font-family: Cinzel, serif;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 10px 0 4px;
}
.sb-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}.sb-node__name {
  font-size: 0.78rem;
  color: var(--text-dim);
  flex: 1;
}
.sb-node__type {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.sb-node__remove {
  background: none;
  border: none;
  color: #e8534a;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 3px;
  opacity: 0.4;
}
.sb-node__remove:hover { opacity: 1; }
.sb-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}
.sb-stat {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 0.78rem;
}
.sb-stat__label { color: var(--text-dim); }
.sb-stat__val { color: #4fc77a; font-weight: 600; }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .builder {
    flex-direction: column;
  }
  .builder__sidebar {
    width: 100%;
    max-height: none;
    position: static;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .builder__canvas {
    min-height: 500px;
  }
}