/* ================================================================
   FEEDBACK WIDGET — FAB + Popover
   ================================================================ */

/* ===== FAB Button ===== */
.feedback-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.feedback-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  background: var(--accent-hover, var(--accent));
}

.feedback-fab:active {
  transform: scale(0.95);
}

.feedback-fab svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}

/* ===== Popover ===== */
.feedback-popover {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 340px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle, #e0e0e0);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 100;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.feedback-popover.feedback-popover--open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== Header ===== */
.feedback-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle, #e0e0e0);
}

.feedback-popover-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg, #1a1a1a);
}

.feedback-popover-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--fg-muted, #888);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.feedback-popover-close:hover {
  background: var(--bg-hover, #f0f0f0);
  color: var(--fg, #1a1a1a);
}

/* ===== Body ===== */
.feedback-popover-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feedback-select {
  padding: 8px 12px;
  border: 1px solid var(--border-subtle, #e0e0e0);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-card, #fff);
  color: var(--fg, #1a1a1a);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feedback-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.feedback-textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle, #e0e0e0);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-card, #fff);
  color: var(--fg, #1a1a1a);
  resize: vertical;
  min-height: 80px;
  max-height: 200px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.feedback-textarea::placeholder {
  color: var(--fg-muted, #888);
}

.feedback-page-hint {
  font-size: 11px;
  color: var(--fg-muted, #888);
}

/* ===== Footer ===== */
.feedback-popover-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle, #e0e0e0);
  display: flex;
  justify-content: flex-end;
}

.feedback-submit-btn {
  min-width: 80px;
}

/* ===== Status Messages ===== */
.feedback-status {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

.feedback-status--success {
  color: var(--success, #22c55e);
}

.feedback-status--error {
  color: var(--danger, #ef4444);
}

/* ===== Dark Mode ===== */
[data-theme="dark"] .feedback-fab {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .feedback-fab:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .feedback-popover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .feedback-select,
[data-theme="dark"] .feedback-textarea {
  background: var(--bg-elevated, #2a2a2a);
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .feedback-fab {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }

  .feedback-fab svg {
    width: 20px;
    height: 20px;
  }

  .feedback-popover {
    bottom: 72px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .feedback-fab,
  .feedback-popover {
    transition: none;
  }
}
