/**
 * RADEXEL Design System - Feedback Modal Component
 *
 * Two-tab modal: Submit Feedback / My Feedback History.
 * Includes category selector, text area, screenshot upload area.
 * Migrated from ai-infinite-chat FeedbackModal.jsx patterns.
 */

/* ==========================================================================
   Feedback Modal Overrides
   ========================================================================== */

.feedback-modal .modal {
  max-width: 560px;
}


/* ==========================================================================
   Tab Navigation
   ========================================================================== */

.feedback-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border-light);
}

.feedback-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-default),
    border-color var(--duration-fast) var(--ease-default);
}

.feedback-tab:hover {
  color: var(--color-text);
}

.feedback-tab.active {
  color: var(--rdx-blue);
  border-bottom-color: var(--rdx-blue);
}

.feedback-tab svg {
  width: 16px;
  height: 16px;
}

.feedback-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
}

.feedback-tab.active .feedback-tab__badge {
  background: var(--color-info-light);
  color: var(--rdx-blue);
}


/* ==========================================================================
   Tab Content
   ========================================================================== */

.feedback-tab-content {
  display: none;
}

.feedback-tab-content.active {
  display: block;
}


/* ==========================================================================
   Submit Tab - Category Selector
   ========================================================================== */

.feedback-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.feedback-category {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-default),
    border-color var(--duration-fast) var(--ease-default),
    color var(--duration-fast) var(--ease-default);
}

.feedback-category:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border);
}

.feedback-category.selected {
  background: var(--color-info-light);
  border-color: var(--rdx-blue);
  color: var(--rdx-blue);
}

.feedback-category__icon {
  font-size: var(--font-size-md);
  line-height: 1;
}


/* ==========================================================================
   Submit Tab - Text Area
   ========================================================================== */

.feedback-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 300px;
  padding: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  resize: vertical;
  transition:
    border-color var(--duration-fast) var(--ease-default),
    box-shadow var(--duration-fast) var(--ease-default);
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: var(--shadow-focus);
}

.feedback-textarea::placeholder {
  color: var(--color-text-muted);
}

.feedback-char-count {
  text-align: right;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.feedback-char-count.near-limit {
  color: var(--color-warning);
}

.feedback-char-count.at-limit {
  color: var(--color-danger);
}


/* ==========================================================================
   Submit Tab - Screenshot Upload
   ========================================================================== */

.feedback-screenshots {
  margin-top: var(--space-4);
}

.feedback-screenshots__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.feedback-screenshots__label svg {
  width: 16px;
  height: 16px;
}

.feedback-upload-area {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: var(--space-4);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-default),
    background-color var(--duration-fast) var(--ease-default);
}

.feedback-upload-area:hover {
  border-color: var(--rdx-blue);
  background: var(--color-info-light);
  color: var(--rdx-blue);
}

.feedback-upload-area.dragover {
  border-color: var(--rdx-blue);
  background: var(--color-info-light);
}

.feedback-preview-list {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

.feedback-preview-item {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.feedback-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feedback-preview-item__remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}


/* ==========================================================================
   History Tab - Feedback List
   ========================================================================== */

.feedback-history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.feedback-history-item {
  padding: var(--space-3);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.feedback-history-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.feedback-history-item__category {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.feedback-history-item__category--bug {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.feedback-history-item__category--feature {
  background: var(--color-info-light);
  color: var(--color-info);
}

.feedback-history-item__category--ux {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.feedback-history-item__category--general {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.feedback-history-item__status {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.feedback-history-item__status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

.feedback-history-item__status--new::before {
  background: var(--color-success);
}

.feedback-history-item__status--reviewing::before {
  background: var(--color-warning);
}

.feedback-history-item__status--resolved::before {
  background: var(--color-text-muted);
}

.feedback-history-item__body {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: var(--line-height-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feedback-history-item__date {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.feedback-history-item__admin-response {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border-left: 3px solid var(--rdx-blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.feedback-history-item__admin-response-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--rdx-blue);
  margin-bottom: var(--space-1);
}
