/* =========================================================
   Feedback Page Styles
   ========================================================= */

.feedback-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

.feedback-header-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

/* =========================================================
   Stats Grid
   ========================================================= */

.feedback-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.feedback-stats-grid .stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.feedback-stats-grid .stat-value {
  color: var(--text-900);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feedback-stats-grid .stat-label {
  color: var(--text-600);
  font-size: 14px;
}

/* =========================================================
   Feedback Section
   ========================================================= */

.feedback-section {
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-900);
}

/* =========================================================
   Search Bar
   ========================================================= */

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 150px;
  padding: 10px 15px;
  border: 1px solid var(--border-200);
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--text-900);
  background: var(--surface);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-800);
}

/* =========================================================
   Feedback List
   ========================================================= */

.feedback-list {
  display: grid;
  gap: 12px;
}

.feedback-item {
  border: 1px solid var(--border-200);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  background: var(--surface);
  transition: background 0.2s, border-color 0.2s;
}

.feedback-item:hover {
  background: var(--surface-50);
  border-color: var(--brand-800);
}

.feedback-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.feedback-customer {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.customer-name {
  font-weight: 600;
  color: var(--text-900);
  font-size: 15px;
}

.customer-phone {
  font-size: 13px;
  color: var(--text-600);
}

.feedback-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  text-transform: capitalize;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--surface-100);
  color: var(--text-700);
}

.feedback-category svg {
  width: 14px;
  height: 14px;
}

.sentiment-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.sentiment-badge svg {
  width: 14px;
  height: 14px;
}

.sentiment-badge.positive {
  background: color-mix(in srgb, var(--success-600) 20%, var(--white));
  color: var(--success-600);
}

.sentiment-badge.neutral {
  background: color-mix(in srgb, var(--brand-700) 20%, var(--white));
  color: var(--brand-700);
}

.sentiment-badge.negative {
  background: var(--danger-bg);
  color: var(--danger-600);
}

.follow-up-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.follow-up-badge.pending {
  background: color-mix(in srgb, var(--warning-500) 20%, var(--white));
  color: var(--warning-600);
}

.follow-up-badge.completed {
  background: color-mix(in srgb, var(--success-600) 20%, var(--white));
  color: var(--success-600);
}

.feedback-message {
  color: var(--text-800);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feedback-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-date {
  font-size: 12px;
  color: var(--text-600);
}

.sentiment-score {
  font-size: 12px;
  color: var(--text-600);
}

/* =========================================================
   Feedback Detail Modal
   ========================================================= */

.feedback-detail {
  display: grid;
  gap: 24px;
}

.detail-section {
  border: 1px solid var(--border-200);
  border-radius: var(--r-md);
  padding: 16px;
  background: var(--surface-50);
}

.detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-900);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-200);
}

.detail-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.detail-label {
  font-weight: 600;
  color: var(--text-700);
  min-width: 100px;
}

.detail-value {
  color: var(--text-900);
}

.detail-link {
  color: var(--brand-800);
  text-decoration: none;
}

.detail-link:hover {
  text-decoration: underline;
}

.detail-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.detail-tag.category {
  background: var(--surface-100);
  color: var(--text-700);
}

.detail-tag.sentiment.positive {
  background: color-mix(in srgb, var(--success-600) 20%, var(--white));
  color: var(--success-600);
}

.detail-tag.sentiment.neutral {
  background: color-mix(in srgb, var(--brand-700) 20%, var(--white));
  color: var(--brand-700);
}

.detail-tag.sentiment.negative {
  background: var(--danger-bg);
  color: var(--danger-600);
}

.detail-tag svg {
  width: 14px;
  height: 14px;
}

.detail-message {
  color: var(--text-900);
  font-size: 14px;
  line-height: 1.6;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border-200);
}

.detail-sentiment-info {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-200);
  font-size: 13px;
  color: var(--text-600);
}

/* =========================================================
   Follow-up Section
   ========================================================= */

.follow-up-status {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
}

.follow-up-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-700);
}

.follow-up-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.follow-up-checkbox input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* =========================================================
   Form Elements
   ========================================================= */

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-700);
  margin-bottom: 6px;
}

.form-group textarea {
  width: 100%;
  padding: 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-200);
  font-size: 14px;
  background: var(--surface);
  color: var(--text-900);
  font-family: inherit;
  resize: vertical;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-800);
}

/* =========================================================
   Loading & Empty States
   ========================================================= */

.loading {
  padding: 40px;
  text-align: center;
  color: var(--text-600);
}

.empty-state {
  padding: 60px 40px;
  text-align: center;
  color: var(--text-600);
  font-style: italic;
  border: 1px dashed var(--border-200);
  border-radius: var(--r-md);
}

.error-message {
  padding: 40px;
  text-align: center;
  color: var(--danger-600);
}

/* =========================================================
   Modal Styles (reused from dashboard.css)
   ========================================================= */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, #000000 50%, transparent);
  z-index: 1100;
}

.modal-content {
  background: var(--surface);
  margin: 50px auto;
  padding: 30px;
  width: min(800px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-200);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-900);
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--text-600);
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  transition: background 0.2s, color 0.2s;
}

.close-btn:hover {
  background: var(--surface-100);
  color: var(--text-900);
}

/* =========================================================
   Mobile Overrides
   ========================================================= */

@media (max-width: 768px) {
  .feedback-container {
    padding: 0 12px;
  }

  .feedback-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .feedback-stats-grid .stat-value {
    font-size: 24px;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-input {
    width: 100%;
  }

  .feedback-item-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .feedback-meta {
    width: 100%;
  }

  .detail-row {
    flex-direction: column;
    gap: 4px;
  }

  .detail-label {
    min-width: auto;
  }

  .follow-up-status {
    flex-direction: column;
    gap: 10px;
  }

  .modal-content {
    margin: 20px;
    padding: 20px;
    max-height: 85vh;
  }

  .modal-title {
    font-size: 18px;
  }
}
