/**
 * NpcEditorPage.css
 * Tata letak halaman NPC Editor.
 *
 * Awalan `ne-` mengikuti `ee-` (Entity), `ie-` (Item), dan `te-` (Trade),
 * supaya kartu antar tool terlihat sekeluarga tanpa saling menimpa.
 * Kelas bersama (`field`, `text-input`, `select-input`, `btn`) tetap
 * datang dari tema — tidak didefinisikan ulang di sini.
 */

.npc-editor {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px;
}

/* ── Header ──────────────────────────────────────────────────────────── */

.ne-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ne-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.ne-subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
  max-width: 62ch;
}

/* ── Kartu ───────────────────────────────────────────────────────────── */

.ne-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 10px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ne-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ne-card__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ne-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.ne-icon {
  display: inline-flex;
  align-items: center;
}

.ne-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ne-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ne-chip {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ne-chip:hover {
  background: var(--bg-surface-3);
  border-color: var(--accent, #c87d4a);
}

/* ── Petunjuk & penghitung karakter ──────────────────────────────────── */

.ne-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Melebihi batas tampilan game TIDAK merusak berkas — teksnya hanya
   terpotong di layar. Jadi ini peringatan, bukan galat. */
.ne-hint--warn {
  color: var(--accent-warning, #c9a227);
}

.ne-skin {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ne-skin .text-input {
  width: 90px;
  flex-shrink: 0;
}

.ne-dialogue-text {
  resize: vertical;
  min-height: 76px;
  line-height: 1.5;
}

/* ── Kelompok mode ───────────────────────────────────────────────────── */

/* Aksi dikelompokkan per mode karena Tombol / saat dibuka / saat ditutup
   adalah tiga MEKANISME berbeda, bukan sekadar label. Daftar datar membuat
   orang mengira urutannya menentukan. */
.ne-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.ne-group:first-of-type {
  padding-top: 0;
  border-top: none;
}

.ne-group__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.ne-group__name {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}

.ne-group__meta {
  font-size: 11px;
  color: var(--text-muted);
}

.ne-group__add {
  margin-left: auto;
  padding: 3px 11px;
  font-size: 13px;
  line-height: 1.2;
}

/* ── Baris aksi ──────────────────────────────────────────────────────── */

.ne-action {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
}

/* Aksi tanpa perintah tidak ikut diexport. Ditandai lewat garis tepi,
   bukan disembunyikan — pengguna perlu tahu baris itu ada dan kenapa
   dilewati. */
.ne-action--incomplete {
  border-color: color-mix(in srgb, var(--accent-warning, #c9a227) 45%, transparent);
}

.ne-action__head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.ne-action__mode {
  width: 160px;
  flex-shrink: 0;
}

.ne-action__label {
  flex: 1 1 180px;
  min-width: 0;
}

.ne-action__delete {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--accent-danger, #c0483c);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  padding: 6px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm, 6px);
  transition: background 0.12s ease;
}

.ne-action__delete:hover {
  background: color-mix(in srgb, var(--accent-danger, #c0483c) 14%, transparent);
}

.ne-action__commands {
  resize: vertical;
  min-height: 64px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
}

/* ── Keadaan kosong ──────────────────────────────────────────────────── */

.ne-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  background: var(--bg-surface-2);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md, 8px);
}

.ne-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 60ch;
}

/* ── Catatan export ──────────────────────────────────────────────────── */

.ne-note {
  padding: 12px 14px;
  font-size: 11.5px;
  line-height: 1.6;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--tag-string, #6a9955);
  border-radius: var(--radius-md, 8px);
}

.ne-note strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.ne-note p {
  margin: 0;
  color: var(--text-muted);
}

.ne-note__warn {
  margin-top: 8px !important;
  color: var(--text-secondary) !important;
}

/* ── Layar sempit ────────────────────────────────────────────────────── */

@media (max-width: 680px) {
  .ne-grid2 {
    grid-template-columns: 1fr;
  }

  .ne-action__mode {
    width: 100%;
  }

  .ne-action__label {
    flex-basis: 100%;
  }
}
