/* ==========================================================================
   RANKING-AGENT.CSS — upgrade interaktif untuk halaman publik "Agent"
   (ranking-agent.php). Class diberi prefix "ra-" supaya tidak bentrok
   dengan style.css / home-premium.css. Loaded HANYA di halaman ini lewat
   $extraCss di ranking-agent.php — tidak memengaruhi halaman lain.
   ========================================================================== */

/* ======================= GROW WITH S-PROPOLIS — Dynamic Card Layout ======================= */
.ra-grow-section{ position:relative; }
/* Decorative gold lines */
.ra-grow-deco-lines{
  position:absolute; inset:0; pointer-events:none; z-index:1; opacity:.35;
  background:
    repeating-linear-gradient(115deg, transparent 0px, transparent 80px, rgba(200,155,74,.08) 80px, rgba(200,155,74,.08) 81px, transparent 81px, transparent 160px),
    repeating-linear-gradient(65deg, transparent 0px, transparent 120px, rgba(200,155,74,.05) 120px, rgba(200,155,74,.05) 121px);
}
/* Dekorasi daun emas di pojok — wajib absolute, kalau tidak ikut alur normal & bikin section jadi tinggi banget kosong */
.ra-grow-leaf{ position:absolute; pointer-events:none; z-index:1; display:block; height:auto; }
.ra-grow-container{ position:relative; z-index:2; }
.ra-grow-main-grid{
  display:grid; grid-template-columns:5fr 7fr; gap:36px; align-items:center;
  margin-bottom:40px;
}
/* KIRI: Teks & CTA */
.ra-grow-left{ text-align:left; }
.ra-grow-kicker{
  font-size:11px; letter-spacing:.32em; text-transform:uppercase;
  color:var(--gold); font-weight:800; margin-bottom:16px; display:block;
}
.ra-grow-title{
  font-family:'Cormorant Garamond',serif; font-weight:600;
  font-size:clamp(32px,4.2vw,52px); line-height:1.1; margin:0 0 18px;
  color:#f3efe4;
}
.ra-grow-title em{ font-style:italic; color:var(--gold); }
.ra-grow-desc{
  color:#c9d4cc; font-size:14.5px; line-height:1.8; margin:0 0 28px; max-width:440px;
}
.ra-grow-cta{
  display:inline-flex; align-items:center; gap:10px;
  padding:14px 28px; border-radius:999px;
  background:linear-gradient(120deg,#f0d29e 0%,#e0ab52 40%,var(--gold) 70%,#b8893a 100%);
  background-size:180% 180%; color:#1a2e25; font-size:13px; font-weight:800;
  letter-spacing:.03em; text-decoration:none; font-family:'Plus Jakarta Sans',sans-serif;
  box-shadow:0 12px 30px rgba(200,155,74,.35), 0 0 0 1px rgba(255,255,255,.15) inset;
  transition:transform .35s ease, box-shadow .35s ease, filter .35s ease;
  margin-bottom:18px;
}
.ra-grow-cta:hover{
  transform:translateY(-3px) scale(1.02); filter:brightness(1.08);
  box-shadow:0 20px 44px rgba(200,155,74,.5), 0 0 0 1px rgba(255,255,255,.22) inset;
}
.ra-grow-left .ra-live-badge{ margin:0; }

/* KANAN: Kartu fitur grid 2x3 */
.ra-grow-right{
  display:grid; grid-template-columns:repeat(2,1fr); gap:14px;
}
.ra-grow-feature-card{
  background:linear-gradient(155deg, rgba(31,95,33,.55) 0%, rgba(14,43,15,.45) 100%);
  border:1px solid rgba(200,155,74,.18); border-radius:18px;
  padding:18px 18px; display:flex; gap:14px; align-items:flex-start;
  box-shadow:0 8px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.06);
  transition:transform .4s cubic-bezier(.16,.8,.28,1), box-shadow .4s ease, border-color .3s ease;
  position:relative; overflow:hidden;
}
.ra-grow-feature-card::before{
  content:''; position:absolute; inset:0; border-radius:18px; pointer-events:none;
  background:linear-gradient(135deg, var(--accent), transparent 130%); opacity:0; transition:opacity .4s ease;
}
.ra-grow-feature-card:hover{
  transform:perspective(800px) rotateX(3deg) rotateY(-4deg) translateY(-5px);
  box-shadow:0 18px 40px rgba(0,0,0,.28), 0 0 0 1px var(--accent);
  border-color:var(--accent);
}
.ra-grow-feature-card:hover::before{ opacity:.08; }
.ra-grow-feature-icon{
  width:44px; height:44px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg, rgba(200,155,74,.35), rgba(200,155,74,.12));
  color:var(--gold); display:flex; align-items:center; justify-content:center;
  box-shadow:inset 0 0 0 1px rgba(200,155,74,.45); position:relative; z-index:1;
}
.ra-grow-feature-icon svg{ width:20px; height:20px; }
.ra-grow-feature-body{ position:relative; z-index:1; min-width:0; }
.ra-grow-feature-title{
  font-family:'Plus Jakarta Sans',sans-serif; font-weight:700; font-size:13.5px;
  color:#f3efe4; margin:0 0 4px; line-height:1.3;
}
.ra-grow-feature-desc{
  font-size:11.5px; color:#b8c7bd; margin:0; line-height:1.5;
}

