/* ==================== VAULT REVIEWS & RATINGS ==================== */
/* Rating stars, review cards, and aggregate stats */

/* ==================== STAR RATING ==================== */
.star-rating {
  display: flex;
  align-items: center;
  gap: 2px;
}

.star-rating .star {
  font-size: 16px;
  color: var(--game-border);
  transition: all 0.15s ease;
  cursor: default;
  filter: grayscale(100%);
  opacity: 0.5;
}

.star-rating .star.filled {
  color: var(--game-gold);
  filter: none;
  opacity: 1;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

.star-rating .star.half {
  color: var(--game-gold);
  filter: none;
  opacity: 0.7;
}

/* Interactive rating (for submitting) */
.star-rating.interactive .star {
  cursor: pointer;
}

.star-rating.interactive .star:hover {
  transform: scale(1.2);
  color: var(--game-gold-bright);
  filter: none;
  opacity: 1;
}

.star-rating.interactive:hover .star {
  color: var(--game-gold);
  filter: none;
  opacity: 0.6;
}

.star-rating.interactive:hover .star:hover,
.star-rating.interactive:hover .star:hover ~ .star {
  opacity: 0.6;
}

.star-rating.interactive .star:hover,
.star-rating.interactive .star.hovered {
  opacity: 1 !important;
  color: var(--game-gold-bright);
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
}

/* Compact rating (for cards) */
.rating-compact {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--game-text-dim);
}

.rating-compact .star-icon {
  color: var(--game-gold);
  font-size: 12px;
}

.rating-compact .rating-value {
  color: var(--game-text);
  font-weight: 600;
}

.rating-compact .rating-count {
  color: var(--game-text-dim);
  font-size: 10px;
}

/* ==================== RATING INPUT SECTION (Modal) ==================== */
.rating-input-section {
  padding: 20px;
  background: var(--game-bg-slot);
  border-radius: 12px;
  border: 1px solid var(--game-border);
  margin-top: 20px;
}

.rating-input-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.rating-input-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--game-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-input-stars {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.rating-input-stars .star-rating {
  gap: 4px;
}

.rating-input-stars .star {
  font-size: 28px;
  padding: 4px;
}

.rating-label {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--game-gold);
  min-width: 80px;
}

/* Review text input */
.review-input-container {
  margin-top: 16px;
}

.review-textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  background: var(--game-bg-dark);
  border: 1px solid var(--game-border);
  border-radius: 8px;
  color: var(--game-text);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  resize: vertical;
  transition: var(--game-transition);
}

.review-textarea:focus {
  outline: none;
  border-color: var(--game-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.review-textarea::placeholder {
  color: var(--game-text-dim);
}

.review-char-count {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--game-text-dim);
}

.review-char-count.warning {
  color: #f59e0b;
}

.review-char-count.limit {
  color: var(--rarity-mythic);
}

/* Submit button */
.review-submit-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--game-border);
}

.review-submit-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--game-gold), var(--game-gold-bright));
  border: none;
  border-radius: 8px;
  color: var(--game-bg-dark);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--game-transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.review-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.review-must-own {
  font-size: 11px;
  color: var(--game-text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-must-own .lock-icon {
  font-size: 14px;
}

/* ==================== RATING DISTRIBUTION BAR ==================== */
.rating-distribution {
  margin: 20px 0;
}

.rating-distribution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rating-distribution-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--game-text);
}

.rating-distribution-avg {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-big-number {
  font-family: 'Press Start 2P', monospace;
  font-size: 24px;
  color: var(--game-gold);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

.rating-distribution-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.rating-bar-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--game-text);
  min-width: 24px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.rating-bar-label .mini-star {
  font-size: 10px;
  color: var(--game-gold);
}

.rating-bar-track {
  flex: 1;
  height: 8px;
  background: var(--game-bg-dark);
  border-radius: 4px;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--game-gold), var(--game-gold-bright));
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.rating-bar-count {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--game-text-dim);
  min-width: 30px;
  text-align: right;
}

/* ==================== REVIEWS SECTION (Modal) ==================== */
.reviews-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--game-border);
}

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

.reviews-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--game-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.reviews-count {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--game-text-dim);
  padding: 4px 10px;
  background: var(--game-bg-slot);
  border-radius: 12px;
}

/* Sort dropdown */
.reviews-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reviews-sort label {
  font-size: 11px;
  color: var(--game-text-dim);
}

.reviews-sort select {
  padding: 6px 24px 6px 10px;
  background: var(--game-bg-slot);
  border: 1px solid var(--game-border);
  border-radius: 6px;
  color: var(--game-text);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 12px;
}

.reviews-sort select:focus {
  outline: none;
  border-color: var(--game-gold);
}

/* ==================== REVIEW CARD ==================== */
.review-card {
  background: var(--game-bg-slot);
  border: 1px solid var(--game-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--game-transition);
}

.review-card:hover {
  border-color: var(--game-border-hover);
}

.review-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--game-bg-dark);
  border: 2px solid var(--game-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--game-text-dim);
  overflow: hidden;
}

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

