/**
 * AI Feedback widget — thumbs up/down.
 */

.ai-feedback-widget {
  margin: 24px 0 0;
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.ai-feedback-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-feedback-label {
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
}

.ai-feedback-buttons {
  display: flex;
  gap: 8px;
}

.ai-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}

.ai-feedback-btn::before {
  content: none !important;
  display: none !important;
}

.ai-feedback-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: none;
  box-shadow: none;
  color: #475569;
}

.ai-feedback-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.ai-feedback-btn--selected {
  border-color: #059669;
  background: #ecfdf5;
  color: #059669;
}

.ai-feedback-btn--selected.ai-feedback-btn--down {
  border-color: #dc2626;
  background: #fef2f2;
  color: #dc2626;
}

/* Thank you message */
.ai-feedback-thanks {
  color: #059669;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 8px;
}

/* Structured reasons (shown on downvote) */
.ai-feedback-reasons {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  display: none;
}

.ai-feedback-reasons.is-visible {
  display: block;
}

.ai-feedback-reasons-title {
  color: #334155;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.ai-feedback-reasons-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ai-feedback-reason {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: white;
  color: #475569;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  font-weight: 400;
  overflow: visible;
}

.ai-feedback-reason::before {
  content: none !important;
  display: none !important;
}

.ai-feedback-reason:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: none;
  box-shadow: none;
  color: #475569;
}

.ai-feedback-reason.is-selected {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Reason group sections */
.ai-feedback-reason-group {
  margin-bottom: 10px;
}

.ai-feedback-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 5px;
}

.ai-feedback-reason--other {
  margin-bottom: 10px;
}

/* Price reference prompt */
.ai-feedback-price-prompt {
  margin: 8px 0 10px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
}

.ai-feedback-price-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #92400e;
  margin-bottom: 6px;
}

.ai-feedback-price-input {
  width: 120px;
  padding: 5px 8px;
  border: 1px solid #fbbf24;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #334155;
  background: white;
}

.ai-feedback-price-input::placeholder {
  color: #94a3b8;
}

.ai-feedback-reason input {
  display: none;
}

.ai-feedback-text {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.825rem;
  font-family: inherit;
  resize: vertical;
  min-height: 40px;
  max-height: 100px;
  margin-bottom: 8px;
  color: #334155;
}

.ai-feedback-text::placeholder {
  color: #94a3b8;
}

.ai-feedback-submit-row {
  display: flex;
  justify-content: flex-end;
}

.ai-feedback-submit {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: #334155;
  color: white;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}

.ai-feedback-submit::before {
  content: none !important;
  display: none !important;
}

.ai-feedback-submit:hover {
  background: #1e293b;
  transform: none;
  box-shadow: none;
}

.ai-feedback-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Already voted state */
.ai-feedback-widget--voted .ai-feedback-prompt {
  opacity: 0.7;
}

/* Login hint for anonymous users */
.ai-feedback-login-hint {
  font-size: 0.8rem;
  color: #94a3b8;
  align-self: center;
}

.ai-feedback-login-hint a {
  color: #4299e1;
  text-decoration: none;
  font-weight: 500;
}

.ai-feedback-login-hint a:hover {
  text-decoration: underline;
}

/* "Close" button — amber/neutral styling */
.ai-feedback-btn--mid {
  border-color: #cbd5e1;
}

.ai-feedback-btn--mid:hover {
  background: #fffbeb;
  border-color: #f59e0b;
}

.ai-feedback-btn--selected.ai-feedback-btn--mid {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
}

/* Sidebar variant — compact layout for right column */
.ai-feedback-widget--sidebar {
  margin: 0.75rem 0;
  padding: 12px 14px;
}

.ai-feedback-widget--sidebar .ai-feedback-prompt {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.ai-feedback-widget--sidebar .ai-feedback-buttons {
  width: 100%;
  justify-content: space-between;
}

.ai-feedback-widget--sidebar .ai-feedback-btn {
  flex: 1;
  justify-content: center;
  padding: 5px 8px;
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .ai-feedback-prompt {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
