/* ──────────────────────────────────────────
   Community Feedback Portal
   Accent: #FBBF24 (teal)
   Namespace: .feedback-*
   ────────────────────────────────────────── */

:root {
  --fb-accent: #FBBF24;
  --fb-accent-dim: rgba(251, 191, 36, 0.15);
  --fb-accent-hover: #2DD4BF;
  --fb-accent-glow: rgba(251, 191, 36, 0.25);
  --fb-bg: #141118;
  --fb-card: #1e1b24;
  --fb-card-hover: #252230;
  --fb-border: #2a2733;
  --fb-text: #e0dce6;
  --fb-text-dim: #9e98a8;
  --fb-success: #22C55E;
  --fb-error: #EF4444;
}

/* ── Container ── */
.feedback-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

/* ── Tabs ── */
.feedback-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin-bottom: 1.5rem;
}
.feedback-tab {
  background: none;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  border-radius: 14px;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
  white-space: nowrap;
}
.feedback-tab:hover { color: #fff; background: rgba(255,255,255,0.06); }
.feedback-tab.active {
  color: #000;
  background: var(--fb-accent);
  border-color: var(--fb-accent);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}
.feedback-panel { display: none; }
.feedback-panel.active { display: block; }
.feedback-faq-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.feedback-faq-item strong { color: #FBBF24; font-size: 0.95rem; }
.feedback-faq-item p { color: rgba(255,255,255,0.65); font-size: 0.88rem; line-height: 1.6; margin: 0.5rem 0 0; }

/* ── Intro ── */
.feedback-intro {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--fb-text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}
.feedback-intro strong {
  color: var(--fb-accent);
}

/* ── Category Cards ── */
.feedback-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
.feedback-cat-card {
  background: color-mix(in srgb, var(--fb-accent) 8%, var(--fb-card));
  -webkit-backdrop-filter: blur(var(--glass-blur-card));
  backdrop-filter: blur(var(--glass-blur-card));
  border: 1px solid color-mix(in srgb, var(--fb-accent) 18%, transparent);
  border-radius: var(--glass-radius-card);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.feedback-cat-card:hover,
.feedback-cat-card.active {
  background: color-mix(in srgb, var(--fb-accent) 18%, var(--fb-card));
  border-color: color-mix(in srgb, var(--fb-accent) 40%, transparent);
  box-shadow: 0 0 20px var(--fb-accent-glow);
}
.feedback-cat-card.active {
  border-color: var(--fb-accent);
}
.feedback-cat-emoji {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 0.3rem;
}
.feedback-cat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fb-text);
}

/* ── Form ── */
.feedback-form-section {
  background: rgba(6, 6, 12, 0.55);
  -webkit-backdrop-filter: blur(var(--glass-blur-card));
  backdrop-filter: blur(var(--glass-blur-card));
  border: var(--glass-border);
  border-radius: var(--glass-radius-card);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}
.feedback-form-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fb-text);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.feedback-disclaimer {
  font-size: 0.72rem;
  color: #6b6577;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  background: none;
  border: none;
  border-left: 2px solid #3a3545;
}
.feedback-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.feedback-form-row.full {
  grid-template-columns: 1fr;
}
.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.feedback-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fb-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.feedback-label .optional {
  font-weight: 400;
  text-transform: none;
  color: var(--fb-text-dim);
  opacity: 0.6;
}
.feedback-input,
.feedback-select,
.feedback-textarea {
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  color: var(--fb-text);
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.feedback-input:focus,
.feedback-select:focus,
.feedback-textarea:focus {
  outline: none;
  border-color: var(--fb-accent);
  box-shadow: 0 0 0 2px var(--fb-accent-dim);
}
.feedback-input::placeholder,
.feedback-textarea::placeholder {
  color: var(--fb-text-dim);
  opacity: 0.5;
}
.feedback-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239e98a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}
.feedback-textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}

/* Honeypot — hidden from users, visible to bots */
.feedback-hp { position: absolute; left: -9999px; opacity: 0; height: 0; }

.feedback-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}
.feedback-submit {
  background: var(--fb-accent);
  color: #0f0d13;
  border: none;
  border-radius: 14px;
  padding: 0.7rem 1.8rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.feedback-submit:hover {
  background: var(--fb-accent-hover);
  box-shadow: 0 0 20px var(--fb-accent-glow);
}
.feedback-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.feedback-submit-hint {
  font-size: 0.72rem;
  color: #6b6577;
}
.feedback-submit-hints {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: #6b6577;
  line-height: 1.4;
}

/* ── Status Messages ── */
.feedback-status {
  display: none;
  padding: 1rem;
  border-radius: 14px;
  margin-top: 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
}
.feedback-status.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--fb-success);
}
.feedback-status.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--fb-error);
}

/* ── Recent Feedback Section ── */
.feedback-recent {
  margin-top: 2rem;
}
.feedback-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.feedback-recent-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fb-text);
}

