/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-primary: #0b0e11; --bg-secondary: #1e2329; --bg-tertiary: #2b3139;
    --bg-card: #181a20; --bg-hover: #2b3139;
    --text-primary: #eaecef; --text-secondary: #848e9c; --text-muted: #5e6673;
    --green: #0ecb81; --green-dim: rgba(14,203,129,0.1); --green-glow: rgba(14,203,129,0.3);
    --red: #f6465d; --red-dim: rgba(246,70,93,0.1); --red-glow: rgba(246,70,93,0.3);
    --yellow: #f0b90b; --yellow-dim: rgba(240,185,11,0.15); --yellow-glow: rgba(240,185,11,0.4);
    --blue: #1e90ff; --purple: #a855f7;
    --border: #2b3139; --border-light: #363c45;
    --radius: 8px; --radius-lg: 12px;
    --font: 'Inter', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}
html { font-size: 14px; }
body {
    font-family: var(--font); background: var(--bg-primary); color: var(--text-primary);
    min-height: 100vh; overflow-x: hidden;
}
h1,h2,h3 { font-weight: 600; }
a { color: var(--yellow); text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); color: var(--text-primary); }
input { font-family: var(--mono); background: none; border: none; color: var(--text-primary); outline: none; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }

/* === TOP NAV === */
.top-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; height: 52px;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 24px; color: var(--yellow); filter: drop-shadow(0 0 8px var(--yellow-glow)); }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
.logo-pro { color: var(--yellow); font-size: 11px; font-weight: 800; background: var(--yellow-dim); padding: 2px 5px; border-radius: 4px; margin-left: 4px; vertical-align: super; }
.nav-links { display: flex; gap: 4px; }
.nav-link { padding: 6px 14px; border-radius: 6px; font-weight: 500; color: var(--text-secondary); transition: all .2s; font-size: 13px; }
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active { color: var(--yellow); background: var(--yellow-dim); }

.market-ticker { display: flex; gap: 20px; }
.ticker-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ticker-symbol { color: var(--text-secondary); font-weight: 500; }
.ticker-price { font-family: var(--mono); font-weight: 600; }
.ticker-change { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.ticker-change.positive { background: var(--green-dim); }
.ticker-change.negative { background: var(--red-dim); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn-notification { position: relative; font-size: 16px; padding: 6px; }
.notif-badge { position: absolute; top: 0; right: 0; background: var(--red); color: #fff; font-size: 9px; width: 14px; height: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--yellow), #ff8c00); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #000; }

/* === NOTIFICATION CENTER === */
.notif-dropdown {
    position: absolute;
    top: 42px;
    right: 0;
    width: 330px;
    background: rgba(24, 28, 37, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: top right;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.notif-dropdown.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}
.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}
.notif-dropdown-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.btn-text-action {
    background: none;
    border: none;
    color: var(--yellow);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}
.btn-text-action:hover {
    background: var(--yellow-dim);
    text-decoration: none;
}
.notif-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}
.notif-dropdown-list::-webkit-scrollbar {
    width: 4px;
}
.notif-dropdown-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.15s;
}
.notif-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
.notif-item.unread {
    background: rgba(240, 185, 11, 0.04);
    border-left: 3px solid var(--yellow);
}
.notif-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
.notif-badge-dot.success { background: var(--green); }
.notif-badge-dot.warning { background: var(--yellow); }
.notif-badge-dot.danger { background: var(--red); }
.notif-badge-dot.info { background: #3b82f6; }

.notif-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.notif-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.notif-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.notif-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--mono);
}
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--text-muted);
    text-align: center;
    gap: 8px;
}
.notif-empty-icon {
    font-size: 24px;
    opacity: 0.5;
}
.notif-empty-text {
    font-size: 11px;
}

/* === MAIN LAYOUT === */
.main-content {
    display: grid; grid-template-columns: 1fr minmax(320px, 380px) minmax(280px, 320px);
    height: calc(100vh - 52px); overflow: hidden;
}
.left-panel { display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow-y: auto; overflow-x: hidden; }
.center-panel { display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow-y: auto; overflow-x: hidden; padding: 12px; gap: 12px; }
.right-panel { display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; }

