/* ==========================================================================
   Responsive Mainpage-Style Compact Auto-Scrolling Reviews
   ========================================================================== */

.reviews-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #222;
  width: 100%;
}

.reviews-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.reviews-top-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #111;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.reviews-avg-badge {
  background: #fff3e6;
  color: #ff6a00;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 700;
}

.btn-write-review-gmail {
  background: #ffffff;
  color: #333333;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 20px;
  border-radius: 30px;
  border: 1px solid #dddddd;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-write-review-gmail:hover {
  border-color: #ff6a00;
  color: #ff6a00;
  box-shadow: 0 4px 16px rgba(255, 106, 0, 0.15);
  transform: translateY(-1px);
}

/* Horizontal Auto-Scroll Carousel matching Main Page */
.reviews-scroll-container {
  position: relative;
  overflow: hidden;
  padding: 10px 0;
  width: 100%;
}

.reviews-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 15px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.reviews-scroll::-webkit-scrollbar {
  display: none;
}

/* Compact Review Cards matching Main Page */
.review-card-mainstyle {
  flex: 0 0 320px;
  background: #ffffff;
  padding: 22px;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #eeeeee;
  scroll-snap-align: start;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.review-card-mainstyle:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.1);
}

.review-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

/* Dynamic Brand Gradient Avatars with Initials */
.reviewer-initials-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.bg-indiamart-gradient {
  background: linear-gradient(135deg, #005a9c 0%, #00a859 100%);
  border: 1.5px solid #005a9c;
}

.bg-google-gradient {
  background: linear-gradient(135deg, #ff6a00 0%, #ee0979 100%);
  border: 1.5px solid #ff6a00;
}

.user-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #ff6a00;
  flex-shrink: 0;
}

.review-header-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #111;
  margin: 0;
}

.review-location-tag {
  font-size: 0.8rem;
  color: #666;
}

.review-stars-gold {
  color: #ffb400;
  font-size: 1rem;
  margin: 6px 0;
}

.review-meta-date {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 10px;
}

.review-card-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #333;
  margin-bottom: 12px;
}

.review-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-badge {
  background: #e8f5e9;
  color: #128c7e;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 500;
}

.helpful-text {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #666;
}

/* Modal Form styling */
.review-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.review-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.review-modal {
  background: #ffffff;
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.review-modal-overlay.active .review-modal {
  transform: translateY(0);
}

.close-modal-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f0f0f0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.gmail-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.gmail-user-badge img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.gmail-user-info h5 {
  margin: 0;
  font-size: 0.9rem;
  color: #0f172a;
}

.gmail-user-info p {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
}

.star-rating-input {
  display: flex;
  gap: 6px;
  font-size: 1.8rem;
  color: #ddd;
  cursor: pointer;
  margin-bottom: 16px;
}

.star-rating-input span.selected,
.star-rating-input span:hover,
.star-rating-input span:hover ~ span {
  color: #ffb400;
}

.form-group-custom {
  margin-bottom: 14px;
}

.form-group-custom label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 4px;
  color: #222;
}

.form-input-custom {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  box-sizing: border-box;
  font-family: inherit;
}

.btn-submit-review {
  width: 100%;
  background: #ff6a00;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  margin-top: 10px;
}

.btn-submit-review:hover {
  background: #e05a00;
}

/* ==========================================================================
   Mobile Responsiveness for Reviews
   ========================================================================== */

@media (max-width: 768px) {
  .reviews-section {
    padding: 0 12px;
    margin: 30px auto;
  }

  .reviews-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .reviews-top-title {
    font-size: 1.4rem;
  }

  .btn-write-review-gmail {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  .review-card-mainstyle {
    flex: 0 0 280px;
    padding: 18px;
  }

  .review-modal {
    padding: 20px 16px;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .review-card-mainstyle {
    flex: 0 0 260px;
    padding: 16px;
  }

  .reviews-top-title {
    font-size: 1.25rem;
  }
}
