/* Ranking — dashboard chrome + fancy podium / list */

body.influencer-profile[data-inf-sb-page="ranking"] {
  background: #eef1f6;
}

body.influencer-profile[data-inf-sb-page="ranking"] #content {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 72px 20px 20px !important;
  box-sizing: border-box !important;
  background: #eef1f6 !important;
}

body.influencer-profile[data-inf-sb-page="ranking"].has-role-mobile-bottom-nav #content {
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
}

.inf-rank-page {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Type tabs — same underline as dashboard / rewards */
.inf-rank-type-capsules.inf-jr-capsules {
  flex-shrink: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  margin: 0 0 8px;
  padding: 4px 2px 0;
  background: transparent;
}

body.influencer-profile[data-inf-sb-page="ranking"] .inf-rank-type-capsules .inf-jr-capsule {
  position: relative;
  border: none !important;
  background: transparent !important;
  color: #94a3b8 !important;
  border-radius: 0 !important;
  padding: 6px 2px 10px !important;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: none !important;
  outline: none !important;
}

body.influencer-profile[data-inf-sb-page="ranking"] .inf-rank-type-capsules .inf-jr-capsule:hover,
body.influencer-profile[data-inf-sb-page="ranking"] .inf-rank-type-capsules .inf-jr-capsule:focus {
  color: #4f46e5 !important;
}

body.influencer-profile[data-inf-sb-page="ranking"] .inf-rank-type-capsules .inf-jr-capsule.is-active {
  color: #4f46e5 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.influencer-profile[data-inf-sb-page="ranking"] .inf-rank-type-capsules .inf-jr-capsule.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: #4f46e5;
}

.inf-rank-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* —— Fancy podium —— */
.inf-rank-podium-zone {
  flex-shrink: 0;
  margin: 4px 0 12px;
  padding: 8px 8px 4px;
}

.inf-lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
  padding-top: 18px;
}

.inf-lb-podium-slot {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.inf-lb-podium-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 10px;
  width: 100%;
}