/* === PAIR HEADER === */
.pair-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; flex-shrink: 0; }
.pair-info { display: flex; align-items: center; gap: 12px; }
.pair-icon { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #f7931a, #ff6b00); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.pair-details { display: flex; flex-direction: column; }
.pair-name { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.pair-fullname { font-size: 11px; color: var(--text-muted); }
.current-price { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--green); }
.price-change { font-family: var(--mono); font-size: 12px; display: block; }
.pair-stats { display: flex; gap: 20px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-family: var(--mono); font-size: 13px; font-weight: 500; }

/* === CHART === */
.chart-section { flex: 1; display: flex; flex-direction: column; min-height: 350px; position: relative; }
.chart-toolbar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; flex-shrink: 0; }
.timeframes, .chart-types, .chart-indicators { display: flex; gap: 2px; }
.tf-btn, .ct-btn, .ind-btn { padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; color: var(--text-secondary); transition: all .2s; }
.tf-btn:hover, .ct-btn:hover, .ind-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.tf-btn.active { background: var(--yellow-dim); color: var(--yellow); }
.ct-btn.active { background: var(--bg-tertiary); }
.ind-btn.active { background: var(--blue); color: #fff; font-size: 11px; border-radius: 10px; padding: 3px 8px; }
.main-chart { flex: 1; width: 100%; display: block; }
.volume-chart { height: 60px; width: 100%; border-top: 1px solid var(--border); display: block; flex-shrink: 0; }

/* === TRADE FORM === */
.trade-form-section { border-top: 1px solid var(--border); padding: 12px 16px; flex-shrink: 0; background: var(--bg-main); z-index: 5; }
.trade-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.trade-tab { flex: 1; padding: 8px; border-radius: var(--radius); font-weight: 600; font-size: 13px; transition: all .2s; }
.trade-tab[data-side="buy"] { background: var(--green-dim); color: var(--green); }
.trade-tab[data-side="buy"].active { background: var(--green); color: #fff; box-shadow: 0 0 20px var(--green-glow); }
.trade-tab[data-side="sell"] { background: var(--red-dim); color: var(--red); }
.trade-tab[data-side="sell"].active { background: var(--red); color: #fff; box-shadow: 0 0 20px var(--red-glow); }
.trade-type-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.type-tab { padding: 4px 12px; font-size: 12px; color: var(--text-secondary); border-radius: 4px; }
.type-tab.active { background: var(--bg-tertiary); color: var(--text-primary); }
.form-group { margin-bottom: 8px; }
.form-group label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; display: block; }
.input-wrap { display: flex; align-items: center; background: var(--bg-tertiary); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.input-wrap:focus-within { border-color: var(--yellow); }
.form-input { flex: 1; padding: 8px 12px; font-size: 14px; text-align: center; }
.input-btn { padding: 8px 12px; color: var(--text-secondary); font-size: 16px; transition: color .2s; }
.input-btn:hover { color: var(--yellow); }
.amount-slider { margin: 12px 0; }
.slider-track { height: 4px; background: var(--bg-tertiary); border-radius: 2px; position: relative; }
.slider-fill { height: 100%; background: var(--yellow); border-radius: 2px; }
.slider-thumb { width: 14px; height: 14px; background: var(--yellow); border-radius: 50%; position: absolute; top: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 8px var(--yellow-glow); }
.slider-labels { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: var(--text-muted); }
.form-summary { padding: 8px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.summary-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.btn-trade { width: 100%; padding: 12px; border-radius: var(--radius); font-weight: 700; font-size: 15px; margin-top: 8px; transition: all .3s; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-trade.buy { background: var(--green); color: #fff; }
.btn-trade.buy:hover { box-shadow: 0 0 30px var(--green-glow); transform: translateY(-1px); }
.btn-trade.sell { background: var(--red); color: #fff; }
.btn-trade.sell:hover { box-shadow: 0 0 30px var(--red-glow); transform: translateY(-1px); }

/* === PANEL HEADERS === */
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-header h2 { font-size: 14px; font-weight: 600; }
.badge-glow { font-size: 10px; padding: 3px 8px; border-radius: 10px; background: linear-gradient(135deg, var(--purple), var(--blue)); color: #fff; font-weight: 600; animation: pulse-glow 2s infinite; }
@keyframes pulse-glow { 0%,100% { box-shadow: 0 0 5px rgba(168,85,247,0.3); } 50% { box-shadow: 0 0 15px rgba(168,85,247,0.6); } }

/* === TRADE SETUPS === */
.trade-setups { display: flex; flex-direction: column; gap: 10px; }
.setup-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 14px; transition: all .3s; position: relative; overflow: hidden;
}
.setup-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--green), var(--yellow));
}
.setup-card:hover { border-color: var(--yellow); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.setup-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.setup-pair { display: flex; align-items: center; gap: 8px; }
.setup-pair-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.setup-pair-name { font-weight: 700; font-size: 15px; }
.setup-signal { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.setup-signal.long { background: var(--green-dim); color: var(--green); }
.setup-signal.short { background: var(--red-dim); color: var(--red); }
.setup-winrate { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.winrate-bar { flex: 1; height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; }
.winrate-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--green), var(--yellow)); transition: width 1s ease; }
.winrate-label { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--green); min-width: 42px; text-align: right; }
.setup-levels { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 10px; }
.setup-level { background: var(--bg-secondary); padding: 8px; border-radius: 6px; text-align: center; }
.setup-level .level-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.setup-level .level-value { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.setup-level .level-value.entry { color: var(--yellow); }
.setup-level .level-value.target { color: var(--green); }
.setup-level .level-value.stop { color: var(--red); }
.setup-targets { display: flex; flex-direction: column; gap: 4px; }
.target-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.target-label { color: var(--text-secondary); }
.target-value { font-family: var(--mono); font-weight: 600; }
.target-gain { font-family: var(--mono); font-weight: 700; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.target-gain.positive { background: var(--green-dim); }
.setup-meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.meta-tag { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--bg-tertiary); color: var(--text-secondary); }

/* === ORDER BOOK === */
.order-book { flex: 1; display: flex; flex-direction: column; padding: 12px; border-bottom: 1px solid var(--border); }
.ob-controls { display: flex; gap: 2px; }
.ob-btn { padding: 3px 8px; border-radius: 4px; font-size: 12px; color: var(--text-secondary); }
.ob-btn.active { background: var(--bg-tertiary); color: var(--text-primary); }
.ob-header { display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: 10px; color: var(--text-muted); padding: 4px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.ob-asks, .ob-bids { display: flex; flex-direction: column; }
.ob-asks { flex-direction: column-reverse; }
.ob-row { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 2px 0; font-family: var(--mono); font-size: 12px; position: relative; transition: background .15s; }
.ob-row:hover { background: var(--bg-hover); }
.ob-row .depth-bar { position: absolute; right: 0; top: 0; bottom: 0; opacity: 0.08; }
.ob-row.ask .depth-bar { background: var(--red); }
.ob-row.bid .depth-bar { background: var(--green); }
.ob-row.ask .ob-price { color: var(--red); }
.ob-row.bid .ob-price { color: var(--green); }
.ob-spread { text-align: center; padding: 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 4px 0; }
.spread-price { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--green); display: block; }
.spread-label { font-size: 10px; color: var(--text-muted); }

/* === RECENT TRADES === */
.recent-trades-section { margin-top: auto; }
.trade-filter-tabs { display: flex; gap: 4px; }
.filter-tab { font-size: 11px; padding: 3px 8px; border-radius: 4px; color: var(--text-secondary); }
.filter-tab.active { background: var(--bg-tertiary); color: var(--text-primary); }
.recent-trades-table { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; }
.table-header { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 8px 12px; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.table-body { max-height: 180px; overflow-y: auto; }
.trade-row { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 4px 12px; font-family: var(--mono); font-size: 12px; transition: background .15s; }
.trade-row:hover { background: var(--bg-hover); }
.trade-row .trade-time { color: var(--text-muted); }

/* === PORTFOLIO === */
.portfolio-section { padding: 12px; }
.portfolio-summary { background: linear-gradient(135deg, rgba(240,185,11,0.05), rgba(168,85,247,0.05)); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; }
.port-total { text-align: center; margin-bottom: 8px; }
.port-label { font-size: 11px; color: var(--text-muted); display: block; }
.port-value { font-family: var(--mono); font-size: 24px; font-weight: 800; display: block; margin: 4px 0; background: linear-gradient(135deg, var(--yellow), #ff8c00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.port-change { font-family: var(--mono); font-size: 12px; }
.port-chart-mini { margin-top: 8px; }
.portfolio-holdings { display: flex; flex-direction: column; gap: 6px; }
.holding-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); transition: all .2s; }
.holding-row:hover { border-color: var(--border-light); }
.holding-left { display: flex; align-items: center; gap: 8px; }
.holding-icon { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.holding-name { font-weight: 600; font-size: 13px; }
.holding-amount { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.holding-right { text-align: right; }
.holding-value { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.holding-pnl { font-family: var(--mono); font-size: 11px; }

/* === TOAST === */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius); font-size: 13px; font-weight: 500; animation: slide-in .3s ease; backdrop-filter: blur(10px); border: 1px solid; }
.toast.success { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.toast.error { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.toast.info { background: var(--yellow-dim); border-color: var(--yellow); color: var(--yellow); }
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === DISCLAIMER === */
.disclaimer-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: linear-gradient(90deg, rgba(246,70,93,0.15), rgba(240,185,11,0.15));
    backdrop-filter: blur(10px); border-top: 1px solid var(--red);
    padding: 8px 20px; display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; color: var(--text-secondary);
}
.disclaimer-banner.hidden { display: none; }
.dismiss-btn { color: var(--text-secondary); font-size: 16px; padding: 4px 8px; }

/* === AI ANALYSIS PANEL === */
.ai-analysis-panel {
    padding: 16px; border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(43,49,57,0.8), rgba(24,26,32,0.9)); 
    border: 1px solid var(--border-light);
    position: relative; transition: all .3s ease;
    flex-shrink: 0; margin-bottom: 16px; z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden;
}
.ai-analysis-panel::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--purple), var(--blue), var(--green));
    background-size: 200% 100%; animation: gradient-shift 3s linear infinite;
}
@keyframes gradient-shift { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }
.ai-analysis-panel.loading { opacity: 0.7; }
.ai-analysis-panel.loading .ai-body { opacity: 0.3; filter: blur(2px); }
.ai-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.ai-bot-controls { display: flex; align-items: center; gap: 12px; }

/* Bot Toggle Switch */
.bot-toggle {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1); transition: all 0.3s;
}
.bot-toggle:hover { background: rgba(255,255,255,0.1); }
.bot-toggle input { display: none; }
.bot-slider {
    width: 32px; height: 16px; background: #444; border-radius: 10px;
    position: relative; transition: .4s;
}
.bot-slider:before {
    content: ""; position: absolute; height: 12px; width: 12px;
    left: 2px; bottom: 2px; background: white; transition: .4s; border-radius: 50%;
}
.bot-toggle input:checked + .bot-slider { background: var(--purple); box-shadow: 0 0 10px rgba(160, 32, 240, 0.5); }
.bot-toggle input:checked + .bot-slider:before { transform: translateX(16px); }
.bot-label { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--text-muted); }
.bot-toggle input:checked ~ .bot-label { color: var(--purple); animation: bot-pulse 2s infinite; }

@keyframes bot-pulse {
    100% { opacity: 1; text-shadow: 0 0 5px rgba(160, 32, 240, 0.5); }
}

/* Simplified Toggle Switch for Modals */
.switch {
    position: relative; display: inline-block; width: 34px; height: 18px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #444; transition: .4s; border-radius: 20px;
}
.slider:before {
    position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--purple); }
