/* ============================================================
   DIYAS.IN — SUPABASE REVIEWS & TESTIMONIALS STYLING
   Aesthetic Dark Theme matching site design system
   ============================================================ */

/* Reviews Summary / Stats Banner */
.reviews-hero-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  margin: 32px 0 40px;
  position: relative;
  overflow: hidden;
}

.reviews-hero-stats::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0.8;
}

.stats-score-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stats-score {
  font-family: var(--display);
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  color: var(--bone);
  letter-spacing: -0.03em;
}

.stats-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-stars {
  display: flex;
  gap: 4px;
  color: #ffb800;
  font-size: 18px;
  line-height: 1;
}

.stats-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reviews-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.filter-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--dim);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--surface-card-hover);
  border-color: var(--red);
  color: var(--bone);
}

/* Reviews Grid */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* Review Card */
.review-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  transition: transform 0.25s var(--ease-out), border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.review-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6), 0 0 20px -5px var(--red-subtle);
}

.review-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.review-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1c1c24, #2c2c38);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--red);
  flex-shrink: 0;
}

.review-user-details h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--bone);
  line-height: 1.3;
}

.review-user-details p {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}

.review-stars {
  color: #ffb800;
  font-size: 13px;
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.review-comment {
  font-size: 14px;
  line-height: 1.65;
  color: #cfcecb;
  margin: 0;
  flex-grow: 1;
}

.review-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim-dark);
}

.review-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #10b981;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Config notice banner */
.supabase-banner {
  background: rgba(241, 36, 32, 0.08);
  border: 1px dashed var(--red);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.supabase-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--bone);
  line-height: 1.4;
}

.supabase-banner code {
  background: var(--surface);
  padding: 3px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--red);
}

/* Modal Backdrop & Dialog */
.review-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 7, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.review-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.review-modal {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px var(--red-subtle);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s var(--ease-out);
  overflow: hidden;
  position: relative;
}

.review-modal-backdrop.is-open .review-modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bone);
}

.modal-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--dim);
  font-family: var(--mono);
}

.modal-close {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: var(--dim);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  border-color: var(--red);
  color: var(--red);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px 28px 28px;
}

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

.form-group label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 8px;
}

.form-group label span.req {
  color: var(--red);
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--bone);
  font-family: var(--display);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red-subtle);
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

/* Star Rating Selector */
.star-rating-picker {
  display: inline-flex;
  gap: 8px;
  font-size: 26px;
  cursor: pointer;
}

.star-rating-picker span {
  color: #383842;
  transition: color 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.star-rating-picker span.active,
.star-rating-picker span.hovered {
  color: #ffb800;
  transform: scale(1.1);
}

/* Submit Button & Loader */
.submit-btn {
  width: 100%;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Message */
.review-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--red);
  border-radius: 10px;
  padding: 16px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  color: var(--bone);
  font-size: 14px;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s var(--ease-out), opacity 0.3s ease;
  max-width: 380px;
}

.review-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
  .reviews-hero-stats {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
  }
  .stats-score {
    font-size: 42px;
  }
  .reviews-grid {
    grid-template-columns: 1fr;
  }
  .review-modal {
    margin: 10px;
  }
  .review-toast {
    left: 20px;
    right: 20px;
    bottom: 85px;
  }
}
