/* ========== Reviews System ========== */

.reviews-section { }

.review-summary {
  display: grid;
  grid-template-columns: 220px 1fr 200px;
  gap: 40px;
  align-items: center;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.review-summary-score {
  text-align: center;
}
.review-avg-num {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.review-avg-stars {
  margin: 8px 0 4px;
  display: flex;
  justify-content: center;
}
.review-total-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.review-summary-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rating-bar-row {
  display: grid;
  grid-template-columns: 60px 1fr 30px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.rating-bar-label {
  color: var(--text-secondary);
}
.rating-bar-track {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.rating-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.rating-bar-count {
  text-align: right;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.review-summary-action {
  display: flex;
  justify-content: flex-end;
}

.reviews-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 24px 0;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-item {
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.review-item:hover {
  border-color: var(--border);
}

.review-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.review-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.review-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.review-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.review-item-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}
.review-item-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.review-list-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 14px;
}

.review-load-more {
  text-align: center;
  margin-top: 20px;
}

/* ---- Star picker (modal form) ---- */
.star-picker {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.star-picker-btn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  line-height: 0;
  color: #d4d4d8;
  transition: transform 0.15s ease;
}
[data-theme="dark"] .star-picker-btn {
  color: #3f3f46;
}
.star-picker-btn:hover {
  transform: scale(1.1);
}

.review-pending-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #047857;
  margin-bottom: 16px;
}
[data-theme="dark"] .review-pending-note {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

/* ---- Modal (reuse .modal style but ensure consistency) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s ease;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.modal-body { padding: 20px 24px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-subtle);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Form (shared) ---- */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent, #06b6d4);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}
.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}
.form-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  min-height: 16px;
}
.form-input.error {
  border-color: #ef4444;
}

.form-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.btn-danger {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .review-summary {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }
  .review-summary-action { justify-content: center; }
  .rating-bar-row { grid-template-columns: 50px 1fr 24px; gap: 8px; font-size: 12px; }
}
