/**
 * Nextsol Trading Platform — shared user UI
 * Upload: user/css/platform.css
 */

/* ========== TRADING THEME OVERRIDES ========== */
:root {
    --rx-bg: #eef2ff;
    --rx-bg-soft: #f8fafc;
    --rx-surface: #ffffff;
    --rx-surface-2: #f1f5f9;
    --rx-border: #e2e8f0;
    --rx-border-strong: #c7d2fe;
    --rx-text: #0f172a;
    --rx-text-muted: #64748b;
    --rx-primary: #2563eb;
    --rx-primary-dark: #1d4ed8;
    --rx-secondary: #7c3aed;
    --rx-success: #16a34a;
    --rx-danger: #dc2626;
    --rx-warning: #d97706;
    --rx-navy: #0b1220;
    --rx-navy-2: #111827;
    --rx-gradient-brand: linear-gradient(135deg, #1d4ed8 0%, #4f46e5 45%, #7c3aed 100%);
    --rx-gradient-dark: linear-gradient(145deg, #0b1220 0%, #1e293b 55%, #312e81 100%);
    --rx-shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --rx-shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --rx-radius: 1rem;
    --rx-radius-lg: 1.25rem;
    --rx-mono: 'JetBrains Mono', ui-monospace, monospace;
}

body.rx-theme-light.rx-body {
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 40%, #f1f5f9 100%);
    color: var(--rx-text);
}

body.rx-theme-dark.rx-body {
    background: #0b1220 !important;
    color: #e2e8f0 !important;
}

body.rx-theme-light.rx-body::before { background: #818cf8; opacity: 0.25; }
body.rx-theme-light.rx-body::after { background: #38bdf8; opacity: 0.2; }
body.rx-theme-dark.rx-body::before,
body.rx-theme-dark.rx-body::after { opacity: 0.08 !important; }

/* ========== PAGE SHELL ========== */
.rx-page {
    position: relative;
    z-index: 1;
}

.rx-page-header {
    text-align: left;
    margin-bottom: 1rem;
    animation: none;
}

.rx-page-header h1,
.rx-page-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    justify-content: flex-start;
    color: var(--rx-text);
}

.rx-page-header p {
    font-size: 0.78rem;
    color: var(--rx-text-muted);
    margin-top: 0.35rem;
    line-height: 1.5;
}

.rx-page-accent {
    width: 3rem;
    height: 3px;
    margin: 0.55rem auto 0;
    border-radius: 999px;
    background: var(--rx-gradient-brand);
}

/* ========== PORTFOLIO ========== */
.rx-portfolio-hero {
    background: var(--rx-gradient-dark);
    border-radius: var(--rx-radius-lg);
    padding: 1.1rem 1.15rem;
    color: #fff;
    box-shadow: var(--rx-shadow-lg);
    margin-bottom: 0.85rem;
    position: relative;
    overflow: hidden;
    animation: rxPlatFadeUp 0.5s ease both;
}

.rx-portfolio-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.35), transparent 50%);
    pointer-events: none;
}

.rx-portfolio-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.rx-portfolio-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.65);
}

.rx-portfolio-balance {
    font-family: var(--rx-mono);
    font-size: 1.65rem;
    font-weight: 800;
    margin-top: 0.2rem;
    letter-spacing: -0.02em;
}

.rx-portfolio-live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.62rem;
    font-weight: 700;
    color: #86efac;
    margin-top: 0.35rem;
}

.rx-portfolio-live span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    animation: rxPlatPulse 1.5s infinite;
}

.rx-portfolio-actions {
    display: flex;
    gap: 0.35rem;
}

.rx-portfolio-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.rx-portfolio-btn:hover { background: rgba(255, 255, 255, 0.16); }

.rx-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
    margin-top: 0.85rem;
    position: relative;
    z-index: 1;
}

.rx-portfolio-stat {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.55rem 0.65rem;
}

.rx-portfolio-stat label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.55);
}

.rx-portfolio-stat strong {
    display: block;
    font-family: var(--rx-mono);
    font-size: 0.82rem;
    font-weight: 800;
    margin-top: 0.15rem;
}

