/* idegrab — Admin-Pins (Rechtsklick-Feature) Styles.
 *
 * Brand-konsistent mit map/style.css:
 *  - Inter, 14px Basis, --ab-red #FF385C
 *  - 12-14px border-radius, soft shadow auf #fafafa
 *  - Pill-Buttons für Label-Auswahl
 *
 * Drei UI-Bausteine:
 *   .adm-pin-menu        Das kleine Rechtsklick-Kontextmenü
 *   .adm-pin-modal-root  Das Add-Modal mit Label-Auswahl
 *   .adm-pin-toast       Bottom-Center Mini-Toast nach Erfolg
 */

/* =================================================================== */
/*  Kontextmenü                                                         */
/* =================================================================== */

.adm-pin-menu {
  position: fixed;
  z-index: 9500;
  min-width: 200px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.16), 0 0 0 1px rgba(0,0,0,0.06);
  padding: 6px;
  font-family: inherit;
  font-size: 13px;
  animation: adm-fade-in 0.12s ease-out;
}
.adm-pin-menu[hidden] { display: none; }

.adm-pin-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  border-radius: 8px;
  text-align: left;
  font: inherit;
  color: #222;
  cursor: pointer;
}
.adm-pin-menu-item:hover { background: #fafafa; }
.adm-pin-menu-item:active { background: #f2f2f2; }

.adm-pin-menu-icon {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-size: 14px;
}
.adm-pin-menu-label {
  flex: 1;
  font-weight: 500;
}
.adm-pin-menu-sub {
  color: #9a9a9a;
  font-size: 11px;
  font-weight: 400;
}

/* =================================================================== */
/*  Modal                                                               */
/* =================================================================== */

.adm-pin-modal-root {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: inherit;
}
.adm-pin-modal-root[hidden] { display: none; }

.adm-pin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  animation: adm-fade-in 0.12s ease-out;
}

.adm-pin-modal {
  position: relative;
  width: min(440px, 100%);
  max-height: min(90vh, 620px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.06);
  animation: adm-modal-in 0.16s ease-out;
}

@keyframes adm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes adm-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.adm-pin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f2f2f2;
}
.adm-pin-modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #222;
}
.adm-pin-modal-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #9a9a9a;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
}
.adm-pin-modal-close:hover { color: #222; background: #fafafa; }

.adm-pin-modal-body {
  padding: 16px 20px;
}

.adm-pin-modal-hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: #717171;
  line-height: 1.45;
  background: #fafafa;
  border-radius: 8px;
  padding: 10px 12px;
}
.adm-pin-modal-hint b { color: #d7263d; }

.adm-pin-coords {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #484848;
  background: #fff1f4;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

.adm-pin-label-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.adm-pin-lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
  transition: border-color 0.12s, background 0.12s;
}
.adm-pin-lbl input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.adm-pin-lbl .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px currentColor;
}
.adm-pin-lbl:hover { background: #fafafa; }
.adm-pin-lbl:has(input:checked) {
  border-color: var(--ab-red, #FF385C);
  background: #fff1f4;
  color: var(--ab-red, #FF385C);
}
.adm-pin-lbl:has(input:checked) .dot {
  transform: scale(1.15);
}

.adm-pin-note-row {
  display: block;
  margin-bottom: 14px;
}
.adm-pin-note-row > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #484848;
  margin-bottom: 6px;
}
.adm-pin-note-row textarea {
  width: 100%;
  min-height: 64px;
  max-height: 180px;
  resize: vertical;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  color: #222;
  background: #fff;
}
.adm-pin-note-row textarea:focus {
  outline: none;
  border-color: var(--ab-red, #FF385C);
  box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.12);
}

.adm-pin-modal-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.adm-pin-modal-status.adm-status-info {
  background: #fff1f4;
  color: #484848;
}
.adm-pin-modal-status.adm-status-ok {
  background: #e7f6f4;
  color: #1d7a6d;
}
.adm-pin-modal-status.adm-status-err {
  background: #fdecee;
  color: #a11a2c;
}

.adm-pin-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid #f2f2f2;
}
.adm-pin-modal-foot .btn-ghost {
  background: transparent;
  border: 1px solid #ebebeb;
  padding: 9px 14px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: #484848;
  cursor: pointer;
}
.adm-pin-modal-foot .btn-ghost:hover { background: #fafafa; }

.adm-pin-modal-foot .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ab-red, #FF385C);
  color: #fff;
  border: 0;
  padding: 9px 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.adm-pin-modal-foot .btn-primary:hover { background: #e5314f; }
.adm-pin-modal-foot .btn-primary:disabled {
  opacity: 0.65;
  cursor: progress;
}

.adm-pin-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: adm-spin 0.9s linear infinite;
}
.adm-pin-spinner[hidden] { display: none; }
@keyframes adm-spin {
  to { transform: rotate(360deg); }
}

/* =================================================================== */
/*  Toast                                                               */
/* =================================================================== */

.adm-pin-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 9700;
  background: #222;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(560px, calc(100vw - 32px));
}
.adm-pin-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.adm-pin-toast-msg {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-pin-toast-ok       { background: #1f7a3a; }
.adm-pin-toast-err      { background: #8b2626; }
.adm-pin-toast-loading  { background: #222; }

/* Mini-Spinner links vom Toast-Text (für Background-Jobs). */
.adm-pin-toast-spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.28);
  border-top-color: #fff;
  animation: adm-pin-toast-spin 0.75s linear infinite;
  flex: 0 0 auto;
}
@keyframes adm-pin-toast-spin {
  to { transform: rotate(360deg); }
}
