/* Floating "Report an issue" widget — desktop only (host element is is-hidden-touch).
   Minimal pill + expandable panel, bottom-right, matches the AI-panel design language
   (neutral surface, purple accent). Dark-mode handled via bulma theme vars. */

#issue-widget {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 900; /* above content, below modals (1000) and navbar-priority layers */
  font-family: "DM Sans", sans-serif;
}

.issue-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--bulma-border, #dbdbdb);
  background: var(--bulma-scheme-main, #fff);
  color: var(--bulma-text, #333);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  opacity: 0.82;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.issue-pill:hover,
.issue-pill:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  color: var(--wise-purple, #8B5CF6);
}
.issue-pill .icon { color: var(--wise-purple, #8B5CF6); }

@keyframes issue-pulse-kf {
  0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(139, 92, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}
.issue-pill.issue-pulse { animation: issue-pulse-kf 1.2s ease-out 4; }

.issue-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.6rem);
  width: 340px;
  max-width: calc(100vw - 2rem);
  background: var(--bulma-scheme-main, #fff);
  border: 1px solid var(--bulma-border, #dbdbdb);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  padding: 0.9rem 1rem 0.8rem;
}
.issue-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.issue-panel-title { font-weight: 700; font-size: 0.9rem; }
.issue-close {
  background: none;
  border: none;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--bulma-text-weak, #888);
  cursor: pointer;
  padding: 0 0.15rem;
}
.issue-close:hover { color: var(--bulma-text, #333); }
.issue-panel-sub {
  font-size: 0.76rem;
  color: var(--bulma-text, #555);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}
.issue-textarea {
  font-size: 0.82rem;
  border-radius: 10px;
  min-height: 64px;
  resize: vertical;
}
.issue-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.55rem;
}
.issue-screenshot-toggle {
  color: var(--bulma-text-weak, #777);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}
.issue-submit {
  padding: 0.45rem 1.1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #8B5CF6, #4F46E5);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.issue-submit:hover:enabled { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35); }
.issue-submit:disabled { opacity: 0.6; cursor: default; }

.issue-feedback {
  margin-top: 0.5rem;
  font-size: 0.76rem;
  line-height: 1.35;
}
.issue-feedback-ok { color: var(--bulma-success, #18794e); }
.issue-feedback-err { color: var(--bulma-danger, #b3261e); }

@media (max-width: 768px) {
  #issue-widget { display: none; } /* belt-and-braces: never on touch layouts */
}

/* kind selector row */
.issue-kind-row { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; }
.issue-kind {
  flex: 1;
  padding: 0.3rem 0;
  border: 1px solid var(--bulma-border, #dbdbdb);
  border-radius: 8px;
  background: transparent;
  color: var(--bulma-text, #555);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.issue-kind:hover { border-color: var(--wise-purple, #8B5CF6); }
.issue-kind.is-active {
  border-color: var(--wise-purple, #8B5CF6);
  background: rgba(139, 92, 246, 0.08);
  color: var(--wise-purple, #8B5CF6);
}

/* inline quick answer */
.issue-answer {
  margin-top: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(24, 121, 78, 0.07);
  border: 1px solid rgba(24, 121, 78, 0.25);
}
.issue-answer-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bulma-success, #18794e);
  margin-bottom: 0.2rem;
}
.issue-answer-text { font-size: 0.78rem; line-height: 1.4; color: var(--bulma-text, #333); }
