/* ════════════════════════════════════════════════════════════════
   fs-quick-edit · Welle 41.F.2 · Long-Press → Lightbox-Pattern
   ════════════════════════════════════════════════════════════════
   Wiederverwendbar für alle Module. Markiert Elemente mit
   data-fs-quick-edit="<entity>" + data-fs-id="<id>". Long-Press 500ms
   öffnet Lightbox mit konfigurierten Feldern (data-fs-fields).

   PFLICHT-Pattern:
   - Long-Press-Pulse-Ring (Modul-Akzent oder Lime fallback)
   - Lightbox-Modal mit blur-Backdrop
   - Inline-Form mit Save-Toast
   - Esc/Tap-Außen schließt · Save speichert + reload optional
   - Haptic-Feedback (40ms vibrate) wenn supported
   ════════════════════════════════════════════════════════════════ */

/* Long-Press · Pulse-Ring auf Element */
.fs-qe-target { position: relative; }
.fs-qe-target.is-long-pressing { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.fs-qe-target.is-long-pressing::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  border: 2px solid var(--module-accent, var(--accent));
  pointer-events: none;
  animation: fsQePulse .55s cubic-bezier(.16,1,.3,1);
  z-index: 100;
}
@keyframes fsQePulse {
  0% { opacity: 0; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.06); }
}

/* Backdrop + Modal */
.fs-qe-bd {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fsQeFadeIn .12s ease-out;
}
.fs-qe-bd.is-open { display: flex; }
@keyframes fsQeFadeIn { from { opacity: 0; } to { opacity: 1; } }

.fs-qe-modal {
  background: var(--charcoal, #18181B);
  border: 1px solid var(--module-accent, var(--accent));
  box-shadow: 0 24px 72px rgba(0,0,0,.6), 0 0 0 1px rgba(var(--module-accent-rgb, 216 255 60), .18);
  border-radius: 14px;
  padding: 30px;
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  animation: fsQeSlide .18s cubic-bezier(.22,.94,.36,1.04);
}
@keyframes fsQeSlide { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }

.fs-qe-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}
.fs-qe-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: .58rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--module-accent, var(--accent));
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}
.fs-qe-title {
  font-family: 'Mona Sans', sans-serif;
  font-weight: 900;
  font-variation-settings: 'wdth' 125;
  font-size: 1.6rem;
  margin: 0;
  letter-spacing: -.02em;
  line-height: 1;
  color: var(--paper);
}
.fs-qe-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  aspect-ratio: 1/1;
  clip-path: polygon(50% 0%, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  color: var(--mist);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Geist Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
}
.fs-qe-close:hover { background: rgba(255,255,255,.1); color: var(--paper); }

.fs-qe-form { display: flex; flex-direction: column; gap: 14px; }
.fs-qe-row { display: flex; flex-direction: column; gap: 6px; }
.fs-qe-label {
  font-family: 'Geist Mono', monospace;
  font-size: .58rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 500;
}
.fs-qe-input, .fs-qe-select, .fs-qe-textarea {
  width: 100%;
  padding: 12px 14px;
  min-height: 44px;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
  font-family: Inter, sans-serif;
  font-size: 16px; /* 16px = iOS-Auto-Zoom-Prevention (CLAUDE-EISERN Mobile-Pflicht) */
  transition: border-color .15s;
}
.fs-qe-input:focus, .fs-qe-select:focus, .fs-qe-textarea:focus {
  border-color: var(--module-accent, var(--accent));
  outline: none;
}
.fs-qe-textarea { min-height: 88px; resize: vertical; }

.fs-qe-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.fs-qe-btn {
  padding: 12px 22px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  border-radius: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .12s;
}
.fs-qe-btn:hover { transform: translateY(-1px); border-color: var(--module-accent, var(--accent)); color: var(--module-accent, var(--accent)); }
.fs-qe-btn.is-primary {
  background: var(--accent);  /* CTA bleibt Brand-Lime */
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 700;
}
.fs-qe-btn.is-primary:hover { background: #e6ff55; color: var(--ink); border-color: var(--accent); }

.fs-qe-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--module-accent, var(--accent));
  color: var(--module-accent-ink, var(--ink));
  padding: 14px 22px;
  border-radius: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transition: all .25s ease-out;
  opacity: 0;
  z-index: 10001;
}
.fs-qe-toast.is-visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.fs-qe-toast.is-danger { background: #FF6464; color: var(--paper); }

/* D&D-Visual-Affordances · Sortable.js Helper */
.fs-qe-sortable [data-fs-sort] { cursor: grab; }
.fs-qe-sortable [data-fs-sort]:active { cursor: grabbing; }
.fs-qe-sortable .fs-qe-ghost {
  opacity: .35;
  background: rgba(var(--module-accent-rgb, 216 255 60), .08) !important;
  border-color: var(--module-accent, var(--accent)) !important;
}
.fs-qe-sortable .fs-qe-chosen {
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 50;
}
.fs-qe-sortable .fs-qe-drag {
  transform: rotate(1.5deg);
  outline: 2px dashed var(--module-accent, var(--accent));
}

@media (max-width: 640px) {
  .fs-qe-modal { padding: 22px; max-width: 100%; }
  .fs-qe-title { font-size: 1.3rem; }
  .fs-qe-actions { flex-direction: column-reverse; }
  .fs-qe-btn { width: 100%; text-align: center; }
}
