/* =========================================================
   rating-widget.css
   ========================================================= */

.rating-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 32px;
  max-width: 620px;
  margin: 0 auto 36px;
  position: relative;
  overflow: hidden;
}
.rating-widget::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(0,229,255,0.04), transparent 70%);
  pointer-events: none;
}

/* Stats row */
.rating-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}
.rating-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}
.rating-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rating-stat-icon { font-size: 1rem; }
.rating-stat-num  {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.rating-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Core rating display */
.rating-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.rating-avg {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.rating-stars-display {
  display: flex;
  gap: 2px;
}
.star-display {
  font-size: 1.1rem;
  line-height: 1;
}
.star-full  { color: #fbbf24; }
.star-half  { color: #fbbf24; opacity: 0.6; }
.star-empty { color: var(--text-muted); }
.rating-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Input row */
.rating-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  width: 100%;
}
.rating-prompt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Star picker */
.star-picker {
  display: flex;
  gap: 4px;
}
.star-btn {
  font-size: 1.6rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 3px;
  line-height: 1;
  transition: color 0.12s, transform 0.12s;
  position: relative;
}
/* Hover: light up this star and all before it */
.star-picker:hover .star-btn        { color: var(--text-muted); }
.star-picker .star-btn:hover        { color: #fbbf24; transform: scale(1.25); }
.star-picker .star-btn:hover ~ .star-btn { color: var(--text-muted); }

/* JS adds .active class to fill chosen stars */
.star-btn.active { color: #fbbf24; }

/* Pulse on hover */
.star-btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(251,191,36,0);
  transition: background 0.15s;
}
.star-btn:hover::after { background: rgba(251,191,36,0.1); }

/* Thanks message */
.rating-thanks {
  font-size: 0.82rem;
  color: var(--green);
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

/* Light mode adjustments */
body.light-mode .rating-widget {
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

@media (max-width: 600px) {
  .rating-widget { padding: 16px 20px; }
  .rating-divider { display: none; }
  .rating-stats   { gap: 16px; }
}
