/* issue-prompt.css — "something went wrong, file an issue" nudge + issue-button highlight.
   Paired with src/core/issue-prompt.js. Uses shared design tokens; honors reduced motion. */

/* ---- the prompt banner ---------------------------------------------------- */

.issue-prompt {
  position: fixed;
  top: calc(var(--top-nav-height, 88px) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-14px);
  z-index: 13050; /* above content + FABs; below top-most theme overlays. TODO: tokenize (audit B24) */
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(440px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: var(--radius, 16px);
  background: var(--bg-elevated, #fff);
  color: var(--text-primary, #1c1c1e);
  border: 1px solid var(--surface-border, var(--border, rgba(0, 0, 0, 0.12)));
  box-shadow: var(--shadow-soft-lg, 0 18px 50px rgba(0, 0, 0, 0.22));
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base, 260ms) ease, transform var(--transition-base, 260ms) ease;
}

.issue-prompt[hidden] {
  display: none;
}

.issue-prompt.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.issue-prompt-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--sutra-warning, #b45309) 18%, transparent);
  color: var(--sutra-warning, #b45309);
  font-size: 16px;
}

.issue-prompt-body {
  flex: 1 1 auto;
  min-width: 0;
}

.issue-prompt-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 2px;
}

.issue-prompt-message {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary, #555);
}

.issue-prompt-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.issue-prompt-actions .neumo-btn {
  font-size: 0.82rem;
  padding: 7px 14px;
}

/* primary action picks up the accent; .btn-primary already styles it, this just
   guarantees a readable fallback if the family CSS is absent. */
.issue-prompt-report {
  background: var(--accent, #6b5bd2);
  color: #fff;
  border-color: transparent;
}

/* ---- highlight the issue (feedback) button -------------------------------- */
/* The FAB itself is .feedback-fab (#feedbackFabBtn). When an error is found we
   pulse an attention ring around it so the user can find where to report. */

.feedback-fab.issue-attention {
  position: relative;
  border-color: var(--sutra-warning, #b45309) !important;
  color: var(--sutra-warning, #b45309) !important;
  animation: issue-fab-pulse 1.6s ease-in-out infinite;
}

.feedback-fab.issue-attention::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid color-mix(in srgb, var(--sutra-warning, #b45309) 70%, transparent);
  pointer-events: none;
  animation: issue-fab-ring 1.6s ease-out infinite;
}

@keyframes issue-fab-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sutra-warning, #b45309) 45%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--sutra-warning, #b45309) 0%, transparent); }
}

@keyframes issue-fab-ring {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ---- mobile --------------------------------------------------------------- */

@media (max-width: 720px) {
  .issue-prompt {
    top: calc(var(--top-nav-height-mobile, 64px) + 10px);
    width: calc(100vw - 24px);
  }
}

/* ---- reduced motion ------------------------------------------------------- */
/* Keep the highlight visible but stop the looping animation; keep the banner
   instant rather than sliding. */

@media (prefers-reduced-motion: reduce) {
  .issue-prompt {
    transition: opacity 120ms ease;
    transform: translateX(-50%) translateY(0);
  }
  .issue-prompt.is-visible {
    transform: translateX(-50%) translateY(0);
  }
  .feedback-fab.issue-attention {
    animation: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sutra-warning, #b45309) 45%, transparent);
  }
  .feedback-fab.issue-attention::after {
    animation: none;
    opacity: 0.85;
  }
}
