/* Star Rating Styles */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.star-rating-stars {
  display: inline-flex;
  gap: 0.15rem;
}

.star-rating .star {
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.15s, color 0.15s;
  color: #d4d4d4;
}

.star-rating .star:hover {
  transform: scale(1.15);
}

.star-rating .star.filled {
  color: #d4a017; /* Gold that complements berry */
}

.star-rating .star.preview {
  color: #e8c547; /* Lighter gold for hover preview */
}

.star-rating .star.half {
  position: relative;
}

.star-rating .star.half::before {
  content: '\f005';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: #d4a017;
}

/* Rating Info */
.star-rating-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

.star-rating-average {
  font-weight: 600;
  color: var(--berry, #600329);
}

.star-rating-count {
  color: #888;
}

/* Feedback message */
.star-rating-feedback {
  background: #d4edda;
  color: #155724;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-left: 0.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* User's rating indicator */
.star-rating-user {
  font-size: 0.85rem;
  color: var(--berry, #600329);
  font-style: italic;
}

/* Compact variant for recipe cards */
.star-rating.compact {
  gap: 0.35rem;
}

.star-rating.compact .star {
  font-size: 1.1rem;
}

.star-rating.compact .star-rating-info {
  font-size: 0.8rem;
}

/* Compact Star Rating (for glance boxes) */
.star-rating-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.star-rating-compact-stars {
  display: inline-flex;
  gap: 0.1rem;
}

.star-rating-compact .star-compact {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

.star-rating-compact .star-compact.filled {
  color: #ffd700; /* Bright gold for visibility on dark background */
}

.star-rating-compact .star-compact.half {
  position: relative;
}

.star-rating-compact .star-compact.half::before {
  content: '\f005';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: #ffd700;
}

.star-rating-compact-avg {
  font-weight: 600;
  color: #ffd700;
}

.star-rating-compact-count {
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 576px) {
  .star-rating {
    flex-wrap: wrap;
  }
  
  .star-rating .star {
    font-size: 1.3rem;
  }
  
  .star-rating-info {
    width: 100%;
    margin-top: 0.25rem;
  }
}

/* Compact star rating: shrink on small devices (e.g. glance boxes) */
@media (max-width: 767px) {
  .star-rating-compact {
    gap: 0.2rem;
    margin-top: 0.25rem;
    font-size: 0.65rem;
  }
  .star-rating-compact-stars {
    gap: 0.05rem;
  }
  .star-rating-compact .star-compact {
    font-size: 0.6rem;
  }
}
