/* Claude Trading Bot Dashboard */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #0a0e17;
    --bg2: #111827;
    --card: rgba(17,24,39,0.8);
    --card-hover: rgba(17,24,39,0.95);
    --accent: #00d4ff;
    --purple: #7c3aed;
    --green: #10b981;
    --red: #ef4444;
    --yellow: #f59e0b;
    --text: #f9fafb;
    --text2: #9ca3af;
    --text3: #6b7280;
    --border: rgba(255,255,255,0.08);
    --radius: 12px;
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Inter', system-ui, sans-serif;
}

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

body { font-family: var(--sans); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
.mono { font-family: var(--mono); }
.profit { color: var(--green) !important; }
.loss { color: var(--red) !important; }
.text-muted { color: var(--text3); }
.hidden { display: none !important; }

/* ===== LOGIN ===== */
#login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% 40%, #1a1f35 0%, var(--bg) 70%);
}

.login-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 48px 40px; width: 100%; max-width: 380px;
    backdrop-filter: blur(20px); box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-card h1 {
    text-align: center; font-size: 22px; margin-bottom: 4px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.login-card p { text-align: center; color: var(--text3); font-size: 13px; margin-bottom: 32px; }

.login-card input {
    width: 100%; padding: 12px 16px; margin-bottom: 14px;
    background: rgba(0,0,0,0.3); color: var(--text); font-family: var(--sans); font-size: 14px;
    border: 1px solid var(--border); border-radius: 8px; outline: none;
    transition: border-color 0.2s;
}

.login-card input:focus { border-color: var(--accent); }
.login-card input::placeholder { color: var(--text3); }

.login-card button {
    width: 100%; padding: 12px; margin-top: 8px; border: none; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.login-card button:hover { opacity: 0.9; }
.login-card button:active { transform: scale(0.98); }

#login-error { display: block; color: var(--red); font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px; }

/* ===== TOPBAR ===== */
#topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 56px; display: flex; align-items: center; padding: 0 20px; gap: 14px;
    background: rgba(17,24,39,0.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 16px; font-weight: 700; white-space: nowrap;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.spacer { flex: 1; }

#total-equity { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }

.status-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--text3);
    flex-shrink: 0;
}

.status-dot.online { background: var(--green); animation: pulse 2s infinite; }

#logout-btn {
    background: none; border: 1px solid var(--border); color: var(--text2);
    padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12px;
    font-family: var(--sans); transition: all 0.2s;
}

#logout-btn:hover { border-color: var(--red); color: var(--red); }

/* ===== BADGE ===== */
.badge {
    padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}

.badge-paper { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-live { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-long { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-short { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-indicator { background: rgba(0,212,255,0.1); color: var(--accent); }

/* ===== NAV ===== */
#nav {
    position: fixed; top: 56px; left: 0; right: 0; z-index: 99;
    display: flex; gap: 2px; padding: 6px 20px; overflow-x: auto;
    background: rgba(17,24,39,0.88); backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

#nav a {
    padding: 8px 16px; color: var(--text2); font-size: 13px; font-weight: 500;
    border-radius: 6px; white-space: nowrap; transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

#nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
#nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

.nav-symbol { font-size: 10px; opacity: 0.5; margin-left: 3px; }

/* ===== MAIN ===== */
#dashboard { padding-top: 100px; }
#app { max-width: 1400px; margin: 0 auto; padding: 0 20px 60px; }

.loading { text-align: center; padding: 80px; color: var(--text3); }

/* ===== GLASS CARD ===== */
.glass-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; margin-bottom: 16px;
    backdrop-filter: blur(12px); box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    transition: border-color 0.2s;
}

.glass-card:hover { border-color: rgba(255,255,255,0.12); }
.glass-card h2 { font-size: 15px; color: var(--text2); margin-bottom: 16px; font-weight: 600; }
.glass-card h3 { font-size: 14px; color: var(--text2); margin-bottom: 14px; font-weight: 600; }

.section-title { margin: 28px 0 12px; }
.section-title h2 { font-size: 17px; font-weight: 700; color: var(--text); }

/* ===== KPI CARDS ===== */
.kpi-row { display: flex; gap: 12px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 4px; }

.kpi-card {
    flex: 1; min-width: 130px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; backdrop-filter: blur(12px);
}

.kpi-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text3); margin-bottom: 8px; font-weight: 600;
}

.kpi-value { font-size: 20px; font-weight: 700; font-family: var(--mono); }

/* ===== STRATEGY GRID ===== */
.strategy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }

