/* Reviews Section */
.reviews-section {
  padding: 3rem 0;
  border-top: 1px solid #eaeaea;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: #333;
  font-weight: 600;
}

/* Rating Summary */
.rating-summary {
  display: flex;
  gap: 3rem;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: #f9f9f9;
  border-radius: 12px;
  margin-right: 100px;
}

.average-rating {
  text-align: center;
  min-width: 150px;
}

.rating-number {
  font-size: 3rem;
  font-weight: 700;
  color: #333;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stars {
  margin-bottom: 0.5rem;
}

.star {
  color: #ddd;
  font-size: 1.2rem;
  display: inline-block;
}

.star.filled {
  color: #ffc107;
}

.review-count {
  color: #666;
  font-size: 0.9rem;
}

.rating-breakdown {
  flex: 1;
}

.rating-bar {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.star-count {
  width: 50px;
  color: #666;
  font-size: 0.9rem;
}

.bar-container {
  flex: 1;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin: 0 0.8rem;
  overflow: hidden;
}

.bar {
  height: 100%;
  background: #ffc107;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.percentage {
  width: 40px;
  color: #666;
  font-size: 0.9rem;
  text-align: right;
}

/* Review Form */
.review-form-container {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: #f9f9f9;
  border-radius: 12px;
}

.review-form-container h3 {
  margin-bottom: 1.2rem;
  font-size: 1.3rem;
  color: #333;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
}

.star-rating-input {
  display: flex;
  gap: 0.3rem;
}

.star-rating-input .star {
  cursor: pointer;
  font-size: 1.8rem;
  transition: color 0.2s;
}

.star-rating-input .star:hover,
.star-rating-input .star.active {
  color: #ffc107;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.image-upload-container {
  margin-top: 0.5rem;
}

.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.image-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eee;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #f0f0f0;
  border: 1px dashed #ccc;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
}

.upload-btn:hover {
  background: #e8e8e8;
  border-color: #999;
}

.btn-submit {
  background: #4a90e2;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: #3a80d2;
}

.login-prompt {
  text-align: center;
  padding: 2rem;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.login-prompt a {
  color: #4a90e2;
  text-decoration: none;
}

.login-prompt a:hover {
  text-decoration: underline;
}

/* Reviews Header */
.reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.reviews-header h3 {
  font-size: 1.3rem;
  color: #333;
}

.filter-sort select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
}

/* Review List */
.review-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* auto responsive */
  gap: 20px; /* spacing between reviews */
  margin-top: 20px;
}

.review-item {
  border: 1px solid #eee;
  padding: 1.5rem;
  border-radius: 8px;
  background: #fff;
}
.review-header {
  margin-bottom: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #4a90e2;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-details {
  flex: 1;
}

.user-name {
  margin: 0 0 0.2rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.review-date {
  color: #666;
  font-size: 0.85rem;
}

.review-title {
  margin: 0 0 0.8rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

.review-comment {
  margin: 0 0 1rem 0;
  line-height: 1.6;
  color: #444;
}

.review-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.review-image {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}

.review-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.review-image:hover img {
  transform: scale(1.05);
}

.admin-reply {
  background: #f5f9ff;
  border-left: 3px solid #4a90e2;
  padding: 1rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1rem;
}

.admin-badge {
  display: inline-block;
  background: #4a90e2;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.reply-date {
  color: #666;
  font-size: 0.8rem;
}

.review-actions {
  margin-top: 1rem;
}

.helpful-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid #ddd;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.helpful-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.helpful-btn.active {
  background: #e6f7ff;
  border-color: #91d5ff;
  color: #1890ff;
}

/* No Reviews */
.no-reviews {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.no-reviews svg {
  margin-bottom: 1rem;
  color: #ccc;
}

.no-reviews h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: #f5f5f5;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: 0.5rem;
}

.page-numbers span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.page-numbers span:hover {
  background: #f5f5f5;
}

.page-active {
  background: #4a90e2;
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .rating-summary {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .reviews-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .review-images {
    gap: 0.3rem;
  }
  
  .review-image {
    width: 80px;
    height: 80px;
  }
  
  .pagination {
    flex-wrap: wrap;
  }
}