/* ==========================================================================
   JSON TREE VIEWER COMPONENT
   Syntax highlighting, foldable tree nodes, copy buttons
   ========================================================================== */

.json-viewer-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-card-inner);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
}

.json-viewer-toolbar {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.json-viewer-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.json-viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.json-tree-body {
  flex: 1;
  padding: 1.25rem;
  overflow: auto;
  color: #cbd5e1;
}

/* TREE NODES */
.json-node {
  position: relative;
  padding-left: 1.25rem;
  margin: 2px 0;
}

.json-toggle {
  position: absolute;
  left: 0;
  top: 3px;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  transition: transform var(--transition-fast), color var(--transition-fast);
  user-select: none;
}

.json-toggle:hover {
  color: var(--primary);
}

.json-toggle.collapsed {
  transform: rotate(-90deg);
}

/* SYNTAX HIGHLIGHTING */
.json-key {
  color: #38bdf8; /* Azul ciano vivo */
  font-weight: 500;
}

.json-colon {
  color: #64748b;
  margin-right: 0.35rem;
}

.json-string {
  color: #34d399; /* Verde esmeralda */
  word-break: break-all;
}

.json-number {
  color: #f59e0b; /* Âmbar */
  font-weight: 600;
}

.json-boolean {
  color: #ec4899; /* Rosa neon */
  font-weight: 700;
}

.json-null {
  color: #94a3b8;
  font-style: italic;
  font-weight: 600;
}

.json-bracket {
  color: #94a3b8;
  font-weight: 700;
}

.json-size-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-left: 0.35rem;
  font-style: italic;
}

.json-node.collapsed-content > .json-children {
  display: none;
}

.json-node.collapsed-content > .json-ellipsis {
  display: inline;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
}

.json-ellipsis {
  display: none;
}
