/* AinurCollab feedback widget: sticky notes, freehand drawing, voice notes,
   dropped onto any static site for design/review feedback capture.

   Site-agnostic by default — every color/font falls back to a generic dark
   theme via CSS custom properties, so this drops onto any page unstyled and
   still looks fine. To theme it to match a site, define these on :root
   (or anywhere above where this stylesheet loads) before this file:
     --fw-bg, --fw-bg-2, --fw-line, --fw-text, --fw-text-dim,
     --fw-accent, --fw-accent-dim, --fw-amber, --fw-red,
     --fw-font-body, --fw-font-mono, --fw-ease
   This file is meant to be copied per-site (see README.md) — strip it (and
   feedback-widget.js + api/) before a reviewed site goes live. */

.fw-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--fw-accent, #2E86AB); color: var(--fw-bg, #14181c);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  font-size: 22px; line-height: 1;
  transition: transform 0.2s var(--fw-ease, ease), background 0.2s;
}
.fw-fab:hover { transform: scale(1.06); }
.fw-fab.is-open { background: var(--fw-text, #eef1f4); }

.fw-menu {
  position: fixed; right: 22px; bottom: 86px; z-index: 200;
  display: none; flex-direction: column; gap: 8px;
  background: var(--fw-bg, #14181c); border: 1px solid var(--fw-line, #2a3138);
  border-radius: 10px; padding: 10px; min-width: 180px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  font-family: var(--fw-font-body, system-ui, sans-serif);
}
.fw-menu.is-open { display: flex; }
.fw-menu button {
  all: unset; cursor: pointer; color: var(--fw-text, #eef1f4);
  padding: 8px 10px; border-radius: 6px; font-size: 0.88rem;
  display: flex; align-items: center; gap: 8px;
}
.fw-menu button:hover { background: var(--fw-line, #2a3138); }
.fw-menu button.is-active { background: var(--fw-accent-dim, #1f5f78); color: var(--fw-bg, #14181c); }
.fw-menu .fw-sep { border-top: 1px solid var(--fw-line, #2a3138); margin: 2px 0; }

.fw-mode-banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 210;
  display: none; align-items: center; gap: 12px;
  background: var(--fw-bg, #14181c); border: 1px solid var(--fw-accent, #2E86AB); color: var(--fw-text, #eef1f4);
  padding: 9px 16px; border-radius: 30px; font-family: var(--fw-font-body, system-ui, sans-serif); font-size: 0.86rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.fw-mode-banner.is-open { display: flex; }
.fw-mode-banner button { all: unset; cursor: pointer; color: var(--fw-amber, #E0A94F); font-size: 0.82rem; }

body.fw-note-mode { cursor: crosshair; }

.fw-pin {
  position: absolute; z-index: 150; width: 28px; height: 28px;
  border-radius: 50% 50% 50% 4px; transform: translate(-50%, -100%) rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  border: 2px solid var(--fw-bg, #14181c);
}
.fw-pin span { transform: rotate(45deg); font-size: 12px; font-weight: 600; color: var(--fw-bg, #14181c); }
.fw-pin[data-color="amber"] { background: var(--fw-amber, #E0A94F); }
.fw-pin[data-color="green"] { background: var(--fw-accent, #2E86AB); }
.fw-pin[data-color="red"] { background: var(--fw-red, #D64545); }
.fw-pin.fw-pin-voice { border-radius: 50%; transform: translate(-50%, -100%); }

.fw-popover {
  position: absolute; z-index: 220; width: 260px;
  background: var(--fw-text, #eef1f4); color: var(--fw-bg, #14181c); border-radius: 8px;
  padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-family: var(--fw-font-body, system-ui, sans-serif); font-size: 0.86rem;
}
.fw-popover textarea {
  width: 100%; min-height: 70px; resize: vertical; margin-top: 8px;
  border: 1px solid var(--fw-line, #2a3138); border-radius: 6px; padding: 8px;
  font-family: var(--fw-font-body, system-ui, sans-serif); font-size: 0.86rem; background: #fff;
}
.fw-popover input[type="text"] {
  width: 100%; margin-top: 6px; padding: 7px 8px; border-radius: 6px;
  border: 1px solid var(--fw-line, #2a3138); font-family: var(--fw-font-body, system-ui, sans-serif); font-size: 0.84rem;
}
.fw-swatches { display: flex; gap: 8px; margin-top: 10px; }
.fw-swatch { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.fw-swatch[data-color="amber"] { background: var(--fw-amber, #E0A94F); }
.fw-swatch[data-color="green"] { background: var(--fw-accent, #2E86AB); }
.fw-swatch[data-color="red"] { background: var(--fw-red, #D64545); }
.fw-swatch.is-selected { border-color: var(--fw-bg, #14181c); }
.fw-popover-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.fw-btn {
  all: unset; cursor: pointer; padding: 7px 14px; border-radius: 6px;
  font-size: 0.8rem; font-weight: 600;
}
.fw-btn-primary { background: var(--fw-bg, #14181c); color: var(--fw-text, #eef1f4); }
.fw-btn-ghost { color: var(--fw-text-dim, #8a94a0); }
.fw-btn-ghost:hover { color: var(--fw-bg, #14181c); }
.fw-btn:disabled { opacity: 0.5; cursor: default; }

.fw-draw-canvas { position: absolute; top: 0; left: 0; z-index: 140; pointer-events: none; }
body.fw-draw-mode .fw-draw-canvas { pointer-events: auto; cursor: crosshair; }

.fw-draw-toolbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 210;
  display: none; align-items: center; gap: 10px;
  background: var(--fw-bg, #14181c); border: 1px solid var(--fw-line, #2a3138); border-radius: 30px;
  padding: 10px 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.fw-draw-toolbar.is-open { display: flex; }
.fw-draw-toolbar input[type="range"] { width: 80px; }

.fw-voice-panel {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); z-index: 210;
  display: none; flex-direction: column; gap: 10px; align-items: center;
  background: var(--fw-bg, #14181c); border: 1px solid var(--fw-line, #2a3138); border-radius: 12px;
  padding: 16px; min-width: 220px; box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  font-family: var(--fw-font-body, system-ui, sans-serif); color: var(--fw-text, #eef1f4);
}
.fw-voice-panel.is-open { display: flex; }
.fw-voice-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--fw-red, #D64545); display: none; }
.fw-voice-dot.is-rec { display: block; animation: fwPulse 1s infinite; }
@keyframes fwPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.fw-voice-time { font-family: var(--fw-font-mono, ui-monospace, monospace); font-size: 0.85rem; color: var(--fw-text-dim, #8a94a0); }
.fw-voice-panel audio { width: 100%; }

.fw-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
  z-index: 230; background: var(--fw-text, #eef1f4); color: var(--fw-bg, #14181c); padding: 10px 18px;
  border-radius: 30px; font-family: var(--fw-font-body, system-ui, sans-serif); font-size: 0.85rem;
  opacity: 0; pointer-events: none; transition: all 0.25s var(--fw-ease, ease);
}
.fw-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .fw-fab { right: 14px; bottom: 14px; }
  .fw-menu { right: 14px; bottom: 78px; }
  .fw-popover { width: 220px; }
}
