/* notes-feature.css — Obsidian Cartography theme, matches Tilal Village tour */

/* ── floating button ─────────────────────────────────────
   Matches existing tour circular control buttons.
   Positioned bottom-left to avoid colliding with tour's own
   bottom-right controls (ⓘ grid map etc.)
──────────────────────────────────────────────────────── */
#np-btn {
  position: fixed;
  right: 18px;
  bottom: 90px;
  z-index: 9999;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(201,168,76,0.55);
  background: rgba(28, 32, 58, 0.92);
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,0.55), inset 0 0 0 0 rgba(201,168,76,0);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#np-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: rgba(201,168,76,0.9);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.25s;
}
#np-btn:hover {
  border-color: rgba(201,168,76,0.95);
  background: rgba(34,40,72,0.97);
  box-shadow: 0 4px 22px rgba(0,0,0,0.6), 0 0 0 3px rgba(201,168,76,0.12);
  transform: scale(1.06);
}
#np-btn:active { transform: scale(0.95); }

/* has-notes state → gold filled */
#np-btn.np-has {
  background: rgba(201,168,76,0.92);
  border-color: rgba(201,168,76,1);
  box-shadow: 0 4px 18px rgba(201,168,76,0.35);
}
#np-btn.np-has svg {
  stroke: rgba(18,18,36,0.9);
}
#np-btn.np-has:hover {
  background: rgba(214,180,88,0.97);
  box-shadow: 0 4px 22px rgba(201,168,76,0.5), 0 0 0 3px rgba(201,168,76,0.18);
}

/* ── modal overlay ───────────────────────────────────────── */
#np-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
}
#np-modal.np-open { display: block; }

#np-modal .np-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 28, 0.70);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ── dialog ─────────────────────────────────────────────── */
#np-modal .np-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 92vw);
  background: rgba(22, 26, 52, 0.97);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 2px 0 rgba(201,168,76,0.45) inset,   /* gold top hairline */
    0 24px 64px rgba(0,0,0,0.75),
    0 0 0 1px rgba(201,168,76,0.15);
  font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
  color: rgba(240,238,230,0.9);
  direction: rtl;
}

/* header */
#np-modal .np-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: rgba(20, 28, 62, 0.98);
  border-bottom: 1px solid rgba(201,168,76,0.18);
  gap: 8px;
}
#np-modal .np-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(201,168,76,0.95);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
#np-modal .np-label {
  font-size: 11px;
  font-weight: 400;
  color: rgba(240,238,230,0.45);
  letter-spacing: 0;
}
#np-modal .np-close {
  background: transparent;
  border: none;
  color: rgba(240,238,230,0.45);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
#np-modal .np-close:hover {
  color: rgba(240,238,230,0.9);
  background: rgba(255,255,255,0.08);
}

/* body scroll area */
#np-modal .np-body {
  padding: 12px 14px;
  max-height: 58vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.25) transparent;
}
#np-modal .np-body::-webkit-scrollbar { width: 4px; }
#np-modal .np-body::-webkit-scrollbar-thumb {
  background: rgba(201,168,76,0.25);
  border-radius: 2px;
}

/* note cards */
#np-modal .np-list { display: flex; flex-direction: column; gap: 7px; }
#np-modal .np-item {
  padding: 9px 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,168,76,0.14);
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.5;
}
#np-modal .np-when {
  font-size: 10px;
  color: rgba(201,168,76,0.55);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}
#np-modal .np-text { color: rgba(240,238,230,0.82); }
/* action buttons row */
#np-modal .np-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  margin-top: 7px;
}
#np-modal .np-act {
  background: transparent;
  border: 1px solid rgba(201,168,76,0.22);
  color: rgba(201,168,76,0.7);
  border-radius: 5px;
  font-size: 13px;
  padding: 3px 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#np-modal .np-act:hover {
  background: rgba(201,168,76,0.12);
  color: rgba(201,168,76,1);
  border-color: rgba(201,168,76,0.5);
}
#np-modal .np-del-btn:hover {
  background: rgba(220,60,60,0.15);
  color: rgba(255,100,90,0.9);
  border-color: rgba(220,60,60,0.4);
}

/* inline edit form */
#np-modal .np-edit-form { margin-top: 8px; }
#np-modal .np-edit-ta {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 70px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(201,168,76,0.45);
  border-radius: 6px;
  color: rgba(240,238,230,0.88);
  outline: none;
  direction: rtl;
}
#np-modal .np-edit-ta:focus { border-color: rgba(201,168,76,0.8); }
#np-modal .np-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  justify-content: flex-start;
}
#np-modal .np-save-edit {
  background: rgba(201,168,76,0.85);
  color: rgba(16,18,36,0.95);
  border: none;
  font-weight: 700;
}
#np-modal .np-save-edit:hover { background: rgba(214,180,88,0.97); }
#np-modal .np-cancel-edit { color: rgba(240,238,230,0.55); }

#np-modal .np-empty {
  font-size: 12px;
  color: rgba(240,238,230,0.28);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

/* divider */
#np-modal .np-divider {
  height: 1px;
  background: rgba(201,168,76,0.12);
  flex-shrink: 0;
}

/* textarea */
#np-modal .np-ta {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 92px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.28);
  border-radius: 7px;
  color: rgba(240,238,230,0.88);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  direction: rtl;
}
#np-modal .np-ta::placeholder { color: rgba(240,238,230,0.25); }
#np-modal .np-ta:focus {
  border-color: rgba(201,168,76,0.65);
  background: rgba(255,255,255,0.07);
}

/* status */
#np-modal .np-status {
  min-height: 16px;
  font-size: 11px;
  color: rgba(240,238,230,0.38);
  text-align: right;
}
#np-modal .np-status.np-error { color: rgba(255,100,90,0.75); }
#np-modal .np-status.np-ok    { color: rgba(100,200,130,0.75); }

/* footer */
#np-modal .np-foot {
  padding: 10px 14px;
  border-top: 1px solid rgba(201,168,76,0.12);
  background: rgba(18,22,46,0.6);
}
#np-modal .np-submit {
  width: 100%;
  background: rgba(201,168,76,0.88);
  color: rgba(16,18,36,0.95);
  border: none;
  padding: 9px 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
#np-modal .np-submit:hover    { background: rgba(214,180,88,0.96); }
#np-modal .np-submit:disabled { opacity: 0.45; cursor: default; }