.inf-lb-podium-avatar-wrap {
  position: relative;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.inf-lb-podium-crown-svg {
  width: 34px;
  height: 20px;
  margin-bottom: 2px;
  filter: drop-shadow(0 3px 6px rgba(180, 83, 9, 0.35));
  z-index: 2;
}

.inf-lb-podium-medal {
  position: relative;
  border-radius: 50%;
  padding: 4px;
  background: #e2e8f0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.inf-lb-podium-slot--1 .inf-lb-podium-medal {
  padding: 5px;
  background: conic-gradient(from 210deg, #fff7c2, #f59e0b, #b45309, #fde68a, #f59e0b, #fff7c2);
  box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.16), 0 14px 28px rgba(180, 83, 9, 0.22);
}

.inf-lb-podium-slot--1.is-filled .inf-lb-podium-medal::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.28) 0%, rgba(251, 191, 36, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

.inf-lb-podium-slot--2 .inf-lb-podium-medal {
  background: conic-gradient(from 210deg, #f8fafc, #94a3b8, #475569, #e2e8f0, #94a3b8, #f8fafc);
}

.inf-lb-podium-slot--3 .inf-lb-podium-medal {
  background: conic-gradient(from 210deg, #ffedd5, #fb923c, #c2410c, #fdba74, #fb923c, #ffedd5);
}

.inf-lb-podium-avatar,
.inf-lb-avatar-ph.inf-lb-podium-avatar,
.inf-lb-podium-avatar--empty {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #94a3b8;
  background: #fff;
  border: 3px solid #fff;
}

.inf-lb-podium-slot--1 .inf-lb-podium-avatar,
.inf-lb-podium-slot--1 .inf-lb-avatar-ph.inf-lb-podium-avatar {
  width: 72px;
  height: 72px;
  color: #fff;
  background: linear-gradient(145deg, #6366f1, #7c3aed);
}

.inf-lb-podium-slot--2 .inf-lb-podium-avatar,
.inf-lb-podium-slot--2 .inf-lb-avatar-ph.inf-lb-podium-avatar {
  color: #fff;
  background: linear-gradient(145deg, #64748b, #475569);
}

.inf-lb-podium-slot--3 .inf-lb-podium-avatar,
.inf-lb-podium-slot--3 .inf-lb-avatar-ph.inf-lb-podium-avatar {
  color: #fff;
  background: linear-gradient(145deg, #f59e0b, #d97706);
}

.inf-lb-podium-place {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  background: #64748b;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.inf-lb-podium-slot--1 .inf-lb-podium-place {
  min-width: 22px;
  height: 22px;
  background: linear-gradient(180deg, #fbbf24, #d97706);
}

.inf-lb-podium-slot--3 .inf-lb-podium-place {
  background: linear-gradient(180deg, #fb923c, #c2410c);
}

.inf-lb-podium-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inf-lb-podium-score {
  font-size: 0.68rem;
  font-weight: 700;
  color: #6366f1;
  margin-top: 2px;
}

.inf-lb-podium-bar {
  width: 100%;
  border-radius: 14px 14px 8px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 18px rgba(15, 23, 42, 0.12);
}

.inf-lb-podium-rank {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
}

.inf-lb-podium-bar {
  position: relative;
  overflow: hidden;
}

.inf-lb-podium-bar::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0));
  pointer-events: none;
}

.inf-lb-podium-slot--1 .inf-lb-podium-bar {
  height: 78px;
  background: linear-gradient(180deg, #ffe9a3 0%, #f59e0b 48%, #b45309 100%);
}

.inf-lb-podium-slot--2 .inf-lb-podium-bar {
  height: 58px;
  background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 52%, #475569 100%);
}

.inf-lb-podium-slot--3 .inf-lb-podium-bar {
  height: 46px;
  background: linear-gradient(180deg, #fdba74 0%, #f97316 52%, #c2410c 100%);
}

/* White sheet under tabs */
.inf-jr-list-card.inf-rank-list-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
  background: #fff;
  border-radius: 24px;
  border: none;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.inf-rank-list-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inf-rank-list-inner {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 14px 12px;
}

.inf-rank-card-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.inf-rank-month-capsules.inf-jr-capsules {
  justify-content: center;
  gap: 16px;
  margin-bottom: 4px;
}

body.influencer-profile[data-inf-sb-page="ranking"] .inf-rank-month-capsules .inf-jr-capsule {
  position: relative;
  border: none !important;
  background: transparent !important;
  color: #94a3b8 !important;
  border-radius: 0 !important;
  padding: 4px 2px 8px !important;
  font-size: 0.88rem !important;
  font-weight: 800;
  box-shadow: none !important;
}

body.influencer-profile[data-inf-sb-page="ranking"] .inf-rank-month-capsules .inf-jr-capsule.is-active {
  color: #4f46e5 !important;
}

body.influencer-profile[data-inf-sb-page="ranking"] .inf-rank-month-capsules .inf-jr-capsule.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: #4f46e5;
}

.inf-rank-month-label {
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Fancy rows */
.inf-rank-rows {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.inf-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 1px solid #eef2ff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.inf-rank-row--me {
  background: linear-gradient(135deg, #eef2ff 0%, #fff 55%);
  border-color: #c7d2fe;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.12);
}

.inf-rank-row-pos {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  color: #6366f1;
  background: #eef2ff;
  flex-shrink: 0;
}

.inf-rank-row-avatar,
.inf-lb-avatar-ph.inf-rank-row-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.inf-rank-row-meta {
  flex: 1;
  min-width: 0;
}

.inf-rank-row-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inf-rank-row--me .inf-rank-row-name {
  color: #4338ca;
}

.inf-rank-row-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
}

.inf-rank-row-score {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.88rem;
  color: #4f46e5;
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
}

.inf-rank-row-empty,
.inf-rank-row-ellipsis {
  text-align: center;
  color: #94a3b8;
  font-weight: 600;
  padding: 18px 8px;
  font-size: 0.85rem;
}

.inf-rank-row-ellipsis {
  letter-spacing: 0.3em;
  padding: 6px;
  background: transparent;
  border: none;
  box-shadow: none;
}

@media (max-width: 767.98px) {
  body.influencer-profile[data-inf-sb-page="ranking"] #header-admin-wrap {
    height: 52px !important;
    background: #eef1f6 !important;
    box-shadow: none !important;
    border: none !important;
    transform: none !important;
  }
  body.influencer-profile[data-inf-sb-page="ranking"] #header-admin-wrap.nav-hidden {
    transform: none !important;
  }
  body.influencer-profile[data-inf-sb-page="ranking"] #header-admin-wrap #header-admin {
    height: 52px !important;
    padding: 0 14px !important;
    background: transparent !important;
  }
  body.influencer-profile[data-inf-sb-page="ranking"] #content,
  body.influencer-profile[data-inf-sb-page="ranking"] #content.active {
    padding: 52px 0 0 !important;
    padding-bottom: 0 !important;
    background: #eef1f6 !important;
    overflow-y: auto !important;
    height: 100dvh !important;
  }
  .inf-rank-page {
    max-width: none;
    overflow: visible;
  }
  .inf-rank-type-capsules.inf-jr-capsules {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 0;
    padding: 4px 14px 0;
    background: #eef1f6;
  }
  .inf-rank-panel {
    overflow: visible;
  }
  .inf-rank-podium-zone {
    padding: 8px 14px 2px;
  }
  .inf-jr-list-card.inf-rank-list-card {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 10px;
    border-radius: 24px 24px 0 0;
    box-shadow: none;
    min-height: calc(100dvh - 52px - 220px);
    padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  }
  .inf-lb-podium-slot--1 .inf-lb-podium-bar { height: 58px; }
  .inf-lb-podium-slot--2 .inf-lb-podium-bar { height: 44px; }
  .inf-lb-podium-slot--3 .inf-lb-podium-bar { height: 34px; }
}

@media (min-width: 768px) {
  .inf-lb-podium {
    max-width: 460px;
    gap: 14px;
  }
  .inf-lb-podium-slot--1 .inf-lb-podium-bar { height: 84px; }
  .inf-lb-podium-slot--2 .inf-lb-podium-bar { height: 62px; }
  .inf-lb-podium-slot--3 .inf-lb-podium-bar { height: 48px; }
}
