/* ═══════════════════════════════════════════════════════════════════════════
   SolVault — Dashboard Page Styles
   Dedicated full-page dashboard with live activity feeds
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ Dashboard Layout ═══ */
.dash-page {
    background: var(--g50);
    min-height: 100vh;
}
.dash-main {
    padding-top: calc(var(--nav-h) + 20px);
    padding-bottom: 40px;
}
.dash-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ═══ Dashboard Navbar ═══ */
.dash-nav-center {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dash-nav-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--black);
}
.dash-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: var(--green-bg);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #16a34a;
    letter-spacing: 0.5px;
}
.dash-wallet-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--g100);
    border: 1px solid var(--g200);
    border-radius: 999px;
    font-size: 13px;
    color: var(--g600);
    cursor: pointer;
}
.dash-wallet-pill.connected {
    background: var(--g100);
    border-color: var(--g200);
    color: var(--g600);
}
.dash-wallet-pill.connected .wallet-dot {
    background: #10b981;
    box-shadow: 0 0 4px #10b981;
}

/* ═══ Status Bar ═══ */
.dash-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--white);
    border: 1px solid var(--g200);
    border-radius: var(--r);
    gap: 12px;
    flex-wrap: wrap;
}
.dash-status-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.dash-status-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.dash-uptime {
    font-size: 12px;
    color: var(--g400);
    font-family: var(--mono);
}
.dash-ai-status, .dash-blockchain-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--green);
}
.ai-pulse, .chain-pulse {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(34,197,94,0.4);
}

/* ═══ Stats Row ═══ */
.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.dash-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--white);
    border: 1px solid var(--g200);
    border-radius: var(--r);
    transition: all 0.3s ease;
}
.dash-stat-card:hover {
    border-color: var(--g300);
    transform: translateY(-1px);
}
.dash-stat-card.stat-highlight {
    border-color: var(--green);
    background: linear-gradient(135deg, var(--white) 0%, var(--green-bg) 100%);
}
.stat-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.stat-content {
    display: flex;
    flex-direction: column;
}
.dash-stat-card .stat-label {
    font-size: 11px;
    color: var(--g400);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}
.dash-stat-card .stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--black);
    font-family: var(--mono);
}

/* ═══ Panels ═══ */
.dash-panel {
    background: var(--white);
    border: 1px solid var(--g200);
    border-radius: var(--r);
    overflow: hidden;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--g100);
}
.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--black);
}
.panel-title svg {
    color: var(--g400);
    flex-shrink: 0;
}
.panel-body {
    padding: 20px;
}
.signal-count {
    font-size: 12px;
    color: var(--g400);
    font-family: var(--mono);
}

/* ═══ Two Column Grid ═══ */
.dash-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ═══ Activity Feed ═══ */
.activity-feed, .signal-feed-dash {
    max-height: 400px;
    min-height: 300px;
    overflow-y: auto;
    scroll-behavior: smooth;
}
/* === Live Trade Terminal === */
.terminal-panel .panel-head { border-bottom: 1px solid var(--g200); }
.terminal-feed {
    max-height: 400px;
    min-height: 300px;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: #0d1117;
    border-radius: 0 0 12px 12px;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
}
.terminal-line {
    padding: 2px 0;
    white-space: pre-wrap;
    word-break: break-all;
    color: #c9d1d9;
}
.terminal-line.dim { color: #484f58; }
.terminal-line.buy { color: #3fb950; }
.terminal-line.sell { color: #f85149; }
.terminal-line.tp { color: #58a6ff; }
.terminal-line.info { color: #8b949e; }
.terminal-line.warn { color: #d29922; }
.terminal-line.profit { color: #3fb950; font-weight: 600; }
.terminal-line.loss { color: #f85149; font-weight: 600; }

/* Wallet balance sub text */
.stat-sub {
    font-size: 12px;
    color: var(--g400);
    margin-top: 2px;
}.activity-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--g400);
    font-size: 14px;
}
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--g100);
    animation: fadeSlideIn 0.4s ease;
    transition: background 0.2s;
}
.activity-item:hover {
    background: var(--g50);
}
.activity-item:last-child {
    border-bottom: none;
}
.activity-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}
.activity-icon.scan { background: var(--blue-bg); }
.activity-icon.filter { background: var(--g100); }
.activity-icon.pass { background: var(--green-bg); }
.activity-icon.fail { background: var(--red-bg); }
.activity-icon.buy { background: var(--green-bg); }
.activity-icon.sell { background: var(--red-bg); }
.activity-icon.tp { background: var(--blue-bg); }
.activity-icon.info { background: var(--g100); }

.activity-body {
    flex: 1;
    min-width: 0;
}
.activity-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 2px;
}
.activity-desc {
    font-size: 12px;
    color: var(--g500);
    line-height: 1.5;
}
.activity-desc code {
    font-family: var(--mono);
    font-size: 11px;
    background: var(--g100);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--g600);
}
.activity-time {
    font-size: 11px;
    color: var(--g400);
    font-family: var(--mono);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Signal items in dashboard */
.signal-feed-dash .signal-item {
    animation: fadeSlideIn 0.4s ease;
}

/* ═══ Spinner ═══ */
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--g200);
    border-top: 3px solid var(--black);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══ Pipeline ═══ */
.pipeline-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 0;
}
.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--g50);
    border: 1px solid var(--g200);
    border-radius: var(--r-sm);
    min-width: 100px;
    transition: all 0.3s;
}
.pipeline-step.active {
    border-color: var(--green);
    background: var(--green-bg);
}
.pipe-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--g300);
}
.pipeline-step.active .pipe-dot {
    background: var(--green);
    animation: pulse 2s infinite;
    box-shadow: 0 0 6px rgba(34,197,94,0.4);
}
.pipe-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--black);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.pipe-status {
    font-size: 10px;
    color: var(--g500);
    font-family: var(--mono);
}
.pipeline-arrow {
    font-size: 18px;
    color: var(--g300);
    font-weight: 300;
}

