/*
 * Page identifier badge.
 *
 * Renders a small round "i" icon in the top-right corner of a page or modal.
 * Hovering or focusing it reveals the unique page/modal identifier.
 *
 * Pair with the `page_id_badge` / `modal_id_badge` macros in
 * `app/templates/_macros/page_identifier.html`.
 */

.page-id-badge {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 2000;
  display: inline-flex;
  align-items: flex-start;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
}

.page-id-badge--modal {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
}

.page-id-badge__icon {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(30, 29, 26, 0.08);
  color: rgba(30, 29, 26, 0.6);
  font-family: "Georgia", "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.page-id-badge__icon:focus-visible {
  outline: 2px solid rgba(171, 59, 31, 0.55);
  outline-offset: 2px;
}

.page-id-badge:hover .page-id-badge__icon,
.page-id-badge:focus-within .page-id-badge__icon {
  background: rgba(171, 59, 31, 0.2);
  color: #6f2313;
}

.page-id-badge__icon:active {
  transform: scale(0.92);
}

.page-id-badge--copied .page-id-badge__icon {
  background: rgba(79, 106, 60, 0.28);
  color: #2f4823;
}

.page-id-badge__tooltip {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  padding: 5px 9px;
  background: rgba(30, 29, 26, 0.92);
  color: #fbf5ee;
  border-radius: 6px;
  white-space: nowrap;
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.page-id-badge:hover .page-id-badge__tooltip,
.page-id-badge:focus-within .page-id-badge__tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Ensure modal panels can host an absolutely-positioned badge. */
.modal-card,
.disconnect-modal__panel,
.login-modal__panel,
.pin-modal__panel {
  position: relative;
}
