/* GEIST globaler Feedback-Button — Tom-Wunsch 2026-06-26.
 *
 * Schwebender '?'-Kreis bottom-right + Modal-Form mit Auto-Context.
 * Erscheint in jeder GEIST-App (16+ apps), Senden an Master :8127 /api/feedback.
 *
 * Royalblau-CI (#2B61A1) — analog buttons.css.
 * Modal selbst wird ueber geistModal-Pattern (modal.css/modal.js) gerendert —
 * dieses CSS stylesheet ist NUR der Schwebebutton + Toast-Hinweise.
 */

/* ---------- Schwebebutton bottom-right ---------- */
.geist-feedback-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2B61A1;
  color: #fff;
  border: none;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  z-index: 9000;       /* unter modal-backdrop (9999), ueber normalem UI */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
.geist-feedback-fab:hover {
  background: #1d4ed8;
  transform: scale(1.06);
}
.geist-feedback-fab:focus {
  outline: 2px solid #2B61A1;
  outline-offset: 2px;
}
.geist-feedback-fab[disabled] {
  background: #8A8F98;
  cursor: not-allowed;
}

/* ---------- Modal-Body Inhalt ---------- */
.geist-feedback-pills {
  display: flex;
  gap: 8px;
  margin: 6px 0 14px 0;
  flex-wrap: wrap;
}
.geist-feedback-pill {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid #d0d7e2;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: #2b3038;
}
.geist-feedback-pill:hover {
  background: #f0f4fa;
}
.geist-feedback-pill.is-active {
  background: #2B61A1;
  color: #fff;
  border-color: #2B61A1;
}

.geist-feedback-textarea {
  width: 100%;
  min-height: 90px;
  padding: 8px 10px;
  border: 1px solid #d0d7e2;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}

.geist-feedback-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px 0;
  font-size: 13px;
  color: #2b3038;
}
.geist-feedback-row input[type="checkbox"] {
  margin: 0;
}

.geist-feedback-ctx {
  margin-top: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #555;
  background: #f6f8fb;
  border: 1px solid #e0e6ee;
  border-radius: 4px;
  padding: 8px 10px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.geist-feedback-ctx-toggle {
  background: none;
  border: none;
  color: #2B61A1;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  margin-top: 4px;
  text-decoration: underline;
}

/* ---------- Auto-Error-Toast (window.onerror) ---------- */
.geist-feedback-toast {
  position: fixed;
  right: 18px;
  bottom: 76px;
  max-width: 340px;
  background: #fff;
  border: 1px solid #d4b400;
  border-left: 4px solid #d4b400;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  padding: 12px 14px;
  border-radius: 6px;
  z-index: 9001;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: #2b3038;
}
.geist-feedback-toast b {
  display: block;
  margin-bottom: 4px;
  color: #5a4a00;
}
.geist-feedback-toast-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.geist-feedback-toast-actions button {
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid #d0d7e2;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.geist-feedback-toast-actions button.primary {
  background: #2B61A1;
  color: #fff;
  border-color: #2B61A1;
}

/* ---------- kleiner Success-Toast nach Senden ---------- */
.geist-feedback-sent {
  position: fixed;
  right: 18px;
  bottom: 76px;
  background: #2B61A1;
  color: #fff;
  padding: 10px 16px;
  border-radius: 4px;
  z-index: 9001;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  animation: geist-feedback-fadein 0.18s ease-out;
}
@keyframes geist-feedback-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Admin-Liste (im Master :8127 /admin/feedback) ---------- */
.feedback-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 12px;
}
.feedback-list th, .feedback-list td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e0e6ee;
  vertical-align: top;
}
.feedback-list th {
  background: #f6f8fb;
  font-weight: 600;
  color: #2b3038;
}
.feedback-list tr.is-erledigt {
  color: #8A8F98;
}
.feedback-list tr.is-erledigt td a { color: #8A8F98; }
.feedback-list a { color: #2B61A1; }

.feedback-typ-bug      { color: #c0392b; font-weight: 600; }
.feedback-typ-wunsch   { color: #2B61A1; font-weight: 600; }
.feedback-typ-frage    { color: #2B61A1; font-weight: 600; }
.feedback-typ-autoerror{ color: #d4b400; font-weight: 600; }

.feedback-detail-pre {
  background: #f6f8fb;
  border: 1px solid #e0e6ee;
  border-radius: 4px;
  padding: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  overflow: auto;
  max-height: 360px;
  white-space: pre-wrap;
  word-break: break-word;
}
.feedback-detail-screenshot {
  max-width: 100%;
  border: 1px solid #d0d7e2;
  border-radius: 4px;
  margin-top: 8px;
}

.feedback-filter-bar {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
  align-items: center;
}
.feedback-filter-bar select, .feedback-filter-bar input {
  padding: 4px 8px;
  border: 1px solid #d0d7e2;
  border-radius: 4px;
  font-size: 13px;
}