input:checked + .slider:before { transform: translateX(16px); }

.ai-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 11px; flex-shrink: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.ai-icon { font-size: 18px; }
.ai-tf-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; transition: all .3s; }
.ai-pair-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--yellow-dim); color: var(--yellow); font-weight: 700; }
.ai-tf-badge.updated { animation: badge-pop .4s ease; }
@keyframes badge-pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); background: var(--purple); } 100% { transform: scale(1); } }
.ai-signal {
    font-family: var(--mono); font-weight: 800; font-size: 11px; padding: 3px 10px;
    border-radius: 6px; letter-spacing: 0.5px; text-transform: uppercase; transition: all .4s ease;
    flex-shrink: 0;
}
.ai-signal.strong-buy, .ai-signal.buy { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }
.ai-signal.strong-sell, .ai-signal.sell { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); }
.ai-signal.neutral { background: var(--yellow-dim); color: var(--yellow); border: 1px solid var(--yellow); }
.ai-signal.analyzing { background: var(--bg-tertiary); color: var(--text-muted); border: 1px solid var(--border); animation: analyzing-pulse 1s infinite; }
@keyframes analyzing-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.ai-confidence-bar { height: 8px; background: var(--bg-tertiary); border-radius: 4px; position: relative; margin-bottom: 12px; overflow: visible; }
.ai-conf-fill { height: 100%; border-radius: 4px; transition: width 1.2s cubic-bezier(0.4,0,0.2,1), background .5s; }
.ai-conf-fill.high { background: linear-gradient(90deg, var(--green), #00ff88); box-shadow: 0 0 10px var(--green-glow); }
.ai-conf-fill.mid { background: linear-gradient(90deg, var(--yellow), #ffcc00); box-shadow: 0 0 10px var(--yellow-glow); }
.ai-conf-fill.low { background: linear-gradient(90deg, var(--red), #ff6b6b); box-shadow: 0 0 10px var(--red-glow); }
.ai-conf-label { position: absolute; right: 0; top: -18px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text-secondary); }
.ai-body { transition: opacity .3s ease, filter .3s ease; }
.ai-body.fade-in { animation: ai-fade-in .5s ease both; }
@keyframes ai-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.ai-verdict { font-size: 13px; color: #ffffff; margin-bottom: 6px; line-height: 1.4; font-weight: 500; }
.ai-action { font-size: 12px; color: var(--yellow); margin-bottom: 10px; padding: 8px 10px; background: rgba(240,185,11,0.1); border-radius: 6px; border-left: 3px solid var(--yellow); line-height: 1.4; }
.ai-action:empty { display: none; }
.ai-signals-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ai-signal-item { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.4; color: #d1d5db; animation: ai-fade-in .4s ease both; }
.ai-signal-item:nth-child(2) { animation-delay: .05s; }
.ai-signal-item:nth-child(3) { animation-delay: .1s; }
.ai-signal-item:nth-child(4) { animation-delay: .15s; }
.ai-signal-item:nth-child(5) { animation-delay: .2s; }
.ai-signal-item:nth-child(6) { animation-delay: .25s; }
.ai-signal-item:nth-child(7) { animation-delay: .3s; }
.ai-signal-item:nth-child(8) { animation-delay: .35s; }
.ai-signal-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.ai-signal-dot.bull { background: var(--green); box-shadow: 0 0 4px var(--green-glow); }
.ai-signal-dot.bear { background: var(--red); box-shadow: 0 0 4px var(--red-glow); }
.ai-signal-dot.neutral { background: var(--text-muted); }
.ai-indicators-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ai-ind-badge { font-family: var(--mono); font-size: 10px; padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); transition: all .3s; }
.ai-ind-badge .ind-label { color: #9ca3af; margin-right: 4px; }
.ai-ind-badge .ind-val { font-weight: 600; }
.ai-ind-badge .ind-val.positive { color: var(--green); }
.ai-ind-badge .ind-val.negative { color: var(--red); }
.ai-ind-badge .ind-val.neutral { color: var(--yellow); }

/* === WS STATUS === */
.ws-status { font-size: 10px; padding: 3px 10px; border-radius: 10px; font-weight: 700; letter-spacing: 0.5px; }
.ws-status.live { background: var(--green-dim); color: var(--green); animation: pulse-live 2s infinite; }
.ws-status.offline { background: var(--red-dim); color: var(--red); }
.ws-status.connecting { background: var(--yellow-dim); color: var(--yellow); }
@keyframes pulse-live { 0%,100% { box-shadow: 0 0 4px var(--green-glow); } 50% { box-shadow: 0 0 12px var(--green-glow); } }

/* === BTN ICON === */
.btn-icon { padding: 4px 8px; border-radius: 4px; color: var(--text-secondary); transition: all .2s; font-size: 16px; }
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

/* === ANIMATIONS === */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.setup-card { animation: fadeIn .4s ease both; }
.setup-card:nth-child(2) { animation-delay: .1s; }
.setup-card:nth-child(3) { animation-delay: .2s; }
.setup-card:nth-child(4) { animation-delay: .3s; }

/* === MODAL OVERLAY === */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 1000; display: flex; justify-content: center; align-items: center; transition: opacity .3s, visibility .3s; }
.modal-overlay.hidden { opacity: 0; visibility: hidden; }
.modal-content { background: var(--bg-main); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); transform: translateY(0); transition: transform .3s; padding: 24px; }
.modal-overlay.hidden .modal-content { transform: translateY(20px); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-header h2 { font-size: 18px; margin: 0; color: var(--text-primary); }
.modal-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.4; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-group input:focus { border-color: var(--yellow); outline: none; }

/* === BACKTEST BUTTON & MODAL === */
.btn-backtest {
    background: var(--bg-tertiary); border: 1px solid var(--border-light); color: var(--text-primary);
    padding: 6px 14px; border-radius: 4px; font-weight: 700; font-size: 11px; cursor: pointer; transition: all 0.3s;
}
.btn-backtest:hover { background: var(--blue); border-color: var(--blue); transform: translateY(-1px); }

.backtest-content { max-width: 800px; width: 90%; max-height: 90vh; overflow-y: auto; }
.backtest-config { background: var(--bg-secondary); padding: 16px; border-radius: var(--radius); margin-bottom: 20px; }
.config-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 13px; }

.results-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.res-card { background: var(--bg-card); padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); text-align: center; }
.res-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; }
.res-val { font-size: 20px; font-weight: 700; font-family: var(--mono); }

.results-table-container { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.results-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.results-table th { background: var(--bg-tertiary); color: var(--text-muted); font-weight: 600; text-align: left; padding: 12px 16px; }
.results-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.results-table tr:hover { background: rgba(255,255,255,0.02); }

.backtest-loader { text-align: center; padding: 40px; }
.progress-container { width: 100%; height: 8px; background: var(--bg-tertiary); border-radius: 4px; margin-top: 20px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--blue); width: 0%; transition: width 0.3s; }

.res-win { color: var(--green); font-weight: 700; }
.res-loss { color: var(--red); font-weight: 700; }
.res-manual { color: var(--blue); font-weight: 700; }

/* === BOT SETTINGS === */
.btn-bot-settings {
    background: none; border: none; font-size: 16px; cursor: pointer; padding: 4px; border-radius: 50%;
    transition: all 0.3s; opacity: 0.7;
}
.btn-bot-settings:hover { background: var(--bg-hover); opacity: 1; transform: rotate(45deg); }

.bot-status-bar {
    background: var(--bg-secondary); padding: 12px; border-radius: var(--radius);
    border: 1px solid var(--border); margin-bottom: 16px; text-align: center; font-size: 13px;
}
#bot-session-pnl.positive { color: var(--green); }
#bot-session-pnl.negative { color: var(--red); }
.form-group input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(240,185,11,0.1); }

/* Bot Pairs Selection */
.bot-pairs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bot-pair-check {
    display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-primary);
    background: var(--bg-tertiary); padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border);
    cursor: pointer; transition: all 0.2s;
}
.bot-pair-check:hover { border-color: var(--yellow); }
.bot-pair-check input { width: auto; margin: 0; }