/* ── Search ── */
.feedback-search-wrap {
  flex-shrink: 0;
}
.feedback-search {
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  color: var(--fb-text);
  font-size: 0.78rem;
  font-family: inherit;
  width: 180px;
  transition: border-color 0.2s;
}
.feedback-search:focus {
  outline: none;
  border-color: var(--fb-accent);
  box-shadow: 0 0 0 2px var(--fb-accent-dim);
}
.feedback-search::placeholder {
  color: var(--fb-text-dim);
  opacity: 0.5;
}
.feedback-no-results {
  text-align: center;
  padding: 1.5rem;
  color: var(--fb-text-dim);
  font-size: 0.85rem;
}

/* ── Status Labels ── */
.feedback-status-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}
.feedback-sl-shipped {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
}
.feedback-sl-planned {
  background: rgba(59, 130, 246, 0.15);
  color: #FBBF24;
}
.feedback-sl-in-progress {
  background: rgba(234, 179, 8, 0.15);
  color: #EAB308;
}
.feedback-sl-wont-fix {
  background: rgba(107, 101, 119, 0.15);
  color: #6b6577;
}

/* ── Pinned items ── */
.feedback-acc-pinned {
  border-color: color-mix(in srgb, var(--fb-accent) 25%, transparent);
}
.feedback-acc-pinned .feedback-acc-header {
  background: color-mix(in srgb, var(--fb-accent) 5%, var(--fb-card));
}
.feedback-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.feedback-recent-item {
  background: rgba(6, 6, 12, 0.55);
  -webkit-backdrop-filter: blur(var(--glass-blur-subtle));
  backdrop-filter: blur(var(--glass-blur-subtle));
  border: var(--glass-border);
  border-radius: var(--glass-radius-button);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.2s;
}
.feedback-recent-item:hover {
  border-color: color-mix(in srgb, var(--fb-accent) 30%, transparent);
  box-shadow: 0 0 15px var(--fb-accent-glow);
}
.feedback-recent-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}
.feedback-recent-cat {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.feedback-recent-body {
  flex: 1;
  min-width: 0;
}
.feedback-recent-body-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feedback-recent-meta {
  font-size: 0.72rem;
  color: var(--fb-text-dim);
  margin-top: 0.15rem;
}
.feedback-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.feedback-badge.open {
  background: rgba(251, 191, 36, 0.15);
  color: var(--fb-accent);
}
.feedback-badge.answered {
  background: rgba(34, 197, 94, 0.15);
  color: var(--fb-success);
}

/* ── Empty State ── */
.feedback-empty {
  text-align: center;
  padding: 2rem;
  color: var(--fb-text-dim);
  font-size: 0.88rem;
}
.feedback-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* ── Browse on GitHub link ── */
.feedback-github-link {
  text-align: center;
  margin-top: 1.5rem;
}
.feedback-github-link a {
  color: var(--fb-accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s;
}
.feedback-github-link a:hover {
  color: var(--fb-accent-hover);
  text-decoration: underline;
}

/* ── CTA bar (for embedding on tool pages) ── */
.feedback-cta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 0.5rem;
  padding: 1rem 1.2rem;
  background: color-mix(in srgb, #FBBF24 6%, #1e1b24);
  border: 1px solid color-mix(in srgb, #FBBF24 15%, transparent);
  border-radius: 16px;
}
.feedback-cta-text {
  color: var(--fb-text-dim, #9e98a8);
  font-size: 0.85rem;
  margin: 0;
}
.feedback-cta-btn {
  background: #FBBF24;
  color: #0f0d13;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.feedback-cta-btn:hover {
  background: #2DD4BF;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.25);
}

/* ── How It Works ── */
.feedback-how {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.feedback-how-step {
  text-align: center;
  padding: 1.2rem 0.8rem;
}
.feedback-how-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--fb-accent);
  color: #0f0d13;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.feedback-how-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fb-text);
  margin-bottom: 0.25rem;
}
.feedback-how-desc {
  font-size: 0.75rem;
  color: var(--fb-text-dim);
  line-height: 1.4;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .feedback-form-row {
    grid-template-columns: 1fr;
  }
  .feedback-categories {
    grid-template-columns: repeat(2, 1fr);
  }
  .feedback-how {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .feedback-how-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    padding: 0.8rem 0;
  }
  .feedback-how-num {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .feedback-submit-row {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  .feedback-submit {
    justify-content: center;
  }
  .feedback-cta-bar {
    flex-direction: column;
    text-align: center;
    gap: 0.6rem;
  }
}

/* ── Focus visible (accessibility) ── */
.feedback-input:focus-visible,
.feedback-select:focus-visible,
.feedback-textarea:focus-visible,
.feedback-submit:focus-visible,
.feedback-cat-card:focus-visible,
.feedback-cta-btn:focus-visible {
  outline: 2px solid var(--fb-accent);
  outline-offset: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .feedback-cat-card,
  .feedback-submit,
  .feedback-cta-btn,
  .feedback-input,
  .feedback-select,
  .feedback-textarea,
  .feedback-recent-item,
  .feedback-quick-btn {
    transition: none;
    animation: none;
  }
}

/* ── Stats Counter ── */
.feedback-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
  background: color-mix(in srgb, var(--fb-accent) 6%, var(--fb-card));
  border: 1px solid color-mix(in srgb, var(--fb-accent) 12%, transparent);
  border-radius: 14px;
  font-size: 0.82rem;
  color: var(--fb-text-dim);
}
.feedback-stats-icon {
  font-size: 1.1rem;
}

/* ── Quick Reactions ── */
.feedback-quick {
  margin-bottom: 2rem;
}
.feedback-quick-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fb-text);
  margin-bottom: 0.6rem;
  text-align: center;
}
.feedback-quick-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
.feedback-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.8rem 0.5rem;
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--fb-text);
  font-family: inherit;
}
.feedback-quick-btn:hover {
  background: color-mix(in srgb, var(--fb-accent) 12%, var(--fb-card));
  border-color: color-mix(in srgb, var(--fb-accent) 30%, transparent);
  transform: translateY(-2px);
}
.feedback-quick-btn.sending {
  opacity: 0.7;
  pointer-events: none;
}
.feedback-quick-btn.sent {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--fb-success);
}
.feedback-quick-emoji {
  font-size: 1.5rem;
}
.feedback-quick-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