.rx-portfolio-stat--green strong { color: #86efac; }
.rx-portfolio-stat--red strong { color: #fca5a5; }
.rx-portfolio-stat--gold strong { color: #fde68a; }

/* ========== CHART CARD ========== */
.rx-chart-card {
    background: var(--rx-surface);
    border: 1.5px solid var(--rx-border);
    border-radius: var(--rx-radius-lg);
    padding: 0.85rem;
    margin-bottom: 0.85rem;
    box-shadow: var(--rx-shadow-md);
    animation: rxPlatFadeUp 0.55s ease both;
}

.rx-chart-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}

.rx-chart-card-head h3 {
    font-size: 0.82rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.rx-chart-card-head span {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--rx-success);
    background: rgba(22, 163, 74, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.rx-chart-wrap-box {
    height: 200px;
    position: relative;
}

/* ========== QUICK ACTIONS ========== */
.rx-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.rx-quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.35rem;
    border-radius: 0.85rem;
    background: var(--rx-surface);
    border: 1.5px solid var(--rx-border);
    text-decoration: none;
    color: var(--rx-text);
    box-shadow: var(--rx-shadow-md);
    transition: transform 0.15s, border-color 0.15s;
    animation: rxPlatFadeUp 0.5s ease both;
}

.rx-quick-item:hover {
    transform: translateY(-2px);
    border-color: var(--rx-border-strong);
}

.rx-quick-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    background: var(--rx-gradient-brand);
}

.rx-quick-item span {
    font-size: 0.58rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
}

/* ========== STAT CARDS ROW ========== */
.rx-metric-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.rx-metric-card {
    background: var(--rx-surface);
    border: 1.5px solid var(--rx-border);
    border-radius: var(--rx-radius);
    padding: 0.75rem;
    box-shadow: var(--rx-shadow-md);
    animation: rxPlatFadeUp 0.55s ease both;
}

.rx-metric-card-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    color: #fff;
    margin-bottom: 0.45rem;
}

.rx-metric-card label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--rx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rx-metric-card strong {
    display: block;
    font-family: var(--rx-mono);
    font-size: 0.92rem;
    font-weight: 800;
    margin-top: 0.15rem;
}

/* ========== RECORDS ========== */
.rx-filter-tabs {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin-bottom: 0.75rem;
    scrollbar-width: none;
}

.rx-filter-tabs::-webkit-scrollbar { display: none; }

.rx-filter-tab {
    flex-shrink: 0;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    border: 1.5px solid var(--rx-border);
    background: var(--rx-surface);
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--rx-text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.rx-filter-tab.is-active,
.rx-filter-tab:hover {
    background: var(--rx-gradient-brand);
    color: #fff;
    border-color: transparent;
}

.rx-records-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.rx-records-sum-item {
    background: var(--rx-surface);
    border: 1px solid var(--rx-border);
    border-radius: 0.75rem;
    padding: 0.55rem;
    text-align: center;
}

.rx-records-sum-item label {
    display: block;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--rx-text-muted);
    text-transform: uppercase;
}

.rx-records-sum-item strong {
    display: block;
    font-family: var(--rx-mono);
    font-size: 0.72rem;
    font-weight: 800;
    margin-top: 0.15rem;
}

.rx-record-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.rx-record-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.65rem;
    align-items: center;
    background: var(--rx-surface);
    border: 1.5px solid var(--rx-border);
    border-radius: var(--rx-radius);
    padding: 0.75rem;
    box-shadow: var(--rx-shadow-md);
    animation: rxPlatFadeUp 0.4s ease both;
}

.rx-record-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
}

.rx-record-body h4 {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--rx-text);
    margin-bottom: 0.12rem;
}

.rx-record-body p {
    font-size: 0.62rem;
    color: var(--rx-text-muted);
    line-height: 1.4;
}

.rx-record-time {
    font-size: 0.58rem;
    color: var(--rx-text-muted);
    margin-top: 0.2rem;
    font-family: var(--rx-mono);
}

.rx-record-amount {
    text-align: right;
}

.rx-record-amount strong {
    display: block;
    font-family: var(--rx-mono);
    font-size: 0.82rem;
    font-weight: 800;
}

.rx-record-amount.in strong { color: var(--rx-success); }
.rx-record-amount.out strong { color: var(--rx-danger); }

.rx-record-status {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: var(--rx-surface-2);
    color: var(--rx-text-muted);
}

.rx-record-status.approved,
.rx-record-status.completed,
.rx-record-status.credited,
.rx-record-status.claimed { background: rgba(22, 163, 74, 0.12); color: var(--rx-success); }

.rx-record-status.pending { background: rgba(217, 119, 6, 0.12); color: var(--rx-warning); }

