/* Algo Trader — dark trading terminal theme */

:root {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-header: #1c2333;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #1e40af;
    --profit: #3fb950;
    --loss: #f85149;
    --warning: #d29922;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', -apple-system, sans-serif;
    font-size: 14px;
}

/* Navbar */
.navbar {
    background: var(--bg-header) !important;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.text-accent { color: var(--accent) !important; }
.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
}
.btn-accent:hover {
    background: #1d4ed8;
    color: #fff;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Colors */
.text-profit { color: var(--profit) !important; }
.text-loss { color: var(--loss) !important; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.card-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    padding: 10px 16px;
}

/* Tables */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
}

.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-color: var(--border);
}

.table td {
    border-color: var(--border);
    vertical-align: middle;
}

/* Kill switch button pulse */
.btn-danger {
    position: relative;
}

/* Badge tweaks */
.badge { font-weight: 500; }

/* Form inputs */
.form-control {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.form-control:focus {
    background: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.25);
    color: var(--text);
}

/* P&L Chart */
.pnl-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 100px;
    padding: 0 4px;
}

.pnl-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.pnl-bar {
    width: 100%;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: opacity 0.15s;
}

.pnl-bar.profit { background: var(--profit); }
.pnl-bar.loss { background: var(--loss); }
.pnl-bar-wrap:hover .pnl-bar { opacity: 0.7; }

.pnl-date {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Trade reasoning popover */
.reasoning-hint {
    color: var(--accent);
    cursor: pointer;
}

/* Dark-themed Bootstrap popover */
.popover-dark {
    --bs-popover-bg: var(--bg-header);
    --bs-popover-body-color: var(--text);
    --bs-popover-border-color: var(--border);
    --bs-popover-arrow-border: var(--border);
    max-width: 350px;
    font-size: 0.8rem;
    line-height: 1.4;
}

.popover-dark .popover-body {
    color: var(--text);
}

/* Smart exit reason badges */
.bg-purple { background: #7c3aed !important; }

/* Responsive */
@media (max-width: 768px) {
    .stat-value { font-size: 1.1rem; }
    .navbar-nav { flex-direction: row; gap: 0.25rem; }
    .nav-link { font-size: 0.85rem; padding: 0.25rem 0.5rem !important; }
}