/* ── Character Counter ── */
.feedback-char-count {
  font-size: 0.68rem;
  color: var(--fb-text-dim);
  opacity: 0.6;
  text-align: right;
  margin-top: 0.15rem;
}
.feedback-char-count.warn {
  color: #EAB308;
  opacity: 1;
}
.feedback-char-count.over {
  color: var(--fb-error);
  opacity: 1;
}

/* ── Dropdown pulse animation ── */
.feedback-pulse {
  animation: fb-pulse 0.6s ease;
}
@keyframes fb-pulse {
  0%   { box-shadow: 0 0 0 0 var(--fb-accent-glow); }
  50%  { box-shadow: 0 0 0 4px var(--fb-accent-glow); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Success Detail ── */
.feedback-success-detail {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: 14px;
  font-size: 0.82rem;
  color: var(--fb-text-dim);
  line-height: 1.5;
}
.feedback-success-detail p {
  margin: 0 0 0.4rem;
}
.feedback-success-detail strong {
  color: var(--fb-success);
}
.feedback-success-link {
  color: var(--fb-accent);
  font-weight: 600;
  text-decoration: none;
}
.feedback-success-link:hover {
  text-decoration: underline;
}

/* ── Responsive additions ── */
@media (max-width: 640px) {
  .feedback-quick-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Quick button selected state ── */
.feedback-quick-btn.selected {
  background: color-mix(in srgb, var(--fb-accent) 18%, var(--fb-card));
  border-color: var(--fb-accent);
  box-shadow: 0 0 14px var(--fb-accent-glow);
}

/* ── Form flash animation ── */
.feedback-flash {
  animation: fb-flash 0.8s ease;
}
@keyframes fb-flash {
  0%   { border-color: var(--fb-border); }
  30%  { border-color: var(--fb-accent); box-shadow: 0 0 20px var(--fb-accent-glow); }
  100% { border-color: var(--fb-border); box-shadow: none; }
}

/* ── Accordion (Prompts-style pattern) ── */
.feedback-acc {
  border: 1px solid var(--fb-border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s;
}
.feedback-acc:hover {
  border-color: color-mix(in srgb, var(--fb-accent) 25%, transparent);
}
.feedback-acc-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--fb-card);
  border: none;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  text-align: left;
  user-select: none;
}
.feedback-acc-header:hover {
  background: var(--fb-card-hover);
}
.feedback-acc-header:focus-visible {
  outline: 2px solid var(--fb-accent);
  outline-offset: -2px;
  border-radius: 4px;
}
.feedback-acc-arrow {
  color: var(--fb-accent);
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
}
.feedback-acc-emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.feedback-acc-info {
  flex: 1;
  min-width: 0;
}
.feedback-acc-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feedback-acc-meta {
  font-size: 0.72rem;
  color: var(--fb-text-dim);
  margin-top: 0.1rem;
}
.feedback-acc-body {
  padding: 0.75rem 1rem 1rem 2.6rem;
  background: color-mix(in srgb, var(--fb-accent) 3%, var(--fb-bg));
  border-top: 1px solid var(--fb-border);
}
.feedback-acc-question {
  font-size: 0.85rem;
  color: var(--fb-text-dim);
  line-height: 1.6;
  margin-bottom: 0.6rem;
  white-space: pre-wrap;
}
.feedback-acc-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fb-accent);
  text-decoration: none;
}
.feedback-acc-link:hover {
  text-decoration: underline;
}