.rx-record-status.rejected,
.rx-record-status.cancelled { background: rgba(220, 38, 38, 0.12); color: var(--rx-danger); }

.rx-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    background: var(--rx-surface);
    border: 1.5px dashed var(--rx-border-strong);
    border-radius: var(--rx-radius-lg);
    color: var(--rx-text-muted);
}

.rx-empty-state i {
    font-size: 2rem;
    margin-bottom: 0.65rem;
    opacity: 0.45;
}

.rx-loading {
    text-align: center;
    padding: 2rem;
    color: var(--rx-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

/* ========== REFERRAL BAR ========== */
.rx-refer-bar {
    background: var(--rx-surface);
    border: 1.5px solid var(--rx-border);
    border-radius: var(--rx-radius-lg);
    padding: 0.75rem;
    margin-bottom: 0.85rem;
    box-shadow: var(--rx-shadow-md);
}

.rx-refer-bar label {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rx-text-muted);
    margin-bottom: 0.4rem;
}

.rx-refer-inner {
    display: flex;
    gap: 0.45rem;
}

.rx-refer-inner input {
    flex: 1;
    border: 1.5px solid var(--rx-border);
    border-radius: 0.65rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.68rem;
    font-family: var(--rx-mono);
    background: var(--rx-bg-soft);
}

.rx-refer-copy {
    width: 2.5rem;
    border: none;
    border-radius: 0.65rem;
    background: var(--rx-gradient-brand);
    color: #fff;
    cursor: pointer;
}

/* ========== TOAST ========== */
.rx-platform-toast {
    position: fixed;
    bottom: 5.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--rx-navy);
    color: #fff;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 20000;
}

.rx-platform-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes rxPlatFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rxPlatPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

@media (min-width: 768px) {
    .rx-quick-grid { grid-template-columns: repeat(8, 1fr); }
    .rx-portfolio-grid { grid-template-columns: repeat(4, 1fr); }
}

.rx-sticky-support {
    position: fixed;
    right: 1rem;
    bottom: 5.75rem;
    z-index: 10040;
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    font-size: 1.45rem;
    box-shadow: 0 12px 30px rgba(34, 197, 94, 0.45);
    text-decoration: none;
    animation: rxPlatPulse 2s infinite;
}

.rx-sticky-support:hover {
    transform: scale(1.06);
}

