/* ============================================================
   ranking.css — Border Animasi Ranking & Badge Predikat
   ============================================================ */

/* ─── Shared: wrapper untuk border gradient ──────────────── */
.rank-1, .rank-2, .rank-3,
.rank-worst-1, .rank-worst-2, .rank-worst-3 {
  position: relative;
  border-radius: 50%;
  display: inline-block;
}

/* ─── RANK 1 — Bintang Emas (shimmer emas) ───────────────── */
.rank-1::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FFF8A0, #FFB800, #FFA500, #FFD700);
  background-size: 300% 300%;
  animation: shimmerGold 2s linear infinite;
  z-index: -1;
}

/* ─── RANK 2 — Bintang Perak (shimmer perak) ─────────────── */
.rank-2::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C0C0C0, #F0F0F0, #A8A8A8, #D8D8D8, #C0C0C0);
  background-size: 300% 300%;
  animation: shimmerGold 2.5s linear infinite;
  z-index: -1;
}

/* ─── RANK 3 — Bintang Perunggu (shimmer perunggu) ───────── */
.rank-3::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #CD7F32, #E8B97A, #A05C1C, #D4956A, #CD7F32);
  background-size: 300% 300%;
  animation: shimmerGold 3s linear infinite;
  z-index: -1;
}

/* ─── RANK WORST 1 — Perlu Pembinaan (merah berkedip) ────── */
.rank-worst-1 {
  border: 4px dashed #E53E3E !important;
  animation: pulseRed 1.2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(229,62,62,0.4);
}

/* ─── RANK WORST 2 — Butuh Perhatian (oranye putus-putus) ── */
.rank-worst-2 {
  border: 4px dashed #EA580C !important;
  animation: orangePulse 1.8s ease-in-out infinite;
}

/* ─── RANK WORST 3 — Tingkatkan Kinerja (kuning titik) ───── */
.rank-worst-3 {
  border: 4px dotted #D97706 !important;
  animation: yellowPulse 2s ease-in-out infinite;
}

/* ─── Keyframes ──────────────────────────────────────────── */
@keyframes shimmerGold {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,62,62,0.4); }
  50%       { box-shadow: 0 0 10px 5px rgba(229,62,62,0.2); }
}

@keyframes orangePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234,88,12,0.3); }
  50%       { box-shadow: 0 0 8px 3px rgba(234,88,12,0.15); }
}

@keyframes yellowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,6,0.3); }
  50%       { box-shadow: 0 0 6px 2px rgba(217,119,6,0.15); }
}

/* ─── Badge Predikat ────────────────────────────────────── */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  margin-top: 4px;
}

.rank-badge--gold    { background: #FFF8DC; color: #B7791F; border: 1px solid #D69E2E; }
.rank-badge--silver  { background: #F0F0F0; color: #4A5568; border: 1px solid #A0AEC0; }
.rank-badge--bronze  { background: #FEF3E2; color: #7B341E; border: 1px solid #C05621; }
.rank-badge--danger  { background: #FFF5F5; color: #C53030; border: 1px solid #FC8181; }
.rank-badge--warning { background: #FFFAF0; color: #C05621; border: 1px solid #F6AD55; }
.rank-badge--caution { background: #FFFFF0; color: #744210; border: 1px solid #ECC94B; }

/* ─── Foto profil wrapper untuk ranking ─────────────────── */
.rank-foto-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rank-foto-wrap img {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── Inner div yang ada di dalam wrapper rank-1/2/3 ────── */
.rank-foto-inner {
  border-radius: 50%;
  overflow: hidden;
  background: #F1F5F9;
}
