/* =========================================================
   🎨 SmartTrader Quantum UI – ORB-PRO FULL CSS v6.0
   ========================================================= */

/* ROOT VARIABLES ----------------------------------------- */

:root {
    --bg-main: radial-gradient(circle at top, #0b1020 0, #050612 35%, #020308 100%);
    --bg-card: rgba(15, 23, 42, 0.96);
    --bg-soft: rgba(15, 23, 42, 0.70);

    --text-main: #f9fafb;
    --text-muted: #9ca3af;

    --green: #22c55e;
    --red: #ef4444;
    --yellow: #fbbf24;
    --blue: #60a5fa;

    --radius-lg: 20px;
    --radius-md: 14px;

    --shadow: 0 22px 50px rgba(0,0,0,0.55);
}

/* =========================================================
   BASE + GLOBAL
   ========================================================= */

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body.st-body {
    margin: 0;
    padding: 0;
    direction: rtl;
    font-family: IRANSans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

#app.st-page {
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 18px 60px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.25);
    border-radius: 99px;
}

/* =========================================================
   PAGE SECTIONS
   ========================================================= */

.st-main {
    margin-top: 32px;
}

.st-row {
    margin: 26px 0;
}

.st-row-responsive {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 26px;
}

@media (max-width: 900px) {
    .st-row-responsive {
        grid-template-columns: 1fr;
    }
}
/* ======================================================
   Quantum Neural ORB – Hero Section (Mobile-Fixed)
   ====================================================== */

/* فولد اول – آزاد، بدون باکس */
.st-orb-banner {
    width: 100vw;
    height: 100svh;
    margin-inline: calc(50% - 50vw);
    padding: 0;

    position: relative;
    overflow: hidden;

    display: grid;
    place-items: center;

    background: radial-gradient(
        ellipse at center,
        rgba(10,14,28,0.35) 0%,
        rgba(6,8,20,0.75) 55%,
        rgba(4,6,16,0.95) 100%
    );
}

/* ORB canvas */
.st-orb-canvas {
    width: min(720px, 92vw);
    aspect-ratio: 1 / 1;
    height: auto;

    position: relative;
    z-index: 1;

    will-change: transform, filter;
    animation: orb-float 9s ease-in-out infinite;

    filter:
        drop-shadow(0 0 28px rgba(120,160,255,0.32))
        drop-shadow(0 0 64px rgba(80,110,255,0.16));
}

/* نفس کشیدن ORB */
@keyframes orb-float {
    0% {
        transform: scale(0.95);
        filter: blur(0px);
    }
    45% {
        transform: scale(1.045);
        filter: blur(0.55px);
    }
    100% {
        transform: scale(0.95);
        filter: blur(0px);
    }
}

/* متن – دست نخورده */
.orb-overlay {
    position: absolute;
    bottom: 14%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding-inline: 16px;
    z-index: 2;
    pointer-events: none;
}

/* =======================
   📱 MOBILE FIX
   ======================= */
@media (max-width: 768px) {

    /* به جای وسط‌چین، ORB کمی بالا میاد */
    .st-orb-banner {
        height: auto;
        min-height: 100vh;

        display: flex;
        align-items: flex-start;
        justify-content: center;

        padding-top: 28px;   /* 👈 فاصله‌ی منطقی از بالا */
        padding-bottom: 48px;
    }

    .st-orb-canvas {
        width: min(420px, 96vw);
    }

    /* متن کمی بالاتر بیاد ولی جای فعلی حفظ بشه */
    .orb-overlay {
        bottom: 12%;
    }

    .scroll-hint {
        display: none;
    }
}


/* -------------------- Mobile -------------------- */
@media (max-width: 768px) {
    .st-orb-banner {
        padding-block: 32px;
        height: auto;
        min-height: 100vh;
    }

    .st-orb-canvas {
        width: min(430px, 100vw);
    }

    .orb-overlay {
        bottom: 10%;
    }

    .scroll-hint {
        display: none;
    }
}


/* =========================================================
   HERO SECTION
   ========================================================= */

.st-hero {
    margin-top: 32px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 1.25fr 1.3fr;
    gap: 28px;
    position: relative;
}

