/* ============================================================
 * Path     : /app/ui/treeview/treeview.css
 * Component: Treeview – Presentation (LEIDEND)
 * Solution : Familie Engelbracht
 * Version  : v1.1.0 – 02-02-2026 CET
 *
 * Purpose:
 * - Visuele presentatie van world-based treeview
 * - Styling van overlay, viewport, world-layer, boxen en lijnen
 *
 * Contract:
 * - GEEN genealogische logica
 * - GEEN positioneringsberekeningen
 * - Alleen CSS-presentatie
 * - Respecteert HTML [hidden]-attribuut
 * ============================================================ */


/* ============================================================
   Treeview overlay (FULLSCREEN)
   ============================================================ */

.panel-treeview:not([hidden]) {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 9000;
  overflow: hidden;
}


/* ============================================================
   Viewport
   ============================================================ */

#treeview-panel:not([hidden]) {
  position: absolute;
  inset: 0;
  background: #ffffff;
  overflow: hidden;
}


/* ============================================================
   World background
   ============================================================ */

#world-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: transparent;
}


/* ============================================================
   World layer (WORLD SPACE)
   ============================================================ */

#world {
  position: absolute;
  inset: 0;
  z-index: 1;

  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
}


/* ============================================================
   SVG layer (lijnen, WORLD SPACE)
   ============================================================ */

.treeview-svg {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  pointer-events: none;
  overflow: visible;

  z-index: 5;
  color: #555;
  display: block;
}


/* ============================================================
   Spouse & childgroup lines
   ============================================================ */

#tv-spouse-lines line,
#tv-child-lines line {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
  opacity: 0.85;
  vector-effect: non-scaling-stroke;
}


/* ============================================================
   Person box (WORLD SPACE – VAST)
   ============================================================ */

.treeview-box {
  position: absolute;
  box-sizing: border-box;

  /* LEIDEND: vaste maat */
  width: 200px;
  height: 80px;

  display: flex;
  flex-direction: row;
  align-items: center;

  padding: 6px 10px;
  gap: 10px;

  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;

  border-radius: 6px;
  background-clip: padding-box;
  overflow: hidden; /* ★ CRUCIAAL */

  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease;

  z-index: 10;
}


/* ============================================================
   Gender styling (LEIDEND)
   ============================================================ */

.treeview-box[data-gender="male"] {
  background-color: #eaf2ff;
  border: 1px solid #4d79ff;
}

.treeview-box[data-gender="female"] {
  background-color: #ffeaf2;
  border: 1px solid #ff5c8a;
}

.treeview-box[data-gender="unknown"] {
  background-color: #f2f2f2;
  border: 1px solid #999;
}


/* ============================================================
   Focus & hover
   ============================================================ */

.treeview-box.is-focus {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  border-width: 2px;
}

.treeview-box:hover {
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
}


/* ============================================================
   Avatar (64px)
   ============================================================ */

.treeview-box img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
}


/* ============================================================
   Box content
   ============================================================ */

.treeview-box-content {
  display: flex;
  flex-direction: column;
  justify-content: center;

  flex: 1 1 auto;
  min-width: 0;

  line-height: 1.1;
}


/* ============================================================
   Name & meta (11px, niet vet)
   ============================================================ */

.treeview-box-name {
  font-size: 11px;
  font-weight: 400;
  color: #000;
  word-break: break-word;
}

.treeview-box-meta {
  margin-top: 3px;
  font-size: 11px;
  color: #555;
  white-space: nowrap;
}


/* ============================================================
   Validation indicator (voor later)
   ============================================================ */

.treeview-box .validation-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
}