.rx-reminder-stack { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 0.85rem; }
.rx-reminder {
    padding: 0.75rem 0.85rem; border-radius: 0.95rem; font-size: 0.78rem; font-weight: 600; line-height: 1.45;
    border: 1px solid transparent;
}
.rx-reminder a { font-weight: 800; text-decoration: underline; }
.rx-reminder--warn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.rx-reminder--trade { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.rx-reminder--bonus { background: #fdf2f8; border-color: #fbcfe8; color: #9d174d; }

.rx-page-header--compact { text-align: left; margin-bottom: 0.65rem; }
.rx-page-header--compact h2 {
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 1rem; margin: 0; justify-content: flex-start;
}
.rx-page-header--compact h2 i { color: #2563eb; }

.rx-bonus-inline {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.7rem 0.85rem; margin-bottom: 0.75rem; border-radius: 0.85rem;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #86efac; color: #166534;
    font-size: 0.78rem; font-weight: 700; text-decoration: none;
    line-height: 1.35;
}
.rx-bonus-inline i:first-child { font-size: 0.95rem; color: #16a34a; }
.rx-bonus-inline i:last-child { margin-left: auto; font-size: 0.7rem; opacity: 0.7; }

.rx-app-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin-bottom: 0.75rem;
}
.rx-install-compact, .rx-reminder-compact {
    display: flex; align-items: center; justify-content: center; gap: 0.45rem;
    border: none; border-radius: 0.9rem; padding: 0.7rem 0.65rem;
    font-size: 0.74rem; font-weight: 800; cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rx-install-compact {
    background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.28);
}
.rx-install-compact i { font-size: 1rem; }
.rx-install-compact:disabled { opacity: 0.65; cursor: default; transform: none; }
.rx-reminder-compact {
    background: #fff; color: #15803d; border: 1px solid #86efac;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.rx-reminder-compact i { font-size: 0.9rem; }
.rx-reminder-compact:disabled { opacity: 0.7; cursor: default; }
.rx-install-compact:not(:disabled):active, .rx-reminder-compact:not(:disabled):active { transform: scale(0.98); }

.rx-install-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.85rem 1rem; margin-bottom: 0.85rem; border-radius: 1rem;
    background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 8px 24px rgba(15,23,42,.05);
}
.rx-install-bar strong { display: block; font-size: 0.85rem; margin-bottom: 0.15rem; }
.rx-install-bar p { font-size: 0.72rem; color: #64748b; margin: 0; line-height: 1.35; }
.rx-install-actions { display: flex; flex-direction: column; gap: 0.4rem; min-width: 7.5rem; }
.rx-install-btn, .rx-notify-btn {
    border: none; border-radius: 0.75rem; padding: 0.55rem 0.7rem;
    font-size: 0.72rem; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.rx-install-btn { background: linear-gradient(135deg,#4f46e5,#7c3aed); color: #fff; }
.rx-notify-btn { background: #ecfdf5; color: #15803d; border: 1px solid #86efac; }
.rx-install-btn.hidden { display: none; }
@media (min-width: 640px) {
    .rx-install-actions { flex-direction: row; min-width: auto; }
}

.rx-live-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; margin-bottom: 0.85rem;
}
.rx-live-stats--premium { gap: 0.6rem; }
.rx-live-stat {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 0.9rem; padding: 0.65rem 0.75rem; text-align: center;
}
.rx-live-stats--premium .rx-live-stat {
    display: flex; align-items: center; gap: 0.55rem; text-align: left;
    padding: 0.75rem 0.7rem; border: none; position: relative; overflow: hidden;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}
.rx-live-stats--premium .rx-live-stat::before {
    content: ''; position: absolute; inset: 0; opacity: 0.12; pointer-events: none;
}
.rx-live-stat--traders { background: linear-gradient(145deg, #eff6ff, #dbeafe); }
.rx-live-stat--traders::before { background: radial-gradient(circle at top right, #3b82f6, transparent 60%); }
.rx-live-stat--payouts { background: linear-gradient(145deg, #ecfdf5, #d1fae5); }
.rx-live-stat--payouts::before { background: radial-gradient(circle at top right, #10b981, transparent 60%); }
.rx-live-stat--members { background: linear-gradient(145deg, #faf5ff, #ede9fe); }
.rx-live-stat--members::before { background: radial-gradient(circle at top right, #8b5cf6, transparent 60%); }
.rx-live-stat-icon {
    width: 2rem; height: 2rem; border-radius: 0.65rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; color: #fff; position: relative; z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.rx-live-stat--traders .rx-live-stat-icon { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.rx-live-stat--payouts .rx-live-stat-icon { background: linear-gradient(135deg, #34d399, #059669); }
.rx-live-stat--members .rx-live-stat-icon { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.rx-live-stat-body { position: relative; z-index: 1; min-width: 0; }
.rx-live-stat label { display: block; font-size: 0.58rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.2; }
.rx-live-stat strong { font-size: 0.88rem; color: #0f172a; font-family: 'JetBrains Mono', monospace; }
.rx-live-stats--premium .rx-live-stat strong { font-size: 0.82rem; }
@media (max-width: 380px) {
    .rx-live-stats--premium .rx-live-stat { flex-direction: column; text-align: center; gap: 0.35rem; }
}

.rx-onboard-overlay {
    position: fixed; inset: 0; z-index: 10100; background: rgba(15,23,42,.55);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.rx-onboard-card {
    width: min(420px, 100%); background: #fff; border-radius: 1.1rem; padding: 1.1rem;
    box-shadow: 0 24px 60px rgba(15,23,42,.25);
}
.rx-onboard-card h3 { font-size: 1rem; margin-bottom: 0.65rem; }
.rx-onboard-card ol { margin: 0 0 0.85rem 1.1rem; font-size: 0.82rem; color: #475569; line-height: 1.5; }
.rx-onboard-link { display: inline-block; margin-bottom: 0.75rem; color: #dc2626; font-weight: 700; font-size: 0.82rem; text-decoration: none; }
.rx-onboard-actions { display: flex; gap: 0.5rem; }
.rx-onboard-primary, .rx-onboard-secondary {
    flex: 1; border: none; border-radius: 0.75rem; padding: 0.65rem; font-weight: 800; font-size: 0.82rem; cursor: pointer; text-align: center; text-decoration: none;
}
.rx-onboard-primary { background: linear-gradient(135deg,#4f46e5,#7c3aed); color: #fff; }
.rx-onboard-secondary { background: #f1f5f9; color: #475569; }