.review-author-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-author-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--game-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.verified-purchase-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-radius: 10px;
  font-size: 9px;
  font-weight: bold;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--game-text-dim);
}

.review-rating {
  display: flex;
  align-items: center;
}

.review-date {
  font-family: 'Space Mono', monospace;
}

.review-card-body {
  margin-bottom: 12px;
}

.review-text {
  font-size: 13px;
  color: var(--game-text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.review-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--game-border);
}

/* Helpful button */
.helpful-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--game-border);
  border-radius: 16px;
  color: var(--game-text-dim);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: var(--game-transition);
}

.helpful-btn:hover {
  border-color: var(--game-gold);
  color: var(--game-gold);
}

.helpful-btn.voted {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--game-gold);
  color: var(--game-gold);
}

.helpful-btn .helpful-icon {
  font-size: 14px;
}

.helpful-btn .helpful-count {
  font-weight: bold;
}

/* Report button */
.review-report-btn {
  background: none;
  border: none;
  color: var(--game-text-dim);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: var(--game-transition);
}

.review-card:hover .review-report-btn {
  opacity: 0.5;
}

.review-report-btn:hover {
  color: var(--rarity-mythic);
  opacity: 1 !important;
}

/* ==================== REVIEWS LIST ==================== */
.reviews-list {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.reviews-list::-webkit-scrollbar {
  width: 6px;
}

.reviews-list::-webkit-scrollbar-track {
  background: var(--game-bg-dark);
  border-radius: 3px;
}

.reviews-list::-webkit-scrollbar-thumb {
  background: var(--game-border);
  border-radius: 3px;
}

.reviews-list::-webkit-scrollbar-thumb:hover {
  background: var(--game-border-hover);
}

/* See all reviews button */
.see-all-reviews-btn {
  width: 100%;
  padding: 12px;
  background: var(--game-bg-slot);
  border: 1px dashed var(--game-border);
  border-radius: 8px;
  color: var(--game-text-dim);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: var(--game-transition);
  margin-top: 8px;
}

.see-all-reviews-btn:hover {
  border-color: var(--game-gold);
  color: var(--game-gold);
  border-style: solid;
}

/* Empty reviews state */
.reviews-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--game-text-dim);
}

.reviews-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.reviews-empty-title {
  font-size: 14px;
  margin-bottom: 8px;
}

.reviews-empty-text {
  font-size: 12px;
  opacity: 0.8;
}

/* ==================== AGGREGATE RATING ON CARDS ==================== */
.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.card-rating .star-icon {
  color: var(--game-gold);
  font-size: 12px;
  text-shadow: 0 0 6px rgba(212, 175, 55, 0.6);
}

.card-rating .rating-value {
  color: var(--game-text);
  font-weight: 600;
}

.card-rating .rating-count {
  color: var(--game-text-dim);
}

/* Position on item cards */
.item-card .card-rating {
  position: absolute;
  top: auto;
  bottom: 48px;
  left: 12px;
  z-index: 4;
}

/* Position on carousel items */
.carousel-item .card-rating {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 4;
}

/* ==================== LOADING STATES ==================== */
.review-loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-skeleton {
  background: var(--game-bg-slot);
  border-radius: 12px;
  padding: 16px;
  animation: review-skeleton-pulse 1.5s ease-in-out infinite;
}

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

.review-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--game-bg-dark);
}

.review-skeleton-info {
  flex: 1;
}

.review-skeleton-name {
  width: 120px;
  height: 14px;
  background: var(--game-bg-dark);
  border-radius: 4px;
  margin-bottom: 6px;
}

.review-skeleton-meta {
  width: 80px;
  height: 10px;
  background: var(--game-bg-dark);
  border-radius: 4px;
}

.review-skeleton-body {
  height: 40px;
  background: var(--game-bg-dark);
  border-radius: 4px;
}

@keyframes review-skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ==================== STAR ANIMATION ==================== */
@keyframes star-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.star-rating.interactive .star.selected {
  animation: star-pop 0.3s ease;
}

/* Gold glow animation on hover */
@keyframes star-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(212, 175, 55, 0.6); }
  50% { text-shadow: 0 0 16px rgba(212, 175, 55, 1), 0 0 24px rgba(255, 215, 0, 0.5); }
}

.star-rating.interactive .star:hover {
  animation: star-glow 0.8s ease-in-out infinite;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .rating-input-section {
    padding: 16px;
  }
  
  .rating-input-stars {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .rating-input-stars .star {
    font-size: 32px;
    padding: 6px;
  }
  
  .rating-distribution-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .review-card {
    padding: 14px;
  }
  
  .review-author {
    gap: 10px;
  }
  
  .review-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .reviews-list {
    max-height: 300px;
  }
  
  .helpful-btn {
    padding: 8px 14px;
    min-height: 44px;
  }
  
  .review-submit-section {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .review-submit-btn {
    justify-content: center;
    min-height: 48px;
  }
  
  .review-must-own {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .rating-input-stars .star {
    font-size: 36px;
  }
  
  .reviews-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .reviews-sort {
    width: 100%;
  }
  
  .reviews-sort select {
    flex: 1;
  }
}
