/* Root theme tokens */
:root {
    --bg-base: #070913;
    --bg-glass: rgba(13, 17, 39, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-cyan: #06b6d4;
    --accent-gold: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --font-family: 'Outfit', sans-serif;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Atmospheric background elements */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 45%);
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Glassmorphic card styling */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-badge {
    background: linear-gradient(90deg, var(--accent-rose), #ec4899);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    animation: pulse-glow 2s infinite alternate;
}

.status-indicator-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge.secondary {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.live {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-left: 1px solid var(--border-glass);
    padding-left: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
}

.status-dot.online {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.money-icon::before { content: "₦"; color: var(--accent-cyan); font-weight: 700; }
.risk-icon::before { content: "🛡️"; }
.chart-icon::before { content: "📊"; }

.metric-content h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.metric-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.15rem;
}

.metric-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Main Workspace Grid */
.workspace-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pulse-icon {
    width: 6px;
    height: 6px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: beat 1.5s infinite;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.market-table th, .market-table td {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.market-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.market-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.market-title-cell {
    font-weight: 600;
}

.empty-row {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem !important;
}

/* Colors for table edges */
.positive-edge {
    color: var(--accent-emerald);
    font-weight: 600;
}

.negative-edge {
    color: var(--accent-rose);
}

/* Chart */
.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

/* Terminal Console */
.terminal-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.terminal-console {
    background: #03040a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    height: 250px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.terminal-line {
    line-height: 1.4;
    white-space: pre-wrap;
}

.system-line { color: var(--accent-cyan); }
.info-line { color: #f8fafc; }
.warning-line { color: var(--accent-gold); }
.error-line { color: var(--accent-rose); }
.success-line { color: var(--accent-emerald); }

.log-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
}

.btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn:hover {
    color: var(--text-primary);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 2px var(--accent-rose); }
    100% { box-shadow: 0 0 12px var(--accent-rose); }
}

@keyframes beat {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.3); opacity: 1; }
}
