/* =========================================================
   🎨 SmartTrader Quantum UI – Unified CSS
   Clean • Optimized • RTL • One-File Version
   ========================================================= */

:root {
    --bg-main: radial-gradient(circle at top, #0b1020 0, #050612 35%, #020308 100%);
    --bg-card: rgba(15, 23, 42, 0.9);
    --bg-soft: rgba(15, 23, 42, 0.65);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --blue: #60a5fa;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #fbbf24;
    --purple: #a78bfa;

    --radius-lg: 18px;
    --radius-md: 14px;
    --shadow: 0 22px 50px rgba(0,0,0,0.75);
}

/* =========================================================
   🌍 Base
   ========================================================= */

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    direction: rtl;
    font-family: IRANSans, system-ui;
    background: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

#app {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

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

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

.st-hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
    position: relative;
}

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

.st-algo-canvas {
    position: absolute;
    inset: -100px;
    opacity: 0.45;
    z-index: 0;
}

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

.st-hero-ticker {
    position: absolute;
    bottom: 16px;
    right: 16px;
    padding: 6px 12px;
    background: rgba(15,23,42,0.8);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    font-size: 12px;
    z-index: 3;
}

.st-hero-right { position: relative; z-index: 3; }

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

.st-hero-title {
    font-size: 28px;
    line-height: 1.8;
    margin: 16px 0;
}

.st-highlight {
    color: #82b1ff;
}

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

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

.st-badge {
    background: rgba(15,23,42,0.85);
    border: 1px solid rgba(148,163,184,0.35);
    padding: 7px 12px;
    border-radius: 12px;
    font-size: 11px;
}

.st-badge-value { font-weight: bold; }

.st-hero-actions {
    display: flex;
    gap: 10px;
}

.st-btn {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: 0.25s;
}

.st-btn-primary {
    background: linear-gradient(90deg,#4f46e5,#0ea5e9);
    color: #fff;
}

.st-btn-primary:hover { transform: translateY(-2px) scale(1.03); }

.st-btn-ghost {
    background: transparent;
    border: 1px solid rgba(148,163,184,0.5);
    color: #e5e7eb;
}
.st-btn-ghost:hover { background: rgba(255,255,255,0.05); }

/* =========================================================
   🧊 GRID SYSTEM + CARDS
   ========================================================= */

.st-row {
    margin-bottom: 32px;
}

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

@media (max-width: 900px) {
    .st-row-responsive {
        grid-template-columns: 1fr;
    }
}

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

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

.st-card-caption {
    font-size: 12px;
    opacity: 0.75;
}

/* =========================================================
   ⚡ ENERGY CHART
   ========================================================= */

.st-energy-chart {
    height: 360px;
}

/* =========================================================
   📊 SIDE PANEL
   ========================================================= */

.st-side-panel .st-panel-block {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
}

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

.st-panel-subtitle {
    font-size: 11px;
    opacity: 0.75;
}

/* Probability */
.st-prob-list {
    list-style: none;
    padding: 0;
    margin-top: 8px;
    font-size: 12px;
}

.st-prob-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

/* Volatility */
.st-vol-bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg,#22c55e,#eab308,#ef4444);
    margin: 8px 0;
}

.st-vol-bar-fill {
    position: absolute;
    height: 100%;
    width: 0%;
    background: rgba(255,255,255,0.9);
    border-radius: inherit;
    transition: width 0.3s;
}

.st-vol-text {
    font-size: 11px;
    opacity: 0.75;
    margin-top: 4px;
}

/* =========================================================
   🔥 DECISION MATRIX
   ========================================================= */

.st-decision-matrix {
    display: grid;
    grid-template-columns: repeat(24,1fr);
    gap: 2px;
}

.st-matrix-cell {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 4px;
    background: rgba(255,255,255,0.2);
}

.m-buy  { background: rgba(34,197,94,0.9); }
.m-sell { background: rgba(239,68,68,0.9); }
.m-hold { background: rgba(234,179,8,0.9); }

/* =========================================================
   📈 PERFORMANCE SUMMARY
   ========================================================= */

