/* JSON tree view shared by the JSON tools (public/assets/lib/json-tree.js). */

.jt { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.jt-pathbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: var(--border);
  border-radius: 10px;
}
.jt-pathbar-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.jt-path { flex: 1 1 160px; min-width: 0; font: 500 14px var(--font-mono); overflow-wrap: anywhere; }
.jt-copy { min-height: 36px; padding: 0 12px; font-size: 14px; }

.jt-scroll {
  max-height: 560px;
  overflow: auto;
  padding: 8px 6px;
  background: var(--surface);
  border: var(--border);
  border-radius: 12px;
}

.jt-list { margin: 0; padding: 0; list-style: none; font: 14px/1.6 var(--font-mono); }
.jt-list .jt-list { margin-left: 12px; padding-left: 10px; border-left: 1.5px dashed var(--line-soft); }

.jt-line { display: flex; align-items: baseline; min-height: 28px; padding: 1px 4px; border-radius: 6px; }
.jt-line.is-selected { background: #FFF3BF; box-shadow: inset 0 0 0 1.5px var(--ink); }

.jt-toggle {
  display: inline-flex;
  align-items: baseline;
  min-height: 28px;
  margin: 0;
  padding: 0 4px 0 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.jt-toggle:hover .jt-count { text-decoration: underline; }

.jt-arrow, .jt-spacer { display: inline-block; flex-shrink: 0; width: 1.4em; text-align: center; }
.jt-arrow::before { content: "▸"; display: inline-block; }
.jt-toggle[aria-expanded="true"] .jt-arrow::before { transform: rotate(90deg); }

.jt-key { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.jt-index { color: var(--ink-3); }
.jt-punct { white-space: pre; color: var(--ink-3); }
.jt-count { color: var(--ink-3); }

.jt-val { min-width: 0; overflow-wrap: anywhere; }
.jt-string { color: #0F6B37; }
.jt-number { color: #1D4ED8; }
.jt-boolean { color: #9D174D; font-weight: 700; }
.jt-null { color: #5B6475; font-style: italic; }

.jt-badge {
  flex-shrink: 0;
  margin-left: 8px;
  padding: 0 6px;
  font: 700 11px/1.7 var(--font-body);
  white-space: nowrap;
  background: var(--surface-2);
  border: 1.5px solid var(--ink);
  border-radius: 5px;
}
.jt-cut { background: var(--accent); }
.jt-cut-row { display: flex; align-items: center; min-height: 28px; padding: 1px 4px; }
.jt-cut-row .jt-badge { margin-left: 0; }

.jt-more-row { display: flex; align-items: center; padding: 4px; }
.jt-more { min-height: 36px; padding: 0 12px; font-size: 14px; }

/* A selectable value row: a plain-looking button so it can be reached with the keyboard. */
.jt-select {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  min-height: 28px;
  margin: 0;
  padding: 0 4px 0 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: default;
}

/* Editing (the JSON editor): actions for the selected row, and the inline edit field. */
.jt-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.jt-action { min-height: 34px; padding: 0 10px; font-size: 13px; box-shadow: none; }
.jt-action:disabled { color: var(--line-soft); border-color: #C9D3E6; cursor: not-allowed; }
.jt-edit {
  min-width: 6ch;
  max-width: 100%;
  padding: 1px 6px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 5px;
  outline: none;
}

/* Compare results inside the tree. */
.jt-line.jt-diff-added { background: #D3F9D8; box-shadow: inset 3px 0 0 #2F9E44; }
.jt-line.jt-diff-removed { background: #FFE3E3; box-shadow: inset 3px 0 0 #E03131; }
.jt-line.jt-diff-changed { background: #FFF3BF; box-shadow: inset 3px 0 0 #F08C00; }
.jt-line.jt-diff-inside .jt-count::after { content: " ●"; color: #F08C00; }
.jt-line.is-selected[class*="jt-diff-"] { box-shadow: inset 0 0 0 1.5px var(--ink); }
