/* ════════════════════════════════════════════════════════════════════
   radar.css — «رادار الصفقات» (بمستوى AI Shot البصري).
   كامل العرض + رادار سونار متحرّك + محفظة/شحن + نسخ الأسعار + سجلّ قابل للنقر.
   هوية زرقاء هادئة #4D7FFF.
   ════════════════════════════════════════════════════════════════════ */
:root{ --rd-accent:#4D7FFF; --rd-accent-2:#2F5AD6; --rd-accent-dim:rgba(77,127,255,0.14); }

/* قاعدة «صندوق أيقونة القائمة» موحّدة في fb-space.css (مشترك بين العميل والأدمن) ليحصل
   الاثنان على نفس المربّع النظيف؛ مع !important على الأبعاد كي لا يدهسها dashboard-redesign.css. */

.rd-wrap{ width:100%; display:flex; flex-direction:column; gap:18px; animation:rdFade .35s ease; }
@keyframes rdFade{ from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* ════ بطاقة الرأس: رادار متحرّك + تحكّم ════ */
.rd-hero{ display:grid; grid-template-columns:300px 1fr; gap:30px; align-items:center; padding:26px 30px; }
@media (max-width:780px){ .rd-hero{ grid-template-columns:1fr; gap:20px; } .rd-scope-col{ order:-1; } }

/* ── الرادار السونار ── */
.rd-scope-col{ display:flex; flex-direction:column; align-items:center; gap:12px; }
.rd-scope{
  position:relative; width:258px; height:258px; border-radius:50%;
  background:radial-gradient(circle at 50% 50%, rgba(77,127,255,0.09), rgba(77,127,255,0.02) 58%, transparent 72%);
  box-shadow:inset 0 0 38px rgba(77,127,255,0.10), 0 0 22px -14px rgba(77,127,255,0.35);
  transition:box-shadow .4s;
}
.rd-ring{ position:absolute; border-radius:50%; border:1px solid rgba(77,127,255,0.20); }
.rd-ring.r1{ inset:0; } .rd-ring.r2{ inset:21%; } .rd-ring.r3{ inset:42%; border-color:rgba(77,127,255,0.30); }
.rd-axis{ position:absolute; background:rgba(77,127,255,0.16); }
.rd-axis.ax-h{ top:50%; left:6%; right:6%; height:1px; }
.rd-axis.ax-v{ left:50%; top:6%; bottom:6%; width:1px; }
.rd-sweep{
  position:absolute; inset:0; border-radius:50%; pointer-events:none;
  background:conic-gradient(from 0deg, rgba(77,127,255,0.38), rgba(77,127,255,0.07) 32deg, transparent 68deg);
  animation:rdSweep 4.2s linear infinite;
}
.rd-core{ position:absolute; top:50%; left:50%; width:11px; height:11px; margin:-5.5px; border-radius:50%; background:var(--rd-accent); box-shadow:0 0 16px var(--rd-accent); animation:rdCore 2.2s ease-in-out infinite; }
.rd-blip{ position:absolute; width:7px; height:7px; border-radius:50%; background:var(--rd-accent); box-shadow:0 0 10px var(--rd-accent); opacity:0; }
.rd-blip.b1{ top:29%; left:63%; } .rd-blip.b2{ top:61%; left:37%; } .rd-blip.b3{ top:41%; left:30%; } .rd-blip.b4{ top:67%; left:65%; }
@keyframes rdSweep{ to{ transform:rotate(360deg); } }
@keyframes rdCore{ 0%,100%{ transform:scale(1); opacity:1; } 50%{ transform:scale(1.55); opacity:.55; } }
@keyframes rdBlip{ 0%,100%{ opacity:0; transform:scale(.5); } 45%{ opacity:1; transform:scale(1); } }
/* حالة المسح: أسرع + توهّج + ومضات */
.rd-scope.scanning{ box-shadow:inset 0 0 46px rgba(77,127,255,0.17), 0 0 38px -8px rgba(77,127,255,0.5); }
.rd-scope.scanning .rd-sweep{ animation-duration:1.15s; }
.rd-scope.scanning .rd-blip{ animation:rdBlip 1.15s ease-in-out infinite; }
.rd-scope.scanning .rd-blip.b1{ animation-delay:.05s; } .rd-scope.scanning .rd-blip.b2{ animation-delay:.45s; }
.rd-scope.scanning .rd-blip.b3{ animation-delay:.75s; } .rd-scope.scanning .rd-blip.b4{ animation-delay:.30s; }
.rd-scope-cap{ font-size:12.5px; font-weight:700; letter-spacing:.5px; color:var(--rd-accent); text-transform:uppercase; opacity:.85; }

/* ── رأس القسم (مطابق AI Shot: تحية + عنوان + وصف يمين، المحفظة يسار) ── */
.rd-head{ padding:18px 20px; }
.rd-head-row{ display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:18px; }
.rd-head-text{ min-width:200px; flex:1; }
.rd-greeting{ font-size:14px; font-weight:600; color:var(--text-muted,#9aa3b8); }
.rd-title-big{ font-size:26px; font-weight:800; letter-spacing:-0.5px; margin-top:5px; color:var(--text-primary,#fff); }
.rd-sub-desc{ font-size:14.5px; color:var(--text-secondary,#c7cede); margin-top:7px; line-height:1.7; }

/* ── عمود التحكّم ── */
.rd-ctrl-col{ min-width:0; }
/* المحفظة — كرت صغير داخل صف الرأس على اليسار (مطابق AI Shot: رصيد + شريط + زر شحن) */
.rd-wallet{ width:236px; max-width:100%; flex:0 0 auto; padding:14px 14px 12px; border-radius:16px; background:linear-gradient(145deg,rgba(77,127,255,0.10) 0%,rgba(77,127,255,0.03) 45%,rgba(255,255,255,0.015) 100%); border:1px solid rgba(77,127,255,0.22); box-shadow:inset 0 1px 0 rgba(255,255,255,0.05),0 8px 24px -14px rgba(0,0,0,0.6); }
@media (max-width:600px){ .rd-wallet{ width:100%; } }
.rd-wallet-top{ display:flex; align-items:center; gap:11px; }
.rd-wallet-ico{ width:40px; height:40px; flex:0 0 auto; border-radius:12px; display:flex; align-items:center; justify-content:center; color:var(--rd-accent); background:radial-gradient(circle at 30% 25%,rgba(77,127,255,0.28),rgba(77,127,255,0.08) 70%); border:1px solid rgba(77,127,255,0.34); }
.rd-wallet-lbl{ font-size:10px; font-weight:700; letter-spacing:1.4px; text-transform:uppercase; color:var(--text-muted,#9aa3b8); }
.rd-bal-val{ font-weight:800; font-size:26px; line-height:1.05; color:#fff; font-variant-numeric:tabular-nums; }
.rd-wallet-unit{ font-size:11px; color:var(--text-muted,#9aa3b8); font-weight:600; margin-inline-start:4px; }
.rd-wallet-track{ height:7px; background:rgba(255,255,255,0.06); border-radius:99px; margin-top:12px; overflow:hidden; }
.rd-wallet-fill{ height:100%; width:0; border-radius:99px; background:linear-gradient(90deg,var(--rd-accent),var(--rd-accent-2)); transition:width .45s cubic-bezier(.22,1,.36,1); }
.rd-topup{ width:100%; margin-top:12px; display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:11px 14px; border:none; border-radius:12px; cursor:pointer; font-family:inherit; font-weight:800; font-size:13.5px; color:#fff; background:linear-gradient(135deg,var(--rd-accent),var(--rd-accent-2)); box-shadow:0 8px 20px -10px rgba(77,127,255,0.5); transition:transform .15s; }
.rd-topup:hover{ transform:translateY(-1px); }

/* حالة القفل لغير المشترك: كرت التوكين + زر الفحص مقفولان قبل أي ضغط */
.rd-wallet-locked{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:9px; }
.rd-wallet-lock{ width:46px; height:46px; border-radius:13px; display:flex; align-items:center; justify-content:center; color:var(--text-muted,#9aa3b8); background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.10); }
.rd-wallet-lock-tx{ font-size:13px; font-weight:700; color:var(--text-secondary,#c7cede); }
.rd-scan-btn.rd-locked{ background:rgba(255,255,255,0.05)!important; color:var(--text-muted,#9aa3b8)!important; box-shadow:none!important; cursor:not-allowed!important; opacity:1!important; }
.rd-scan-btn.rd-locked .rd-scan-lbl{ display:inline-flex; align-items:center; gap:8px; }
.rd-scan-btn.rd-locked:hover{ transform:none!important; box-shadow:none!important; }

.rd-how{ color:var(--text-secondary,#c7cede); font-size:14px; line-height:1.85; margin:0 0 16px; }
.rd-how b{ color:var(--text-primary,#fff); font-weight:700; }

.rd-scan-btn{
  width:100%; border:none; cursor:pointer; font-family:inherit;
  display:flex; flex-direction:column; align-items:center; gap:3px; padding:16px; border-radius:14px;
  background:linear-gradient(135deg,#4D7FFF,#2F5AD6); color:#ffffff;
  box-shadow:0 8px 20px -10px rgba(77,127,255,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
  transition:transform .12s, box-shadow .12s, opacity .12s;
}
.rd-scan-btn:hover{ transform:translateY(-1px); box-shadow:0 12px 26px -10px rgba(77,127,255,0.55); }
.rd-scan-btn:active{ transform:translateY(0); }
.rd-scan-btn:disabled{ opacity:.75; cursor:progress; }
.rd-scan-lbl{ font-size:16px; font-weight:800; display:inline-flex; align-items:center; gap:9px; }
.rd-scan-cost{ font-size:12px; font-weight:600; opacity:.8; }
.rd-spin{ width:16px; height:16px; border:2.4px solid rgba(255,255,255,0.3); border-top-color:#ffffff; border-radius:50%; animation:rdSpin .7s linear infinite; display:inline-block; }
@keyframes rdSpin{ to{ transform:rotate(360deg); } }

.rd-disc{ color:var(--text-muted,#9aa3b8); font-size:12px; line-height:1.7; margin:14px 0 0; }
.rd-disc-sm{ margin-top:12px; }

/* ════ «كيف يعمل الرادار؟» — مطابق لخطوات AI Shot (شريط امتلاء + دورة) بالأزرق ════ */
.rdi-card{ padding:18px 20px; }
.rdi-head{ margin-bottom:14px; }
.rdi-title{ font-size:16px; font-weight:800; color:var(--text-primary,#fff); }
.rdi-steps{ display:flex; align-items:stretch; gap:10px; }
.rdi-step{ flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; padding:13px 14px 10px; border-radius:13px; background:rgba(255,255,255,0.025); border:1px solid rgba(255,255,255,0.06); transition:border-color .35s, background .35s, transform .35s, box-shadow .35s; position:relative; }
.rdi-step-ico{ width:40px; height:40px; border-radius:11px; display:flex; align-items:center; justify-content:center; color:var(--text-muted,#8A93AD); background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.07); transition:all .35s; }
.rdi-step-ico svg{ width:21px; height:21px; }
.rdi-step-t{ font-weight:800; font-size:13.5px; color:var(--text-secondary,#cbd5e1); transition:color .35s; }
.rdi-step-d{ font-size:12px; line-height:1.65; color:var(--text-muted,#8A93AD); }
.rdi-step-bar{ height:3px; border-radius:99px; background:rgba(255,255,255,0.05); overflow:hidden; margin-top:auto; }
.rdi-step-bar i{ display:block; height:100%; width:0; border-radius:99px; background:linear-gradient(90deg,var(--rd-accent),var(--rd-accent-2)); }
.rdi-step.active{ border-color:rgba(77,127,255,0.45); background:rgba(77,127,255,0.05); transform:translateY(-2px); box-shadow:0 10px 26px -12px rgba(77,127,255,0.4); }
.rdi-step.active .rdi-step-ico{ color:#fff; background:rgba(77,127,255,0.14); border-color:rgba(77,127,255,0.45); box-shadow:0 0 16px -2px rgba(77,127,255,0.4); }
.rdi-step.active .rdi-step-t{ color:#fff; }
.rdi-step.active .rdi-step-bar i{ animation:rdiFill 3.2s linear forwards; }
@keyframes rdiFill{ from{ width:0; } to{ width:100%; } }
.rdi-link{ flex:0 0 26px; align-self:center; height:2px; background:rgba(255,255,255,0.08); border-radius:99px; overflow:hidden; }
.rdi-link i{ display:block; height:100%; width:0; background:linear-gradient(90deg,var(--rd-accent),var(--rd-accent-2)); transition:width .5s ease; }
.rdi-link.lit i{ width:100%; }
@media (max-width:620px){
  .rdi-steps{ flex-direction:column; gap:8px; }
  .rdi-link{ display:none; }
  .rdi-step{ flex-direction:row; align-items:center; }
  .rdi-step-ico{ flex:0 0 36px; width:36px; height:36px; }
  .rdi-step-bar{ display:none; }
}
@media (prefers-reduced-motion: reduce){ .rdi-step.active .rdi-step-bar i{ animation:none!important; width:100%; } }

/* ════ بطاقة الفرصة ════ */
.rd-opp{ position:relative; padding:22px 24px; border:1px solid rgba(77,127,255,0.30)!important; overflow:hidden; animation:rdPop .4s cubic-bezier(.22,1,.36,1); }
@keyframes rdPop{ from{opacity:0;transform:scale(.97)} to{opacity:1;transform:none} }
.rd-opp-glow{ position:absolute; top:-40%; inset-inline-end:-20%; width:280px; height:280px; border-radius:50%; background:radial-gradient(circle, var(--gc,#4D7FFF)22, transparent 70%); pointer-events:none; }
.rd-opp-top{ position:relative; display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; gap:12px; }
.rd-opp-id{ display:flex; align-items:center; gap:14px; min-width:0; }
.rd-opp-pair{ font-size:26px; font-weight:800; color:var(--text-primary,#fff); letter-spacing:.5px; direction:ltr; }

/* أيقونة الأصل — شعارات أصلية (كريبتو/أعلام) + معادن/مؤشرات SVG، مع بديل احتياطي */
.rd-asset-ico{ position:relative; width:50px; height:50px; flex:0 0 50px; border-radius:50%; display:flex; align-items:center; justify-content:center; overflow:hidden; background:var(--ic-bg,#3b82f6); color:var(--ic-fg,#fff); border:1px solid rgba(255,255,255,0.2); box-shadow:0 5px 16px -5px var(--ic-bg,#3b82f6), inset 0 2px 5px rgba(255,255,255,0.28), inset 0 -3px 7px rgba(0,0,0,0.22); }
.rd-asset-sym{ font-weight:800; font-size:20px; line-height:1; letter-spacing:.3px; direction:ltr; }
.rd-asset-ico.sm .rd-asset-sym{ font-size:12px; }
/* الشعار الحقيقي صورة دائرية كاملة (كريبتو/معدن/مؤشر) — نُخفي خلفية القرص والحدّ */
.rd-asset-ico.img{ background:transparent; border:none; box-shadow:0 4px 13px -4px rgba(0,0,0,0.55); }
.rd-asset-ico.img .rd-asset-img{ width:100%; height:100%; object-fit:contain; display:block; border-radius:50%; }
.rd-asset-ico.img .rd-asset-sym{ display:none; }
/* فوركس: علمان مستطيلان نصف/نصف داخل الدائرة (الأساس يسار، المقابل يمين) بفاصل نظيف */
.rd-asset-ico.fxflags{ background:#0d1426; }
.rd-asset-ico.fxflags .rd-asset-img{ position:absolute; top:0; width:50%; height:100%; object-fit:cover; }
.rd-asset-ico.fxflags .fx-a{ left:0; }
.rd-asset-ico.fxflags .fx-b{ right:0; }
.rd-asset-ico.fxflags::after{ content:""; position:absolute; top:0; bottom:0; left:50%; width:1.5px; transform:translateX(-50%); background:rgba(13,20,38,0.9); z-index:3; }
.rd-asset-ico.fxflags .rd-asset-sym{ display:none; }
.rd-asset-ico.fxflags.img-failed::after{ display:none; }
/* فشل تحميل الصورة → نُظهر البديل الحرفي */
.rd-asset-ico.img-failed{ background:var(--ic-bg,#1f3a6b)!important; border:1px solid rgba(255,255,255,0.2)!important; overflow:hidden; }
.rd-asset-ico.img-failed .rd-asset-img{ display:none; }
.rd-asset-ico.img-failed .rd-asset-sym{ display:flex; }
.rd-asset-ico.mini{ width:32px; height:32px; flex:0 0 32px; box-shadow:0 3px 9px -3px var(--ic-bg,#3b82f6), inset 0 1px 3px rgba(255,255,255,0.28); }
.rd-asset-ico.mini.img{ box-shadow:0 3px 9px -3px rgba(0,0,0,0.5); }
.rd-asset-ico.mini .rd-asset-sym{ font-size:13px; }
.rd-asset-ico.mini.sm .rd-asset-sym{ font-size:8px; }
.rd-opp-tag{ color:var(--rd-accent); font-size:11.5px; font-weight:700; margin-top:2px; }
.rd-opp-dir{ font-size:14.5px; font-weight:800; padding:6px 18px; border-radius:999px; }
.rd-opp-act{ display:flex; align-items:center; gap:10px; }
.rd-close{ width:30px; height:30px; flex:0 0 30px; border-radius:50%; border:1px solid rgba(255,255,255,0.14); background:rgba(255,255,255,0.05); color:var(--text-muted,#9aa3b8); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s, color .15s, transform .12s; }
.rd-close:hover{ background:rgba(255,255,255,0.12); color:#fff; transform:scale(1.05); }

.rd-levels{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; margin-bottom:18px; }
.rd-lv{ background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.07); border-radius:13px; padding:13px 10px; text-align:center; }
.rd-lv-h{ display:block; color:var(--text-muted,#9aa3b8); font-size:11.5px; margin-bottom:6px; }
.rd-lv-v{ display:inline-flex; align-items:center; gap:7px; justify-content:center; }
.rd-lv-v b{ color:var(--text-primary,#fff); font-size:16px; font-weight:800; direction:ltr; }
.rd-lv-sl .rd-lv-v b{ color:#fca5a5; }
.rd-lv-tp .rd-lv-v b{ color:#86efac; }
/* زر نسخ مكتفٍ ذاتياً (معالج خاص بالرادار) — لمسة سماوية */
.rd-copy{ display:inline-flex; align-items:center; justify-content:center; min-width:24px; height:24px; padding:0 5px; border-radius:7px; cursor:pointer; font-family:inherit; color:var(--text-muted,#9aa3b8); border:1px solid rgba(255,255,255,0.12); background:transparent; transition:color .15s, border-color .15s, background .15s; }
.rd-copy:hover{ color:var(--rd-accent); border-color:rgba(77,127,255,0.5); background:rgba(77,127,255,0.08); }
.rd-copy.rd-copied{ color:var(--rd-accent); border-color:rgba(77,127,255,0.6); }

.rd-meter-row{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.rd-meter-lbl{ color:var(--text-secondary,#c7cede); font-size:13px; flex:0 0 auto; }
.rd-meter{ flex:1 1 auto; height:9px; border-radius:99px; background:rgba(255,255,255,0.08); overflow:hidden; }
.rd-meter i{ display:block; height:100%; border-radius:99px; transition:width .6s cubic-bezier(.22,1,.36,1); }
.rd-meter-val{ font-size:13.5px; font-weight:800; flex:0 0 auto; }

.rd-rr{ color:var(--text-secondary,#c7cede); font-size:13px; margin-bottom:6px; }
.rd-rr b{ color:var(--text-primary,#fff); }

.rd-reason{ margin-top:14px; padding:14px 16px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.06); border-radius:12px; }
.rd-reason-h{ color:var(--rd-accent); font-size:13px; font-weight:700; margin-bottom:6px; }
.rd-reason p{ color:var(--text-secondary,#c7cede); font-size:13.5px; line-height:1.85; margin:0; }

/* ════ حالات (لا فرص/قفل/شحن/فاصل/خطأ) ════ */
.rd-state{ padding:34px 24px; text-align:center; }
.rd-state-ic{ font-size:42px; line-height:1; margin-bottom:12px; }
.rd-state-title{ font-size:18px; font-weight:800; color:var(--text-primary,#fff); margin-bottom:8px; }
.rd-state-body{ color:var(--text-secondary,#c7cede); font-size:14px; line-height:1.8; margin:0 auto; max-width:440px; }
.rd-cta{ margin-top:18px; border:none; cursor:pointer; font-family:inherit; padding:12px 28px; border-radius:11px; font-size:14px; font-weight:800; background:linear-gradient(135deg,#4D7FFF,#2F5AD6); color:#ffffff; box-shadow:0 8px 20px -6px rgba(77,127,255,0.55); transition:transform .12s; }
.rd-cta:hover{ transform:translateY(-1px); }
.rd-cta-ghost{ background:transparent; color:var(--rd-accent); box-shadow:none; border:1px solid rgba(77,127,255,0.45); }
.rd-cd{ margin-top:16px; font-size:36px; font-weight:800; color:var(--rd-accent); direction:ltr; letter-spacing:2px; font-variant-numeric:tabular-nums; }

/* ════ السجلّ — قابل للنقر ════ */
.rd-hist{ padding:18px 22px; }
.rd-hist-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.rd-hist-head>span:first-child{ font-size:15px; font-weight:800; color:var(--text-primary,#fff); }
.rd-hist-hint{ font-size:11.5px; color:var(--rd-accent); opacity:.8; }
.rd-hist-empty{ color:var(--text-muted,#9aa3b8); font-size:13.5px; text-align:center; padding:14px 0; }
.rd-hist-body{ display:flex; flex-direction:column; gap:8px; }
.rd-hist-row{ display:flex; align-items:center; gap:10px; padding:11px 13px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.05); border-radius:11px; flex-wrap:wrap; cursor:pointer; transition:background .15s, border-color .15s, transform .12s; }
.rd-hist-row:hover{ background:rgba(77,127,255,0.07); border-color:rgba(77,127,255,0.3); transform:translateY(-1px); }
.rd-hist-dir{ font-size:11.5px; font-weight:800; padding:3px 11px; border-radius:999px; flex:0 0 auto; }
.rd-hist-pair{ font-size:14px; font-weight:800; color:var(--text-primary,#fff); flex:0 0 auto; direction:ltr; }
.rd-hist-lv{ font-size:12px; color:var(--text-muted,#9aa3b8); flex:0 0 auto; }
.rd-hist-st{ font-size:13px; font-weight:800; flex:0 0 auto; }
.rd-hist-t{ font-size:11.5px; color:var(--text-muted,#9aa3b8); margin-inline-start:auto; flex:0 0 auto; }
.rd-hist-chev{ color:var(--text-muted,#9aa3b8); flex:0 0 auto; }
.rd-hist-row:hover .rd-hist-chev{ color:var(--rd-accent); }

@media (max-width:600px){
  .rd-hero{ padding:20px 18px; }
  .rd-scope{ width:220px; height:220px; }
  .rd-opp-pair{ font-size:22px; }
  .rd-levels{ gap:8px; }
  .rd-lv-v b{ font-size:14px; }
  .rd-hist-t{ width:100%; margin-inline-start:0; order:9; }
  .rd-hist-chev{ display:none; }
}
