/* Bolt Reviews - Complete Styles */

:root {
  --bolt-star-color: #FFB800;
  --bolt-star-empty: #E0E0E0;
  --bolt-verified-color: #16A34A;
  --bolt-review-border: #E5E7EB;
  --bolt-review-bg: #F9FAFB;
}

/* Star Rating - Base */
.bolt-reviews-stars,
.bolt-review-stars,
.bolt-reviews-stars-large,
.bolt-stars-small {
  display: inline-flex;
  gap: 2px;
}

.bolt-reviews-stars svg,
.bolt-review-stars svg,
.bolt-reviews-stars-large svg,
.bolt-stars-small svg {
  width: 16px;
  height: 16px;
  fill: var(--bolt-star-empty);
  transition: fill 0.15s ease;
}

.bolt-reviews-stars-large svg {
  width: 24px;
  height: 24px;
}

.bolt-stars-small svg {
  width: 12px;
  height: 12px;
}

/* Filled stars based on rating */
.bolt-reviews-stars[data-rating="1"] svg:nth-child(-n+1),
.bolt-review-stars[data-rating="1"] svg:nth-child(-n+1),
.bolt-reviews-stars-large[data-rating="1"] svg:nth-child(-n+1),
.bolt-stars-small[data-rating="1"] svg:nth-child(-n+1) { fill: var(--bolt-star-color); }

.bolt-reviews-stars[data-rating="2"] svg:nth-child(-n+2),
.bolt-review-stars[data-rating="2"] svg:nth-child(-n+2),
.bolt-reviews-stars-large[data-rating="2"] svg:nth-child(-n+2),
.bolt-stars-small[data-rating="2"] svg:nth-child(-n+2) { fill: var(--bolt-star-color); }

.bolt-reviews-stars[data-rating="3"] svg:nth-child(-n+3),
.bolt-review-stars[data-rating="3"] svg:nth-child(-n+3),
.bolt-reviews-stars-large[data-rating="3"] svg:nth-child(-n+3),
.bolt-stars-small[data-rating="3"] svg:nth-child(-n+3) { fill: var(--bolt-star-color); }

.bolt-reviews-stars[data-rating="4"] svg:nth-child(-n+4),
.bolt-review-stars[data-rating="4"] svg:nth-child(-n+4),
.bolt-reviews-stars-large[data-rating="4"] svg:nth-child(-n+4),
.bolt-stars-small[data-rating="4"] svg:nth-child(-n+4) { fill: var(--bolt-star-color); }

.bolt-reviews-stars[data-rating="5"] svg,
.bolt-review-stars[data-rating="5"] svg,
.bolt-reviews-stars-large[data-rating="5"] svg,
.bolt-stars-small[data-rating="5"] svg { fill: var(--bolt-star-color); }

/* Summary on Product Page (meta) */
.bolt-reviews-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.bolt-reviews-count {
  font-size: 14px;
  color: #6B7280;
  text-decoration: none;
}

.bolt-reviews-count:hover {
  color: var(--color-primary, #000);
  text-decoration: underline;
}

/* Small stars for collection pages */
.bolt-stars-small {
  align-items: center;
}

.bolt-stars-count {
  font-size: 11px;
  color: #6B7280;
  margin-left: 4px;
}

/* Main Reviews Section */
.bolt-reviews {
  margin: 40px 0;
  padding: 40px 0;
  border-top: 1px solid var(--bolt-review-border);
}

.bolt-reviews-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 24px 0;
}

/* Summary Box */
.bolt-reviews-summary-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: start;
  padding: 24px;
  background: var(--bolt-review-bg);
  border-radius: 8px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .bolt-reviews-summary-box {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.bolt-reviews-average {
  text-align: center;
}

.bolt-reviews-score {
  display: block;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.bolt-reviews-total {
  display: block;
  font-size: 14px;
  color: #6B7280;
  margin-top: 8px;
}

/* Rating Distribution */
.bolt-reviews-distribution {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bolt-reviews-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.bolt-reviews-bar .label {
  width: 60px;
  color: #6B7280;
}

.bolt-reviews-bar .bar {
  flex: 1;
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}

.bolt-reviews-bar .fill {
  height: 100%;
  background: var(--bolt-star-color);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.bolt-reviews-bar .count {
  width: 30px;
  text-align: right;
  color: #6B7280;
}

/* Write Review Button */
.bolt-write-review-btn {
  align-self: center;
}

/* Review Form */
.bolt-review-form-container {
  background: var(--bolt-review-bg);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 32px;
}

.bolt-review-form h3 {
  margin: 0 0 24px 0;
  font-size: 20px;
}

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

.bolt-form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
}

.bolt-form-group .required {
  color: #EF4444;
}

.bolt-form-group input[type="text"],
.bolt-form-group input[type="email"],
.bolt-form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--bolt-review-border);
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.bolt-form-group input:focus,
.bolt-form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary, #000);
}

.bolt-form-group small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6B7280;
}

