/* ==========================================================================
   NAHJ Element Inspector — dev tool UI (loaded only with inspector.js)
   ========================================================================== */

.nahj-inspector-ui,
.nahj-inspector-ui * {
  box-sizing: border-box;
  font-family: 'Readex Pro', system-ui, sans-serif;
  letter-spacing: 0;
}

/* Floating trigger capsule (Hidden: activate using Alt + I) */
.nahj-inspector-trigger-btn {
  display: none !important;
}

.inspect-kbd {
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  font-family: monospace;
  font-size: 11px;
  direction: ltr;
}

/* Hover highlight */
#nahj-inspect-hover-box {
  display: none;
  position: fixed;
  z-index: 2147482990;
  pointer-events: none;
  background: rgba(255, 90, 31, 0.12);
  outline: 2px solid #FF5A1F;
  outline-offset: -1px;
}

#nahj-inspect-hover-tag {
  display: none;
  position: fixed;
  z-index: 2147482991;
  pointer-events: none;
  transform: translateY(-100%);
  max-width: 420px;
  padding: 3px 8px;
  background: #0F172A;
  color: #E2E8F0;
  border-radius: 6px;
  font: 11.5px/1.4 monospace;
  direction: ltr;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#nahj-inspect-hover-tag .tag-highlight { color: #FDBA74; font-weight: 700; }

body.nahj-inspect-mode-active,
body.nahj-inspect-mode-active * { cursor: crosshair !important; }
body.nahj-inspect-mode-active .nahj-inspector-ui,
body.nahj-inspect-mode-active .nahj-inspector-ui * { cursor: default !important; }
body.nahj-inspect-mode-active .nahj-inspector-trigger-btn,
body.nahj-inspect-mode-active .nahj-inspector-ui button { cursor: pointer !important; }

/* Selected elements */
.nahj-inspected-element {
  outline: 3px solid #FF5A1F !important;
  outline-offset: 2px;
}

.nahj-inspected-badge {
  position: absolute;
  top: -12px;
  inset-inline-start: -12px;
  z-index: 2147482000;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  background: #FF5A1F;
  color: #FFFFFF;
  border-radius: 9999px;
  font: 700 12px/1 monospace;
  direction: ltr;
  pointer-events: none;
}

/* Bottom dock panel */
#nahj-inspector-panel {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 2147482999;
  max-height: 42vh;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  color: #0F172A;
  border-top: 3px solid #FF5A1F;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.25);
  transform: translateY(105%);
  transition: transform 0.25s ease;
}

#nahj-inspector-panel.visible { transform: translateY(0); }

.nahj-panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.nahj-panel-title-wrap,
.nahj-panel-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.nahj-panel-title { font-size: 15px; font-weight: 800; margin: 0; color: #0F172A; }

.nahj-panel-count-badge {
  padding: 2px 12px;
  background: #FFEDD5;
  color: #C2410C;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 700;
}

.nahj-btn-panel {
  padding: 8px 16px;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.nahj-btn-panel:hover { background: #F1F5F9; }

.nahj-btn-copy-all { background: #FF5A1F; border-color: #FF5A1F; color: #FFFFFF; }
.nahj-btn-copy-all:hover { background: #E8480E; }

.nahj-btn-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: #E2E8F0;
  color: #0F172A;
  font-size: 15px;
  cursor: pointer;
}

.nahj-panel-body {
  overflow-y: auto;
  padding: 12px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nahj-panel-empty { padding: 14px 0; color: #64748B; font-size: 14px; }

.nahj-element-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
}

.nahj-element-row-left { min-width: 0; flex: 1; }

.nahj-element-header-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }

.nahj-element-index {
  padding: 1px 9px;
  background: #FF5A1F;
  color: #FFFFFF;
  border-radius: 9999px;
  font: 700 12px/1.6 monospace;
}

.nahj-element-selector {
  font: 600 12.5px monospace;
  color: #0F172A;
  direction: ltr;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nahj-element-section-chip,
.nahj-element-i18n-chip {
  padding: 1px 10px;
  border-radius: 9999px;
  font: 600 11.5px monospace;
  direction: ltr;
}

.nahj-element-section-chip { background: #DBEAFE; color: #1D4ED8; }
.nahj-element-i18n-chip { background: #DCFCE7; color: #166534; }

.nahj-element-text-preview {
  font-size: 13px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nahj-element-actions { display: flex; gap: 6px; flex-shrink: 0; }

.nahj-btn-mini {
  padding: 6px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.nahj-btn-mini:hover { background: #F1F5F9; }
.nahj-btn-mini-delete { color: #DC2626; }

/* Toast */
#nahj-inspector-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 2147483001;
  max-width: min(520px, 92vw);
  padding: 12px 20px;
  background: #0F172A;
  color: #FFFFFF;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -14px);
  transition: all 0.25s ease;
}

#nahj-inspector-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .inspect-kbd { display: none; }
  .nahj-element-row { flex-direction: column; align-items: stretch; }
}
