/* ===================================================
   STH SMART ALGO - Professional Trading Dashboard CSS
   Dark Theme | Success Traders Hub
   =================================================== */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-sidebar: #0d1321;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;
    --border-color: #1e293b;
    --hover-bg: #1e293b;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease;
}
.sidebar.collapsed { transform: translateX(-100%); }

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px; border-bottom: 1px solid var(--border-color);
}
.brand-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 800; color: white;
    font-family: 'JetBrains Mono', monospace;
}
.brand-name { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.brand-sub { font-size: 11px; color: var(--text-muted); }

.sidebar-nav {
    list-style: none; padding: 12px 8px; flex: 1; overflow-y: auto;
}
.sidebar-nav li a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; border-radius: 8px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    transition: all 0.2s;
}
.sidebar-nav li a:hover { background: var(--hover-bg); color: var(--text-primary); }
.sidebar-nav li a.active {
    background: rgba(59,130,246,0.15); color: var(--accent-blue);
    font-weight: 600;
}
.sidebar-nav li a i { width: 20px; text-align: center; font-size: 14px; }
.nav-divider { border-color: var(--border-color); margin: 8px 16px; opacity: 0.3; }

.sidebar-footer {
    padding: 16px; border-top: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: var(--text-secondary);
}
.sidebar-footer a { color: var(--accent-red); text-decoration: none; }

/* MAIN CONTENT */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s;
}
.sidebar.collapsed ~ .main-content { margin-left: 0; }

.topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
}
.btn-toggle { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.status-badge {
    padding: 4px 12px; border-radius: 20px; font-size: 12px;
    background: rgba(16,185,129,0.15); color: var(--accent-green);
}

.content-wrapper { padding: 24px; }

/* PAGE HEADER */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; font-weight: 700; }

/* STAT CARDS */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.stat-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 20px; display: flex; align-items: center; gap: 16px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white;
}
.stat-icon.bg-primary { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.bg-success { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.bg-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.bg-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-info h3 { font-size: 24px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.stat-info p { font-size: 12px; color: var(--text-muted); margin: 0; }
.pnl-positive .stat-info h3 { color: var(--accent-green); }
.pnl-negative .stat-info h3 { color: var(--accent-red); }

/* CARDS */
.card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius);
}
.card-header {
    background: transparent; border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
}
.card-header h5 { margin: 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* TABLES */
.table-dark { --bs-table-bg: var(--bg-card); --bs-table-border-color: var(--border-color); }
.table-dark thead th {
    background: var(--bg-secondary); font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}
.table-hover > tbody > tr:hover { background: var(--hover-bg) !important; }

/* FORMS */
.form-control, .form-select {
    background: var(--bg-secondary); border-color: var(--border-color);
    color: var(--text-primary); border-radius: 8px; padding: 10px 14px;
}
.form-control:focus, .form-select:focus {
    background: var(--bg-secondary); color: var(--text-primary);
    border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }

/* BUTTONS */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    border: none; font-weight: 600; border-radius: 8px; padding: 10px 20px;
}
.btn-primary:hover { background: linear-gradient(135deg, #2563eb, #1d4ed8); transform: translateY(-1px); }

/* BADGES */
.badge { font-weight: 500; font-size: 11px; padding: 4px 10px; border-radius: 6px; }

/* STRATEGY CARDS */
.strategy-card { transition: transform 0.2s; }
.strategy-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* BROKER CARDS */
.broker-card { transition: transform 0.2s; }
.broker-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* AUTH PAGES */
.auth-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f172a 50%, #1a1a3e 100%);
}
.auth-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 40px; width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.logo-icon-lg {
    width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800; color: white;
    font-family: 'JetBrains Mono', monospace;
}
.auth-logo h1 { font-size: 22px; font-weight: 700; }
.auth-logo p { color: var(--text-muted); font-size: 14px; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.content-wrapper { animation: fadeIn 0.3s ease; }
.stat-card { animation: fadeIn 0.4s ease backwards; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.3s; }

/* FONT MONOSPACE */
.font-monospace { font-family: 'JetBrains Mono', monospace !important; }

/* ALERT OVERRIDES */
.alert { border-radius: 8px; border: none; font-size: 14px; }