/* BG flux canvas */
.st-hero-flux {
    position: absolute;
    inset: -40px 0 auto 0;
    width: 100%;
    height: 320px;
    opacity: 0.25;
    filter: blur(0.2px);
    pointer-events: none;
    z-index: -1;
}

.st-hero-left, .st-hero-right {
    position: relative;
}

/* Floating BTC */
.floating-price {
    position: absolute;
    top: -8px;
    right: 10px;
    padding: 10px 16px;
    border-radius: 16px;

    background: rgba(15,23,42,0.85);
    border: 1px solid rgba(148, 163, 255, 0.5);
    box-shadow: 0 12px 30px rgba(15,23,42,0.9);
    backdrop-filter: blur(7px);

    color: #d7fbff;
    z-index: 10;
}

.fp-label { font-size: 11px; opacity: 0.7; display: block; }
.fp-value { font-size: 18px; font-weight: 700; color: #71f3ff; }

.fx-glow {
    animation: glowPulse 2.4s infinite ease-in-out;
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 0 rgba(56,189,248,0.1); }
    50% { box-shadow: 0 0 26px rgba(56,189,248,0.55); }
    100% { box-shadow: 0 0 0 rgba(56,189,248,0.1); }
}

/* Sparkline */
.st-algo-canvas {
    width: 100%;
    height: 270px;
    border-radius: 18px;
    background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
    opacity: 0.9;
}

.st-hero-note {
    margin-top: 10px;
    font-size: 11px;
    opacity: 0.6;
}

/* Right side text */
.st-hero-title {
    font-size: 26px;
    line-height: 1.7;
    margin: 10px 0;
    font-weight: 700;
}

.st-hero-subtitle {
    font-size: 13px;
    opacity: .78;
    margin-bottom: 16px;
}

.st-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.st-badge {
    padding: 7px 12px;
    border-radius: 14px;
    font-size: 11px;
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,255,0.45);
    display: flex;
    gap: 6px;
}

.st-badge-label { opacity: 0.75; }
.st-badge-value { font-weight: 700; color: #e0f2fe; }

.st-pill {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(96,165,250,0.2);
    border: 1px solid rgba(96,165,250,0.35);
    font-size: 11px;
}

.st-pill-primary {
    box-shadow: 0 0 16px rgba(59,130,246,0.5);
}

/* Metrics grid (reuse) */
.st-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 12px;
    margin-top: 6px;
}

@media (max-width: 1050px) {
    .st-hero {
        grid-template-columns: 1fr;
    }
    .st-metrics-grid {
        grid-template-columns: repeat(2,1fr);
    }
}

@media (max-width: 700px) {
    .st-metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.st-metric {
    background: var(--bg-soft);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.08);
}

.st-metric-label { font-size: 11px; opacity: .7; }
.st-metric-value { font-size: 18px; font-weight: 800; }

/* =========================================================
   CARDS + GLOBAL
   ========================================================= */

.st-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.st-card-large {
    min-height: 260px;
}

.st-card-header h2 {
    margin: 0 0 4px;
    font-size: 15px;
}

.st-card-caption {
    opacity: .7;
    font-size: 12px;
    margin: 0;
}

/* =========================================================
   PROBABILITY ENGINE
   ========================================================= */

.st-side-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.st-panel-block {
    background: rgba(15,23,42,0.9);
    border-radius: 14px;
    padding: 12px 12px 10px;
    border: 1px solid rgba(148,163,255,0.35);
}

.st-panel-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.st-panel-subtitle {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 8px;
}

.st-panel-note {
    font-size: 11px;
    margin-top: 8px;
    opacity: 0.75;
}

.st-prob-row {
    display: grid;
    grid-template-columns: 48px 1fr 45px;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    font-size: 12px;
}

.st-prob-bar-bg {
    height: 8px;
    width: 100%;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    overflow: hidden;
}

.st-prob-bar {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    transition: width .35s ease;
}

#prob-buy  { background: var(--green); }
#prob-sell { background: var(--red); }
#prob-hold { background: var(--yellow); }

/* =========================================================
   VOLATILITY
   ========================================================= */