/* ═══ New signal highlight ═══ */
.signal-new {
    animation: highlightNew 2s ease;
}
@keyframes highlightNew {
    0% { background: var(--green-bg); }
    100% { background: transparent; }
}

/* PNL Colors for Trade History */
.pnl-positive { color: #22c55e; font-weight: 600; }
.pnl-negative { color: #ef4444; font-weight: 600; }
.pnl-neutral  { color: var(--g400); }

/* Wallet Summary Row */
.wallet-summary-row .dash-stat-card .stat-label { font-size: 11px; }

/* ═══ Dashboard Responsive ═══ */
@media (max-width: 1024px) {
    .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
    .pipeline-grid { gap: 6px; }
    .pipeline-step { min-width: 80px; padding: 10px 12px; }
}
@media (max-width: 768px) {
    .dash-main { padding-top: calc(var(--nav-h) + 12px); padding-bottom: 24px; }
    .dash-container { gap: 12px; }
    .dash-grid-2col { grid-template-columns: 1fr; }
    .dash-stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .dash-stat-card { padding: 14px 16px; gap: 10px; }
    .dash-stat-card .stat-value { font-size: 18px; }
    .stat-icon { font-size: 20px; }

    .dash-nav-center { display: none; }
    .dash-status-bar { flex-direction: column; align-items: flex-start; padding: 12px 16px; }
    .dash-status-right { width: 100%; justify-content: flex-start; }

    .panel-head { padding: 12px 16px; }
    .panel-body { padding: 16px; }
    .panel-title { font-size: 13px; }

    .activity-feed, .signal-feed-dash { max-height: 320px; min-height: 220px; }
    .activity-item { padding: 10px 16px; gap: 10px; }
    .activity-icon { width: 28px; height: 28px; font-size: 14px; }
    .activity-title { font-size: 12px; }
    .activity-desc { font-size: 11px; }
    .activity-time { font-size: 10px; }

    .pipeline-grid { gap: 4px; }
    .pipeline-step { min-width: 64px; padding: 8px 10px; }
    .pipe-label { font-size: 9px; }
    .pipe-status { font-size: 9px; }
    .pipeline-arrow { font-size: 14px; }

    .config-grid { grid-template-columns: 1fr; }
    .dash-wallet-pill { padding: 5px 10px; font-size: 11px; }
}
@media (max-width: 480px) {
    .dash-stats-row { grid-template-columns: 1fr 1fr; gap: 6px; }
    .dash-stat-card { padding: 12px; flex-direction: column; align-items: flex-start; gap: 6px; }
    .stat-icon { font-size: 18px; }
    .dash-stat-card .stat-value { font-size: 16px; }
    .activity-feed, .signal-feed-dash { max-height: 280px; min-height: 180px; }
    .pipeline-step { min-width: 56px; padding: 6px 8px; }
    .pipeline-arrow { display: none; }
    .pipeline-grid { gap: 6px; justify-content: flex-start; }
}
@media (max-width: 360px) {
    .dash-stats-row { grid-template-columns: 1fr; }
    .dash-wallet-pill span:first-of-type:not(.wallet-dot) { display: none; }
}

/* ─── Bot Start / Stop Controls ─── */

.dash-bot-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-bot-start,
.btn-bot-stop {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-bot-start {
    background: linear-gradient(135deg, #00ffa3, #00cc82);
    color: #0a0f1c;
    box-shadow: 0 2px 12px rgba(0, 255, 163, 0.25);
}
.btn-bot-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 255, 163, 0.4);
}

.btn-bot-stop {
    background: linear-gradient(135deg, #ff4466, #cc2244);
    color: #fff;
    box-shadow: 0 2px 12px rgba(255, 68, 102, 0.25);
}
.btn-bot-stop:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 68, 102, 0.4);
}

.bot-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted, #8892b0);
    font-weight: 500;
}

.bot-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.bot-status-dot.running {
    background: #00ffa3;
    box-shadow: 0 0 8px rgba(0, 255, 163, 0.6);
    animation: botPulse 1.5s ease-in-out infinite;
}
.bot-status-dot.stopped {
    background: #ff4466;
    box-shadow: 0 0 6px rgba(255, 68, 102, 0.4);
}

@keyframes botPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.config-note {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted, #8892b0);
    opacity: 0.8;
}

@media (max-width: 768px) {
    .dash-bot-controls {
        flex-wrap: wrap;
        gap: 6px;
    }
    .btn-bot-start,
    .btn-bot-stop {
        padding: 5px 12px;
        font-size: 12px;
    }
}