.st-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 14px;
}

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

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

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

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

#ai-advice-title {
    font-size: 14px;
    margin-bottom: 6px;
}

#ai-advice-list {
    padding-right: 18px;
    font-size: 12px;
}

/* =========================================================
   📰 DECISION FEED
   ========================================================= */

.st-decision-feed { max-height: 400px; overflow-y: auto; }

.st-feed-item {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 10px;
    font-size: 12px;
}

.f-buy  { border-right: 4px solid var(--green); }
.f-sell { border-right: 4px solid var(--red); }
.f-hold { border-right: 4px solid var(--yellow); }

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

.st-footer {
    margin-top: 60px;
    font-size: 12px;
    opacity: 0.75;
    text-align: center;
}
/* =========================================================
   🔥 FIX 1 — Heatmap
   ========================================================= */

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

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

.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); }


/* =========================================================
   🔥 FIX 2 — Probability Engine
   ========================================================= */

.st-prob-row {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

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

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

#prob-buy  { background: rgba(34,197,94,0.9); }
#prob-sell { background: rgba(239,68,68,0.9); }
#prob-hold { background: rgba(234,179,8,0.9); }


/* =========================================================
   🔥 FIX 3 — Decision Feed (Live Stream)
   ========================================================= */

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

.st-decision-item {
    background: rgba(255,255,255,0.05);
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.6;
}

.df-buy  { border-right: 4px solid var(--green); }
.df-sell { border-right: 4px solid var(--red); }
.df-hold { border-right: 4px solid var(--yellow); }
/* Bubble Spectrum Panel */
.spectrum-panel {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #0e1117, #121621);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    padding: 10px;
    box-shadow: 0 0 25px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.06);
}

/* Vertical guide lines */
.spectrum-grid {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255,255,255,0.05);
}

/* Bubble item */
.bubble {
    position: absolute;
    border-radius: 50%;
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

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

/* BUY / SELL / HOLD colors */
.bubble-buy {
    background: #4fc3ff;
    box-shadow: 0 0 10px #4fc3ff88;
}

.bubble-sell {
    background: #ff6b6b;
    box-shadow: 0 0 10px #ff6b6b88;
}

.bubble-hold {
    background: #ffe28a;
    box-shadow: 0 0 10px #ffe28a88;
}
/* ------------------ Quantum Rings Background ------------------ */

.quantum-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 320px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.32;
    z-index: 0;
}

.st-hero {
    position: relative;
    z-index: 2; /* محتوا بالاتر از حلقه‌ها */
}

.quantum-rings {
    width: 140%;
    height: 140%;
    transform: translate(-20%, -20%);
}

.ring {
    fill: none;
    stroke: #4fc3ff33;
    stroke-width: 2px;
    stroke-linecap: round;
    animation: spin 14s linear infinite, pulse 6s ease-in-out infinite;
    filter: drop-shadow(0 0 10px #4fc3ff55);
}

@keyframes spin {
    from { transform: rotate(0deg); transform-origin: 400px 400px; }
    to   { transform: rotate(360deg); transform-origin: 400px 400px; }
}

@keyframes pulse {
    0%   { stroke-opacity: 0.10; }
    50%  { stroke-opacity: 0.40; }
    100% { stroke-opacity: 0.10; }
}
#quantumFlux {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 360px;
    opacity: 0.22;
    filter: blur(0.4px);
    z-index: 0;
    pointer-events: none;
}
/* Floating BTC Panel */
.floating-price {
    position: absolute;
    top: 30px;
    left: 40px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    padding: 10px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.25);
    color: #e8f9ff;
    z-index: 15;
    display: flex;
    flex-direction: column;
}

.floating-price .fp-label {
    font-size: 12px;
    opacity: 0.75;
}

.floating-price .fp-value {
    font-size: 18px;
    margin-top: 2px;
    font-weight: 600;
    color: #6cf3ff;
}
.fx-glow {
    animation: glowPulse 2.4s infinite ease-in-out;
}

@keyframes glowPulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}
.st-vol-track {
    height: 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    margin-top: 8px;
    position: relative;
}

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