.st-vol-track {
    height: 10px;
    background: rgba(255,255,255,0.18);
    border-radius: 999px;
    margin-top: 10px;
    position: relative;
}

#vol-pointer {
    position: absolute;
    width: 12px;
    height: 18px;
    top: -4px;
    border-radius: 4px;
    background: #fff;
    transition: left .3s ease;
}

/* =========================================================
   HEATMAP
   ========================================================= */

.st-heatmap {
    display: grid;
    grid-template-columns: repeat(8,1fr);
    gap: 4px;
    margin-top: 12px;
}

.st-heatmap-cell,
.heat-cell {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
}

/* کلاس‌هایی که JS ست می‌کند */
.hm-buy  { background: rgba(34,197,94,0.9); }
.hm-sell { background: rgba(239,68,68,0.9); }
.hm-hold { background: rgba(234,179,8,0.9); }

/* =========================================================
   SENTIMENT LIST
   ========================================================= */

.st-sentiment-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    font-size: 12px;
}

.st-sentiment-list li {
    margin-bottom: 4px;
}

/* =========================================================
   PRICE CHART
   ========================================================= */

.st-chart-wrap {
    width: 100%;
    height: 320px;
}

/* =========================================================
   AI ADVICE
   ========================================================= */

.st-ai-advice h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 14px;
}

.st-ai-advice p {
    margin: 0 0 6px;
    font-size: 12px;
    opacity: 0.86;
}

.st-ai-advice ul {
    margin: 0;
    padding-left: 16px;
    font-size: 12px;
}

/* =========================================================
   BUBBLE SPECTRUM
   ========================================================= */

.spectrum-panel {
    width: 100%;
    height: 360px;
    position: relative;
    overflow: hidden;

    background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
    border-radius: 16px;
    padding: 10px;

    border: 1px solid rgba(148,163,255,0.35);
    box-shadow: 0 18px 40px rgba(15,23,42,0.9);
}

.spectrum-grid {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255,255,255,0.06);
}

.bubble {
    position: absolute;
    border-radius: 50%;
    opacity: .9;
    transition: transform .2s ease, opacity .2s ease;
}

.bubble:hover {
    transform: scale(1.55);
    opacity: 1;
    z-index: 20;
}

.bubble-buy  { background: #4fc3ff; box-shadow: 0 0 10px #4fc3ff99; }
.bubble-sell { background: #ff6b6b; box-shadow: 0 0 10px #ff6b6b99; }
.bubble-hold { background: #ffe28a; box-shadow: 0 0 10px #ffe28a99; }

/* =========================================================
   DECISION FEED / PNL / TRADES
   ========================================================= */

.st-decision-list {
    max-height: 420px;
    overflow-y: auto;
}

.st-decision-item,
.decision-row {
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

.decision-row-main {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.decision-row-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    opacity: 0.75;
}

.decision-pill {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
}

.decision-buy  { background: rgba(34,197,94,0.12); color: #bbf7d0; }
.decision-sell { background: rgba(239,68,68,0.12); color: #fecaca; }
.decision-hold { background: rgba(234,179,8,0.12); color: #fef3c7; }

.decision-price {
    font-weight: 600;
}

/* PnL + Trades */
.st-pnl-list,
.st-trades-list {
    max-height: 380px;
    overflow-y: auto;
    font-size: 12px;
}

.pnl-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(148,163,255,0.25);
}

.pnl-date { opacity: 0.7; }
.pnl-val { font-weight: 600; }
.pnl-trades { opacity: 0.7; }

.pnl-pos { color: #4ade80; }
.pnl-neg { color: #f97373; }
.pnl-flat { color: #e5e7eb; }

.trade-row {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(148,163,255,0.25);
}

.trade-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.trade-header span:first-child { font-weight: 600; }

.trade-body {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.trade-pnl.pnl-pos { color: #4ade80; }
.trade-pnl.pnl-neg { color: #f97373; }
.trade-pnl.pnl-flat { color: #e5e7eb; }

/* =========================================================
   FOOTER
   ========================================================= */

.st-footer {
    width: 100%;
    text-align: center;
    padding: 32px 0 10px;
    font-size: 11px;
    opacity: .6;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 10px;
}
