/* NbtEditorPage.css
   Penyunting pohon NBT mentah.

   Pohon bisa sangat dalam (struktur berisi entity berisi item berisi
   tag), jadi lekukannya dibuat kecil dan diberi garis panduan supaya
   tetap terbaca di layar sempit. */

.nbt-editor {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nbt-editor__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* Tombol undo/redo didorong ke ujung, terpisah dari tombol buka berkas. */
.nbt-editor__actions .undo-redo-bar {
  margin-left: auto;
}

.nbt-editor__stats {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.nbt-editor__tree-section {
  background: var(--surface-1, #1e1e1e);
  border: 1px solid var(--border-subtle, #333);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
}

/* ── Pohon ───────────────────────────────────────────────────────── */

.nbt-tree {
  font-size: 13px;
  min-width: min-content;
}

.nbt-tree__row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  min-height: 30px;
}

.nbt-tree__row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.nbt-tree__children {
  margin-left: 11px;
  padding-left: 10px;
  border-left: 1px solid var(--border-subtle, #333);
}

.nbt-tree__toggle {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}

.nbt-tree__toggle:disabled {
  cursor: default;
  opacity: 0;
}

/* Lencana tipe: lebar tetap supaya nama tag sejajar antar-baris. */
.nbt-tree__type {
  flex-shrink: 0;
  min-width: 30px;
  text-align: center;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
}

.nbt-tree__type--compound,
.nbt-tree__type--list {
  background: rgba(120, 170, 255, 0.16);
  color: #8fb7ff;
}

.nbt-tree__type--string {
  background: rgba(150, 220, 150, 0.16);
  color: #94d894;
}

.nbt-tree__name {
  flex-shrink: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--text-primary, #e6e6e6);
  white-space: nowrap;
}

.nbt-tree__summary {
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.nbt-tree__value {
  flex: 1;
  min-width: 90px;
  max-width: 320px;
  padding: 3px 7px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ── Baris tambah tag ────────────────────────────────────────────── */

.nbt-tree__add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 3px;
}

.nbt-tree__add-name {
  width: 150px;
  padding: 3px 7px;
  font-size: 12px;
}

.nbt-tree__add-type {
  width: 110px;
  padding: 3px 7px;
  font-size: 12px;
}

.nbt-tree__add-btn {
  padding: 4px 11px;
  font-size: 12px;
}

@media (max-width: 560px) {
  /* Di layar sempit, kolom nama dipersempit lebih dulu — tipe dan tombol
     lebih sulit ditebak kalau terpotong. */
  .nbt-tree__add-name {
    width: 96px;
  }
  .nbt-tree__value {
    max-width: 150px;
  }
}
