/* ==========================================================================
   Overlay Chat — custom styles (di luar utilitas Tailwind)
   ========================================================================== */

/* ---------- Kartu section ---------- */
.card {
  background: #fff;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  padding: 0.875rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.dark .card { background: rgb(15 23 42); border-color: rgb(30 41 59); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-bottom: .375rem;
  border-bottom: 1px solid rgb(241 245 249);
}
.dark .card-head { border-color: rgb(30 41 59); }
.card-title { font-size: .75rem; font-weight: 600; color: rgb(51 65 85); }
.dark .card-title { color: rgb(226 232 240); }

/* ---------- Input teks / select ---------- */
.field {
  width: 100%;
  border-radius: .375rem;
  border: 1px solid rgb(203 213 225);
  background: rgb(248 250 252);
  color: rgb(30 41 59);
  padding: .25rem .625rem;
  font-size: .75rem;
}
.dark .field { border-color: rgb(51 65 85); background: rgb(30 41 59); color: rgb(241 245 249); }
.field:focus { outline: none; border-color: rgb(14 165 233); box-shadow: 0 0 0 2px rgba(14, 165, 233, .35); }

.value-label { font: 500 10px/1 ui-monospace, monospace; color: rgb(100 116 139); }

/* ---------- Tombol ikon header ---------- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  border: 1px solid rgb(226 232 240);
  background: #fff;
  color: rgb(71 85 105);
  transition: all .15s ease;
}
.icon-btn:hover { border-color: rgb(56 189 248); color: rgb(2 132 199); }
.dark .icon-btn { border-color: rgb(51 65 85); background: rgb(30 41 59); color: rgb(203 213 225); }
.dark .icon-btn:hover { color: rgb(56 189 248); }
.icon-btn[aria-expanded="true"] { border-color: rgb(56 189 248); color: rgb(2 132 199); }

/* ---------- Swatch warna bulat ---------- */
.swatch {
  -webkit-appearance: none;
  appearance: none;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 2px solid rgb(203 213 225);
  border-radius: 9999px;
  background: none;
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.dark .swatch { border-color: rgb(71 85 105); }
.swatch:hover, .swatch:focus-visible { border-color: rgb(56 189 248); box-shadow: 0 0 0 2px rgba(56, 189, 248, .35); outline: none; }
.swatch::-webkit-color-swatch-wrapper { padding: 0; }
.swatch::-webkit-color-swatch { border: none; border-radius: 9999px; }
.swatch::-moz-color-swatch { border: none; border-radius: 9999px; }
.swatch-sm { width: 1.25rem; height: 1.25rem; }
.swatch-wrap { display: flex; flex-direction: column; align-items: center; gap: .2rem; cursor: pointer; }
.swatch-wrap span { font-size: 9px; color: rgb(100 116 139); }

/* Chip tema cepat: miniatur bubble */
.theme-chip {
  width: 1.75rem;
  height: 1.25rem;
  padding: 2px;
  border-radius: .375rem;
  cursor: pointer;
  outline-offset: 1px;
}
.theme-chip span { display: block; width: 100%; height: 100%; border-radius: .25rem; border-width: 2px; border-style: solid; }
.theme-chip:hover, .theme-chip:focus-visible { outline: 2px solid rgb(56 189 248); }

/* ---------- Dropzone gambar ---------- */
.dropzone {
  border: 2px dashed rgb(203 213 225);
  border-radius: .5rem;
  padding: .5rem;
  background: rgb(248 250 252);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dark .dropzone { border-color: rgb(51 65 85); background: rgb(30 41 59 / .5); }
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-dragging { border-color: rgb(14 165 233); outline: none; }
.dropzone.is-dragging { background: rgb(14 165 233 / .08); }
.dropzone.has-image { cursor: default; border-style: solid; }

/* Tombol reset kecil per slider */
.reset-btn {
  font-size: 11px;
  line-height: 1;
  color: rgb(148 163 184);
  padding: 0 .15rem;
}
.reset-btn:hover { color: rgb(14 165 233); }
.reset-btn:disabled { visibility: hidden; }

details > summary::-webkit-details-marker { display: none; }

/* Dialog reset */
#resetDialog { margin: auto; }
#resetDialog::backdrop { background: rgba(2, 6, 23, .55); backdrop-filter: blur(2px); }

.btn-option {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(203 213 225);
  background: rgb(248 250 252);
  color: rgb(51 65 85);
  cursor: pointer;
  transition: all .15s ease;
}
.dark .btn-option {
  border-color: rgb(51 65 85);
  background: rgb(30 41 59);
  color: rgb(203 213 225);
}
.btn-option:hover { border-color: rgb(56 189 248); }
.btn-option.active,
.btn-option[aria-pressed="true"] {
  background: rgb(2 132 199);
  border-color: rgb(2 132 199);
  color: #fff;
}
.btn-option:disabled { opacity: .4; cursor: not-allowed; }

.checkerboard {
  background-image:
    linear-gradient(45deg, rgba(100,116,139,.35) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(100,116,139,.35) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(100,116,139,.35) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(100,116,139,.35) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: rgba(100,116,139,.12);
}

/* Preview SVG menyesuaikan lebar panel tanpa mengubah ukuran export */
#svgContainer svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Chip kode warna Growtopia */
.color-chip {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(100,116,139,.5);
  font: 700 10px/1 ui-monospace, monospace;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-shadow: 0 0 2px #000, 0 0 2px #000;
  color: #fff;
}
.color-chip:hover { outline: 2px solid rgb(56 189 248); }

/* Tab pesan */
.msg-tab {
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 .4rem;
}

/* Toast notifikasi */
#toast {
  transition: opacity .2s ease, transform .2s ease;
}
#toast.hidden-toast {
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
}