.strategy-card {
    display: block; cursor: pointer; text-decoration: none; color: var(--text);
    border-left: 3px solid var(--strat-color, var(--text3));
    transition: all 0.2s; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.strategy-card:hover {
    transform: translateY(-2px); border-color: rgba(255,255,255,0.15);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.sc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sc-name { font-weight: 600; font-size: 13px; }

.sc-symbol {
    padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700;
    letter-spacing: 0.3px;
}

.sc-equity { font-size: 22px; font-weight: 700; font-family: var(--mono); margin-bottom: 6px; }

.sc-position { font-size: 12px; font-weight: 500; margin-bottom: 8px; color: var(--text2); }

.sc-params {
    display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}

.sc-params span {
    font-size: 10px; color: var(--text3); font-family: var(--mono);
    background: rgba(255,255,255,0.04); padding: 2px 6px; border-radius: 4px;
}

.sc-footer { display: flex; justify-content: space-between; align-items: center; }

.sc-roi { font-size: 12px; font-weight: 600; font-family: var(--mono); }

.sc-bias {
    font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 700;
    text-transform: uppercase;
}

.bias-long { background: rgba(16,185,129,0.15); color: var(--green); }
.bias-short { background: rgba(239,68,68,0.15); color: var(--red); }
.bias-none, .bias-both, .bias-n\/a { background: rgba(255,255,255,0.05); color: var(--text3); }

/* ===== CHART ===== */
.chart-section { overflow: hidden; }

.chart-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}

.time-range { display: flex; gap: 4px; }

.tr-btn {
    padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px;
    background: transparent; color: var(--text2); font-size: 12px; cursor: pointer;
    font-family: var(--mono); transition: all 0.2s;
}

.tr-btn:hover { border-color: var(--accent); color: var(--accent); }

.tr-btn.active {
    background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600;
}

/* ===== TWO COL ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ===== NET POSITION ===== */
.np-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.np-row:last-child { border-bottom: none; }
.np-label { width: 50px; font-weight: 700; font-size: 13px; font-family: var(--mono); }
.np-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; position: relative; overflow: hidden; }
.np-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.np-long { background: var(--green); }
.np-short { background: var(--red); }
.np-zero { position: absolute; top: 0; left: 50%; width: 1px; height: 100%; background: rgba(255,255,255,0.2); }
.np-value { width: 55px; text-align: right; font-size: 11px; font-weight: 600; font-family: var(--mono); }

/* ===== GAUGES ===== */
.gauges-row { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.gauge { text-align: center; width: 100px; }
.gauge-svg { width: 100px; height: 55px; }
.gauge-fill { transition: stroke-dasharray 1s ease; }
.gauge-value { font-size: 16px; font-weight: 700; font-family: var(--mono); margin-top: -6px; }
.gauge-label { font-size: 10px; color: var(--text3); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; }

.trades-table { width: 100%; border-collapse: collapse; font-size: 12px; }

.trades-table th {
    text-align: left; padding: 10px 10px; color: var(--text3);
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border); font-weight: 600;
}

.trades-table td {
    padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}

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

/* ===== STRATEGY DETAIL ===== */
.strat-hero {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; margin-bottom: 16px; backdrop-filter: blur(12px);
}

.sh-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.sh-top h1 { font-size: 22px; font-weight: 700; }
.sh-position { font-size: 14px; color: var(--text2); }

.strat-description { line-height: 1.8; }
.strat-description p { font-size: 14px; color: var(--text2); margin-bottom: 16px; line-height: 1.8; }

.strat-details {
    display: flex; flex-direction: column; gap: 10px; font-size: 13px;
    color: var(--text2); margin-bottom: 16px;
    padding: 16px; background: rgba(0,0,0,0.2); border-radius: 8px;
}

.strat-details strong { color: var(--text); }

.strat-indicators { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.params-table { display: flex; flex-direction: column; }

.param-row {
    display: flex; justify-content: space-between; padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 13px;
}

.param-row:last-child { border-bottom: none; }
.param-row span:first-child { color: var(--text2); }
.param-row span:last-child { font-weight: 600; }

/* ===== TOAST ===== */
#toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 200;
    display: flex; flex-direction: column; gap: 8px;
}

.toast {
    background: var(--card); border: 1px solid var(--border); border-radius: 8px;
    padding: 12px 16px; min-width: 260px; display: flex; gap: 12px; align-items: center;
    backdrop-filter: blur(12px); box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: slideIn 0.3s ease;
}

.toast-profit { border-left: 3px solid var(--green); }
.toast-loss { border-left: 3px solid var(--red); }
.toast-icon { font-size: 16px; font-weight: 700; font-family: var(--mono); }
.toast-body { font-size: 12px; line-height: 1.4; }
.toast-body strong { display: block; margin-bottom: 2px; }
.toast-out { animation: slideOut 0.4s ease forwards; }

/* ===== ANIMATIONS ===== */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

#app > section { animation: fadeIn 0.25s ease; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .strategy-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    #topbar { padding: 0 12px; gap: 8px; font-size: 12px; }
    .logo { font-size: 13px; }
    #total-equity { font-size: 15px; }
    #nav { padding: 4px 12px; }
    #app { padding: 0 12px 40px; }
    .strategy-grid { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .kpi-card { min-width: 110px; padding: 12px; }
    .kpi-value { font-size: 17px; }
    .sc-equity { font-size: 18px; }
    .sh-top h1 { font-size: 18px; }
    .login-card { margin: 16px; padding: 32px 24px; }
}