/* === SMART MONEY CONCEPTS (SMC) OVERLAYS & LEGEND === */
.smc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-secondary);
}
.smc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.smc-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Premium / Discount Labels & Indicators */
.pd-label {
    font-size: 9px;
    font-family: var(--mono);
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.pd-premium {
    background: rgba(246, 70, 93, 0.15);
    color: var(--red);
    border: 1px solid rgba(246, 70, 93, 0.25);
}
.pd-discount {
    background: rgba(14, 203, 129, 0.15);
    color: var(--green);
    border: 1px solid rgba(14, 203, 129, 0.25);
}
.pd-equilibrium {
    color: var(--text-muted);
}

/* AI Signal & Checklist animations */
.ai-signal-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    margin-bottom: 6px;
    animation: slideIn 0.3s ease both;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.ai-signal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}
.ai-signal-dot.bull { background-color: var(--green); box-shadow: 0 0 6px var(--green-glow); }
.ai-signal-dot.bear { background-color: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.ai-signal-dot.neutral { background-color: var(--text-muted); }

/* Ticker changes pop animation */
.updated {
    animation: highlight-updated 0.6s ease;
}
@keyframes highlight-updated {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); background-color: var(--yellow-dim); color: var(--yellow); }
    100% { transform: scale(1); }
}

/* Dashboard chart badge overrides */
.tf-badge-live {
    font-family: var(--mono);
    font-weight: 700;
    color: var(--yellow);
    background: rgba(240, 185, 11, 0.1);
    border: 1px solid rgba(240, 185, 11, 0.2);
    border-radius: 3px;
    padding: 1px 4px;
}