/* Star Input */
.bolt-star-input {
  display: inline-flex;
  gap: 4px;
}

.bolt-star-input button {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.bolt-star-input button:hover {
  transform: scale(1.2);
}

.bolt-star-input svg {
  width: 32px;
  height: 32px;
  fill: var(--bolt-star-empty);
  transition: fill 0.15s ease;
}

.bolt-star-input[data-rating="1"] button:nth-child(-n+1) svg,
.bolt-star-input[data-rating="2"] button:nth-child(-n+2) svg,
.bolt-star-input[data-rating="3"] button:nth-child(-n+3) svg,
.bolt-star-input[data-rating="4"] button:nth-child(-n+4) svg,
.bolt-star-input[data-rating="5"] button svg {
  fill: var(--bolt-star-color);
}

.bolt-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Reviews Controls */
.bolt-reviews-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.bolt-reviews-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bolt-sort-select {
  padding: 8px 12px;
  border: 1px solid var(--bolt-review-border);
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

.bolt-reviews-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bolt-filter-btn {
  padding: 6px 12px;
  border: 1px solid var(--bolt-review-border);
  border-radius: 20px;
  background: white;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bolt-filter-btn:hover,
.bolt-filter-btn.active {
  background: var(--color-primary, #000);
  color: white;
  border-color: var(--color-primary, #000);
}

/* Reviews List */
.bolt-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bolt-reviews-empty {
  text-align: center;
  padding: 48px 24px;
  color: #6B7280;
}

/* Review Item */
.bolt-review-item {
  padding: 24px;
  border: 1px solid var(--bolt-review-border);
  border-radius: 8px;
  background: white;
}

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

.bolt-review-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.bolt-review-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #6B7280;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.bolt-review-author {
  font-weight: 500;
  color: #374151;
}

.bolt-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--bolt-verified-color);
  font-size: 12px;
  font-weight: 500;
}

.bolt-review-content {
  line-height: 1.6;
  margin-bottom: 16px;
}

.bolt-review-content p {
  margin: 0;
}

/* Review Photos */
.bolt-review-photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.bolt-review-photo {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
}

.bolt-review-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Admin Reply */
.bolt-review-reply {
  background: var(--bolt-review-bg);
  border-left: 3px solid var(--color-primary, #000);
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 0 6px 6px 0;
}

.bolt-reply-header {
  margin-bottom: 8px;
  font-size: 14px;
}

.bolt-review-reply p {
  margin: 0;
  font-size: 14px;
}

/* Review Footer */
.bolt-review-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--bolt-review-border);
}

.bolt-review-helpful {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6B7280;
}

.bolt-helpful-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--bolt-review-border);
  border-radius: 4px;
  background: white;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bolt-helpful-btn:hover {
  border-color: var(--color-primary, #000);
}

.bolt-helpful-btn.voted {
  background: var(--bolt-review-bg);
  border-color: var(--color-primary, #000);
}

.bolt-report-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: #9CA3AF;
  cursor: pointer;
}

.bolt-report-btn:hover {
  color: #EF4444;
}

/* Pagination */
.bolt-reviews-pagination {
  text-align: center;
  margin-top: 32px;
}

.bolt-load-more {
  min-width: 200px;
}

/* Loading State */
.bolt-loading {
  text-align: center;
  padding: 24px;
  color: #6B7280;
}

.bolt-loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--bolt-review-border);
  border-top-color: var(--color-primary, #000);
  border-radius: 50%;
  animation: bolt-spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

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

/* Messages */
.bolt-message {
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.bolt-message-success {
  background: #D1FAE5;
  color: #065F46;
}

.bolt-message-error {
  background: #FEE2E2;
  color: #991B1B;
}
