/* BuildMate Rating and Review System Styles */

.rating-summary {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #fafafa;
}

.rating-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 15px;
}

.average-rating {
  display: flex;
  align-items: center;
  gap: 10px;
}

.average-rating-stars .star {
  color: #ffc107;
  font-size: 1.5em;
}

.average-rating-stars .star.empty {
  color: #ddd;
}

.average-rating-text {
  font-weight: bold;
  font-size: 1.1em;
}

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

.rating-summary-details {
  margin-top: 15px;
}

.rating-bar {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.rating-bar-label {
  width: 30px;
  font-size: 0.9em;
  margin-right: 10px;
}

.rating-bar-container {
  flex-grow: 1;
  height: 10px;
  background-color: #eee;
  border-radius: 5px;
  overflow: hidden;
  margin: 0 10px;
}

.rating-bar-progress {
  height: 100%;
  background-color: #ffc107;
  transition: width 0.3s ease;
}

.rating-bar-count {
  width: 20px;
  text-align: right;
  font-size: 0.9em;
  color: #666;
}

.reviews-section {
  margin-top: 30px;
}

.reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.review-count {
  font-size: 1.2em;
  font-weight: bold;
}

.add-review-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
}

.add-review-btn:hover {
  background-color: #218838;
}

.review-form {
  display: none;
  margin-bottom: 30px;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #fff;
}

.review-form.active {
  display: block;
}

.review-form h3 {
  margin-top: 0;
  margin-bottom: 15px;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1em;
  box-sizing: border-box;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.star-rating {
  display: inline-block;
}

.star-rating input[type="radio"] {
  display: none;
}

.star-rating label {
  color: #ddd;
  font-size: 2em;
  padding: 0 3px;
  cursor: pointer;
  transition: color 0.2s;
}

.star-rating label:hover {
  color: #ffc107;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

.review-cancel-btn,
.review-submit-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
}

.review-cancel-btn {
  background-color: #6c757d;
  color: white;
}

.review-cancel-btn:hover {
  background-color: #5a6268;
}

.review-submit-btn {
  background-color: #007bff;
  color: white;
}

.review-submit-btn:hover {
  background-color: #0056b3;
}

.reviews-list {
  margin-top: 20px;
}

.review {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  background-color: #fff;
}

.review-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.review-author {
  font-weight: bold;
}

.review-date {
  color: #666;
  font-size: 0.9em;
}

.review-rating .star {
  color: #ffc107;
}

.review-rating .star.empty {
  color: #ddd;
}

.review-title {
  font-weight: bold;
  margin: 10px 0 5px 0;
}

.review-comment {
  margin: 10px 0;
  line-height: 1.5;
}

.verified-purchase {
  background-color: #d4edda;
  color: #155724;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  margin-top: 5px;
}

.no-reviews {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 20px;
}

.inline-star-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.inline-star-rating .star {
  color: #ffc107;
  font-size: 1em;
}

.inline-star-rating .star.empty {
  color: #ddd;
}

.inline-star-rating .rating-text {
  font-size: 0.9em;
  color: #666;
  margin-left: 5px;
}

/* Responsive design */
@media (max-width: 768px) {
  .rating-summary-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .reviews-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .add-review-btn {
    align-self: flex-start;
  }
  
  .review-form {
    padding: 15px;
  }
  
  .review-header {
    flex-direction: column;
    align-items: flex-start;
  }
}