/* ═══════════════════════════════════════════════════════════════════
   05 INSPECTOR
   Inspector base + map settings + parallax
   Sourced from monolithic main.css lines 658-929.
   ═══════════════════════════════════════════════════════════════════ */


/* ── Inspector ──────────────────────────────────────────────────── */
.inspector-content {
  overflow-y: auto;
  flex: 1;
  padding: 12px;
}
.inspector-section {
  margin-bottom: 16px;
  background: var(--glass-bg-subtle);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.inspector-section h3 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-weight: 600;
  color: var(--text-dim);
  margin: -4px -4px 10px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--glass-border);
}
/* Collapsible variant */
.inspector-section.collapsible h3 {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 100ms ease;
}
.inspector-section.collapsible h3::before {
  content: '▾';
  display: inline-block;
  font-size: 9px;
  width: 10px;
  color: var(--text-hint);
  transition: transform 120ms ease;
}
.inspector-section.collapsible h3:hover { color: var(--accent); }
.inspector-section.collapsible h3:hover::before { color: var(--accent); }
.inspector-section.collapsible.is-collapsed h3::before { transform: rotate(-90deg); }
.inspector-section.collapsible .inspector-section-body { transition: opacity 80ms ease; }
.inspector-section.collapsible.is-collapsed .inspector-section-body { display: none; }
/* When the section uses the legacy pattern (children appended directly), we hide
   everything that's not the h3 header. */
.inspector-section.collapsible.is-collapsed > *:not(h3) { display: none !important; }
.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.form-row label { width: 100px; flex-shrink: 0; color: var(--text-dim); font-size: 12px; }
.form-row .inp, .form-row input[type="text"],
.form-row input[type="number"], .form-row select {
  flex: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  min-width: 0;
}
.form-row input[type="color"] {
  width: 40px; height: 28px;
  padding: 2px;
  cursor: pointer;
}
.form-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
}
.form-grid label { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.form-grid .inp, .form-grid input, .form-grid select {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  width: 100%;
}
.mt { margin-top: 12px; }

/* ── Map settings background section ──────────────────────────── */
.ms-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--text-dim);
  border-top: 1px solid var(--border); margin-top: 16px; padding-top: 12px;
}
.ms-bg-row {
  display: flex; gap: 14px; margin-top: 10px; align-items: flex-start;
}
.ms-bg-preview-wrap {
  width: 200px; height: 56px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 4px;
  background: repeating-conic-gradient(var(--bg3) 0% 25%, var(--bg4) 0% 50%) 0 0/8px 8px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.ms-bg-preview { display: none; image-rendering: pixelated; }
.ms-bg-none { font-size: 11px; color: var(--text-hint); }
.ms-bg-controls { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ms-mirror-toggle {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 12px; font-weight: 600;
}
.toggle-pill {
  width: 34px; height: 18px; border-radius: 9px;
  background: var(--bg4); border: 1px solid var(--border);
  flex-shrink: 0; position: relative; transition: background 0.15s;
}
.ms-mirror-toggle input { display: none; }
.toggle-pill::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-dim); transition: transform 0.15s, background 0.15s;
}
.ms-mirror-toggle input:checked + .toggle-pill { background: var(--accent); border-color: var(--accent); }
.ms-mirror-toggle input:checked + .toggle-pill::after { transform: translateX(16px); background: #fff; }

/* ── Parallax background editor ───────────────────────────────── */
.parallax-help {
  font-size: 12px; color: var(--text-dim);
  margin: 8px 0 10px;
  line-height: 1.5;
}
.parallax-help em {
  color: #d8d4ff; font-style: normal; font-weight: 600;
}
.parallax-drop {
  border: 2px dashed rgba(155,149,255,0.35);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(124,117,255,0.06), rgba(155,149,255,0.02));
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  user-select: none;
}
.parallax-drop:hover {
  border-color: rgba(155,149,255,0.6);
  background: linear-gradient(135deg, rgba(124,117,255,0.12), rgba(155,149,255,0.05));
}
.parallax-drop.drag-over {
  border-color: var(--accent);
  background: rgba(124,117,255,0.16);
  transform: scale(1.01);
}
.parallax-drop-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 12px rgba(155,149,255,0.55));
}
.parallax-drop-text { display: flex; flex-direction: column; gap: 2px; }
.parallax-drop-text strong { font-size: 13px; color: #e8e8ff; font-weight: 700; }
.parallax-drop-text span    { font-size: 11.5px; color: var(--text-dim); }

.parallax-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 12px;
}
.parallax-empty { margin: 12px 0; text-align: center; }
.parallax-row {
  display: flex; gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.parallax-row:hover {
  border-color: rgba(155,149,255,0.35);
  background: rgba(124,117,255,0.04);
}
.parallax-row-thumb {
  width: 96px; height: 56px;
  flex-shrink: 0;
  border-radius: 6px;
  background: repeating-conic-gradient(var(--bg3) 0% 25%, var(--bg4) 0% 50%) 0 0/8px 8px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.parallax-row-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.parallax-row-empty { color: var(--text-hint); font-size: 18px; }
.parallax-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.parallax-row-head {
  display: flex; align-items: center; gap: 8px;
}
.parallax-depth {
  font-size: 11px; font-weight: 700;
  color: #d8d4ff;
  background: rgba(124,117,255,0.18);
  border: 1px solid rgba(124,117,255,0.35);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.parallax-row-head .px-name { flex: 1; min-width: 0; padding: 4px 8px; font-size: 12.5px; font-weight: 600; }
.parallax-row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.parallax-row-actions .btn-icon {
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: background 0.12s, border-color 0.12s;
}
.parallax-row-actions .btn-icon:hover:not(:disabled) {
  background: rgba(155,149,255,0.18);
  border-color: rgba(155,149,255,0.45);
}
.parallax-row-actions .btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }
.parallax-row-actions .px-del:hover { background: rgba(255,90,90,0.18); border-color: rgba(255,90,90,0.5); }

.parallax-row-sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.px-slider {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 11px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.px-slider b { color: #e8e8ff; font-weight: 700; }
.px-slider input[type="range"] { width: 100%; }

.parallax-row-offsets {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.px-num {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 10.5px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.px-num input {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px; color: #e8e8ff; font-weight: 600;
  width: 78px;
}
.px-num input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(124,117,255,0.08);
}
.px-offset-hint {
  font-size: 10.5px; color: var(--text-dim); font-style: italic;
}
.parallax-row-flags {
  display: flex; gap: 14px; flex-wrap: wrap;
  align-items: center;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

/* Active state for the parallax-edit toggle button + body cursor cue. */
#btn-edit-parallax.active,
#btn-tilemap-mode.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--accent), 0 4px 12px -4px rgba(124,117,255,0.55);
}
body.parallax-edit-mode #map-canvas { cursor: grab; }
body.tilemap-mode #map-canvas { cursor: crosshair; }
