/* ============================================================
   RATINGS.CSS — Material reytinqi (⭐) + Lider lövhəsi
   ============================================================ */

/* ── Hər PDF kartındakı reytinq widget-i ────────────────── */
.pdf-rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.hidden { display: none !important; }

/* Baxış rejimi — sabit, rəngli ortalama */
.rating-view {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-view-stars span {
  font-size: 1rem;
  color: var(--border);
}

.rating-view-stars span.filled {
  color: #f59e0b;
}

.rating-view-count {
  font-size: 0.72rem;
  color: var(--muted);
}

/* Reytinq ver düyməsi — sağda */
.rating-toggle-btn {
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent2);
  cursor: pointer;
  transition: all 0.2s;
}

.rating-toggle-btn:hover {
  border-color: var(--accent2);
  background: var(--glow);
}

.rating-toggle-btn:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

/* Reytinq vermə rejimi — boş ulduzlar */
.rating-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.pdf-stars {
  display: inline-flex;
  gap: 2px;
}

.pdf-star {
  background: none;
  border: none;
  padding: 2px;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--border);
  cursor: pointer;
  transition: color 0.15s, transform 0.1s;
}

.pdf-star:hover {
  transform: scale(1.15);
}

.pdf-star.filled {
  color: #f59e0b;
}

.pdf-star:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.rating-back-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.rating-back-btn:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.1);
}

/* ── Lider lövhəsi — chatın yuxarısında ─────────────────── */
.material-leaderboard {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}

.material-leaderboard:empty {
  display: none;
  margin: 0;
}

.leaderboard-loading {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 6px 0;
}

.leaderboard-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 160px;
  max-width: 220px;
}

.leaderboard-rank {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.leaderboard-name {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-stars {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: #f59e0b;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .leaderboard-item {
    min-width: 140px;
  }
}