/* Statistik — gradasi emas membentang lebar */
.ra-grow-stats{
  display:grid; grid-template-columns:repeat(3,1fr); gap:16px;
}
.ra-grow-stat-card{
  background:linear-gradient(155deg, #e6c88a 0%, #d4a85c 50%, #b8893a 100%);
  border-radius:18px; padding:22px 20px; text-align:center;
  box-shadow:0 14px 36px rgba(184,137,58,.35), inset 0 1px 0 rgba(255,255,255,.35);
  position:relative; overflow:hidden;
}
.ra-grow-stat-card::before{
  content:''; position:absolute; top:-40%; left:-10%; width:50%; aspect-ratio:1; border-radius:50%;
  background:radial-gradient(circle, rgba(255,255,255,.35), transparent 70%);
  pointer-events:none;
}
.ra-grow-stat-num{
  font-family:'Cormorant Garamond',serif; font-weight:700;
  font-size:clamp(28px,3.2vw,40px); color:var(--herbal-deep); line-height:1;
  position:relative; z-index:1; margin-bottom:6px;
  font-variant-numeric:tabular-nums;
}
.ra-grow-stat-label{
  font-size:11.5px; font-weight:700; color:rgba(26,46,37,.75);
  letter-spacing:.04em; text-transform:uppercase; position:relative; z-index:1;
}

/* Responsive untuk Grow section */
@media(max-width:900px){
  .ra-grow-main-grid{ grid-template-columns:1fr; gap:28px; }
  .ra-grow-left{ text-align:center; }
  .ra-grow-desc{ margin-left:auto; margin-right:auto; }
  .ra-grow-right{ grid-template-columns:repeat(2,1fr); }
  .ra-grow-stats{ grid-template-columns:repeat(3,1fr); gap:12px; }
  .ra-grow-stat-card{ padding:18px 14px; }
}
@media(max-width:600px){
  .ra-grow-right{ grid-template-columns:1fr; }
  .ra-grow-stats{ grid-template-columns:1fr; }
  .ra-grow-section{ padding:60px 18px 44px !important; }
  .ra-grow-feature-card{ padding:16px; }
}
@media(prefers-reduced-motion: reduce){
  .ra-grow-feature-card{ transition:none; }
  .ra-grow-cta{ transition:none; }
}

/* ---------- live badge (diperbarui otomatis) ---------- */
.ra-live-badge{ display:inline-flex; align-items:center; gap:8px; margin:14px auto 0; padding:7px 16px; border-radius:999px; background:rgba(244,240,230,.06); border:1px solid rgba(200,155,74,.28); font-size:11.5px; color:#c9d4cc; letter-spacing:.01em; }
.ra-live-dot{ width:7px; height:7px; border-radius:50%; background:#6fcf97; box-shadow:0 0 0 0 rgba(111,207,151,.6); flex-shrink:0; animation:raLivePulse 2s ease-out infinite; }
@keyframes raLivePulse{ 0%{ box-shadow:0 0 0 0 rgba(111,207,151,.55); } 70%{ box-shadow:0 0 0 8px rgba(111,207,151,0); } 100%{ box-shadow:0 0 0 0 rgba(111,207,151,0); } }

/* ---------- podium panel ---------- */
.ra-podium-panel{ position:relative; overflow:hidden; background:linear-gradient(160deg,var(--herbal),var(--herbal-deep)); border-radius:26px; padding:38px 20px 0; margin:0 0 40px; box-shadow:0 30px 70px rgba(20,43,32,.28); }
.ra-podium-panel::before{ content:''; position:absolute; width:60%; aspect-ratio:1; border-radius:50%; left:50%; top:-55%; transform:translateX(-50%); background:radial-gradient(circle, rgba(200,155,74,.18) 0%, rgba(200,155,74,0) 70%); pointer-events:none; }
.ra-podium-head{ position:relative; z-index:2; text-align:center; margin-bottom:26px; }
.ra-podium-kicker{ font-size:10.5px; letter-spacing:.22em; text-transform:uppercase; color:var(--gold); font-weight:700; margin-bottom:8px; }
.ra-podium-title{ font-family:'Cormorant Garamond',serif; font-weight:700; font-size:clamp(20px,2.6vw,26px); color:#f3efe4; margin:0; }

.ra-podium{ display:flex; align-items:flex-end; justify-content:center; gap:14px; flex-wrap:wrap; position:relative; z-index:2; transition:opacity .2s ease; }
.ra-podium.is-loading{ opacity:.4; }
.ra-podium-item{ width:148px; text-align:center; color:#e8efe9; position:relative; padding-bottom:0; transition:transform .35s cubic-bezier(.16,.8,.28,1); }
.ra-podium-item.is-first{ width:172px; }
.ra-podium-item.is-empty .ra-podium-avatar{ border-style:dashed; color:#9db3a4; }
.ra-podium-item.is-empty .ra-podium-name{ color:#9db3a4; font-weight:600; }
.ra-podium-item.is-empty .ra-podium-total{ color:#6b8378; }

.ra-medal{ width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 10px; font-weight:800; font-size:14px; position:relative; }
.ra-medal.gold{ background:linear-gradient(135deg,#f0d29e,#b8945a); color:#3a2e12; box-shadow:0 8px 20px rgba(184,148,90,.4); }
.ra-medal.silver{ background:linear-gradient(135deg,#e4e9e6,#9aa7a0); color:#33403a; box-shadow:0 8px 18px rgba(154,167,160,.3); }
.ra-medal.bronze{ background:linear-gradient(135deg,#d9ac86,#a9744f); color:#fff; box-shadow:0 8px 18px rgba(169,116,79,.3); }
.ra-crown{ position:absolute; top:-19px; left:50%; transform:translateX(-50%); color:var(--gold); filter:drop-shadow(0 2px 4px rgba(0,0,0,.35)); }

.ra-podium-avatar{ width:60px; height:60px; border-radius:50%; overflow:hidden; margin:0 auto 10px; background:rgba(255,255,255,.08); border:3px solid rgba(255,255,255,.18); display:flex; align-items:center; justify-content:center; font-weight:700; color:#fff; font-size:17px; }
.ra-podium-avatar img{ width:100%; height:100%; object-fit:cover; }
.ra-podium-item.is-first .ra-podium-avatar{ width:80px; height:80px; font-size:21px; border-color:var(--gold); box-shadow:0 0 0 5px rgba(184,148,90,.18), 0 14px 30px rgba(184,148,90,.32); animation:raAvatarGlow 3.2s ease-in-out infinite; }
@keyframes raAvatarGlow{ 0%,100%{ box-shadow:0 0 0 5px rgba(184,148,90,.16), 0 14px 28px rgba(184,148,90,.28); } 50%{ box-shadow:0 0 0 8px rgba(184,148,90,.26), 0 18px 38px rgba(184,148,90,.46); } }

.ra-podium-name{ font-weight:700; font-size:13.5px; line-height:1.3; }
.ra-podium-item.is-first .ra-podium-name{ font-size:15.5px; }
.ra-podium-city{ font-size:11px; color:#9db3a4; margin:3px 0 8px; }
.ra-podium-total{ font-family:'Cormorant Garamond',serif; font-weight:700; font-size:18px; color:var(--gold); font-variant-numeric:tabular-nums; }
.ra-podium-item.is-first .ra-podium-total{ font-size:22px; }
.ra-podium-item.rank-2 .ra-podium-total{ color:#cfd6d1; }
.ra-podium-item.rank-3 .ra-podium-total{ color:#d3a582; }
.ra-podium-meta{ font-size:10px; color:#8fa79b; margin-top:4px; letter-spacing:.02em; }

.ra-podium-progress{ height:4px; border-radius:99px; background:rgba(244,240,230,.1); margin:8px auto 0; max-width:110px; overflow:hidden; }
.ra-podium-progress-bar{ height:100%; border-radius:99px; background:linear-gradient(90deg,var(--green),var(--gold)); width:0%; transition:width 1s cubic-bezier(.16,.8,.28,1); }

.ra-podium-bar{ margin-top:14px; height:54px; border-radius:14px 14px 0 0; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); border-bottom:none; display:flex; align-items:center; justify-content:center; font-family:'Cormorant Garamond',serif; font-weight:700; font-size:20px; color:rgba(244,240,230,.32); position:relative; overflow:hidden; }
.ra-podium-bar::after{ content:''; position:absolute; inset:0; background:linear-gradient(100deg,transparent,rgba(255,255,255,.08),transparent); transform:translateX(-100%); }
.ra-podium-item:hover .ra-podium-bar::after{ animation:raBarSheen 1.1s ease; }
@keyframes raBarSheen{ to{ transform:translateX(100%); } }
.ra-podium-item.is-first .ra-podium-bar{ height:80px; background:rgba(184,148,90,.14); border-color:rgba(184,148,90,.4); color:var(--gold); font-size:24px; }
.ra-podium-item.rank-2 .ra-podium-bar{ height:64px; }
.ra-podium-item.is-empty .ra-podium-bar{ color:rgba(244,240,230,.15); }
.ra-podium-item:hover{ transform:translateY(-3px); }

.ra-podium-sparkle{ position:absolute; width:5px; height:5px; border-radius:50%; background:var(--gold); animation:raTwinkle 2.5s ease-in-out infinite; box-shadow:0 0 8px rgba(184,148,90,.85); pointer-events:none; }
@keyframes raTwinkle{ 0%,100%{ opacity:.2; transform:scale(.6); } 50%{ opacity:1; transform:scale(1.3); } }

/* ---------- toolbar (tabs, custom period, search, find-me, view toggle) ---------- */
.ra-toolbar{ display:flex; flex-direction:column; gap:14px; align-items:center; margin-bottom:26px; }
.ra-tabs{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.ra-custom-form{ display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
/* Tab periode + form bulan/tahun sejajar dalam 1 baris (otomatis turun ke bawah di layar sempit) */
.ra-period-row{ display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:12px 16px; }
.ra-controls-row{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; align-items:center; width:100%; max-width:760px; }

.ra-input-group{ position:relative; flex:1; min-width:190px; max-width:280px; }
.ra-input-group input{ width:100%; padding:10px 14px 10px 38px; border:1px solid var(--border); border-radius:999px; font-size:13px; font-family:'Karla',sans-serif; background:#fff; outline:none; transition:border-color .2s, box-shadow .2s; color:var(--ink); }
.ra-input-group input:focus{ border-color:var(--green); box-shadow:0 0 0 3px rgba(61,174,71,.12); }
.ra-input-group svg{ position:absolute; left:13px; top:50%; transform:translateY(-50%); color:#9aa7a0; pointer-events:none; }
.ra-input-group.ra-has-btn input{ padding-right:64px; }
.ra-find-btn{ position:absolute; right:4px; top:4px; bottom:4px; padding:0 14px; border-radius:999px; border:none; background:var(--herbal); color:#f3efe4; font-size:11px; font-weight:700; cursor:pointer; font-family:'Karla',sans-serif; transition:background .2s; }
.ra-find-btn:hover{ background:var(--herbal-deep); }

/* Toggle list/grid: di bawah card Juara, di tengah, di atas daftar ranking */
.ra-list-tools{ display:flex; justify-content:center; margin:0 0 14px; }
.ra-view-toggle{ display:flex; gap:3px; background:#fff; border:1px solid var(--border); border-radius:999px; padding:4px; flex-shrink:0; }
.ra-view-btn{ width:32px; height:28px; border:none; background:transparent; border-radius:999px; display:flex; align-items:center; justify-content:center; cursor:pointer; color:#8a978e; transition:all .2s; }
.ra-view-btn.active{ background:var(--herbal); color:#fff; }
.ra-view-btn:hover:not(.active){ color:var(--herbal); }

.ra-find-msg{ display:none; font-size:12.5px; font-weight:600; padding:9px 16px; border-radius:10px; text-align:center; max-width:520px; margin:-4px auto 4px; }
.ra-find-msg.ra-find-ok{ display:block; background:rgba(61,174,71,.12); color:#1f5f21; }
.ra-find-msg.ra-find-fail{ display:block; background:rgba(220,74,56,.1); color:#b04030; }

/* ---------- results: list + grid ---------- */
.ra-results{ position:relative; min-height:80px; }
.ra-list{ display:flex; flex-direction:column; gap:9px; }
.ra-row{ opacity:0; animation:raRowIn .5s ease forwards; }
@keyframes raRowIn{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:translateY(0); } }
.ra-you-badge{ background:var(--gold); color:#1a2e25; font-size:9px; font-weight:800; letter-spacing:.03em; text-transform:uppercase; padding:2px 8px; border-radius:999px; margin-left:7px; white-space:nowrap; }
.ra-highlight{ animation:raPulseRing 1.6s ease 2; border-color:var(--gold) !important; }
@keyframes raPulseRing{ 0%,100%{ box-shadow:0 0 0 4px rgba(184,148,90,.22); } 50%{ box-shadow:0 0 0 9px rgba(184,148,90,.06); } }

.ra-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:14px; }
.ra-card{ background:#fff; border:1px solid var(--border); border-radius:16px; padding:22px 14px 18px; text-align:center; transition:transform .3s ease,box-shadow .3s ease; position:relative; }
.ra-card:hover{ transform:translateY(-4px); box-shadow:0 16px 34px rgba(31,95,33,.12); }
.ra-card-rank{ position:absolute; top:10px; left:10px; width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#fff; }
.ra-card-avatar{ width:54px; height:54px; border-radius:50%; margin:4px auto 10px; overflow:hidden; background:var(--green-soft); color:var(--green); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:15px; }
.ra-card-avatar img{ width:100%; height:100%; object-fit:cover; }
.ra-card-name{ font-weight:700; font-size:13px; line-height:1.3; }
.ra-card-city{ font-size:10.5px; color:#8a978e; margin:3px 0 10px; }
.ra-card-total{ font-weight:700; font-size:14px; color:var(--herbal); }
.ra-card-meta{ font-size:10px; color:#8a978e; margin-top:3px; }

/* ---------- skeleton loading ---------- */
.ra-skeleton-row{ display:flex; align-items:center; gap:14px; background:#fff; border:1px solid var(--border); border-radius:14px; padding:13px 16px; margin-bottom:9px; }
.ra-skel{ background:linear-gradient(90deg,#eef0ec 25%,#f7f8f6 37%,#eef0ec 63%); background-size:400% 100%; animation:raShimmer 1.4s ease infinite; border-radius:8px; }
.ra-skel-avatar{ width:38px; height:38px; border-radius:50%; flex-shrink:0; }
.ra-skel-line{ height:10px; border-radius:6px; }
@keyframes raShimmer{ 0%{ background-position:100% 50%; } 100%{ background-position:0 50%; } }

/* ---------- misc ---------- */
.ra-pagination{ display:flex; gap:8px; justify-content:center; margin-top:26px; flex-wrap:wrap; }
.ra-found-alert{ display:flex; align-items:center; gap:10px; justify-content:center; text-align:center; }

/* ---------- responsive ---------- */
@media(max-width:640px){
  .ra-podium-panel{ padding:30px 14px 0; }
  .ra-podium{ flex-direction:column; align-items:center; gap:10px; }
  .ra-podium-item, .ra-podium-item.is-first{ width:100%; max-width:260px; }
  .ra-podium-item.is-first{ order:-1; }
  .ra-podium-bar{ height:40px !important; }
  .ra-controls-row{ flex-direction:column; align-items:stretch; }
  .ra-input-group{ max-width:none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  .ra-row{ opacity:1; animation:none; }
  .ra-podium-item, .ra-podium-avatar, .ra-live-dot, .ra-skel, .ra-podium-sparkle{ animation:none !important; }
  .ra-podium-progress-bar, .ra-bar{ transition:none !important; }
}

/* ---------- WhatsApp Agent (nomor WA tampil di ranking) ---------- */
.ra-wa-chip{
  display:inline-flex; align-items:center; gap:5px;
  margin-top:6px; padding:4px 10px; border-radius:999px;
  background:#e8f5e9; color:#1f7a2d; font-size:10.5px; font-weight:700;
  letter-spacing:.01em; text-decoration:none; font-family:'Karla',sans-serif;
  border:1px solid rgba(37,160,70,.25); transition:all .2s ease;
  max-width:100%; overflow:hidden;
}
.ra-wa-chip span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:130px; }
.ra-wa-chip:hover{ background:#25a046; color:#fff; transform:translateY(-1px); box-shadow:0 6px 14px rgba(37,160,70,.3); }
.ra-wa-btn{
  display:inline-flex; align-items:center; gap:6px;
  margin-top:10px; padding:7px 16px; border-radius:999px;
  background:linear-gradient(120deg,#3ecf5e,#25a046); color:#fff;
  font-size:11.5px; font-weight:800; letter-spacing:.02em; text-decoration:none;
  font-family:'Plus Jakarta Sans',sans-serif;
  box-shadow:0 6px 16px rgba(37,160,70,.35), inset 0 1px 0 rgba(255,255,255,.25);
  transition:transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.ra-wa-btn:hover{ transform:translateY(-2px) scale(1.03); filter:brightness(1.08); box-shadow:0 10px 22px rgba(37,160,70,.45); }
.ra-podium-item .ra-wa-btn{ margin-top:12px; }
.ra-card .ra-wa-btn{ margin-top:10px; }
@media(max-width:640px){
  .ra-wa-chip span{ max-width:100px; }
}
