/* ═══════════════════════════════════════
   Memecoin Screener v3.3 — Complete Styles
   ═══════════════════════════════════════ */

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

:root {
    --bg-primary: #0b0e11;
    --bg-secondary: #111518;
    --bg-row-hover: #1a1e24;
    --bg-header: #0d1014;
    --text-primary: #e1e3e6;
    --text-secondary: #8b8d93;
    --text-muted: #5c5e64;
    --green: #2ed573;
    --green-dim: #1e3a2f;
    --red: #ff4757;
    --red-dim: #3a1e1e;
    --yellow: #ffc312;
    --gold: #f0a500;
    --border: #1c2028;
    --accent-blue: #3b82f6;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    overflow-x: auto;
}

/* Top Bar */
.topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.topbar .logo {
    font-weight: 700; font-size: 18px; color: #fff;
    margin-right: 12px; display: flex; align-items: center; gap: 6px;
}
.topbar .logo span { color: var(--green); }

/* View Switcher */
.view-switcher {
    display: flex; gap: 4px; background: var(--bg-primary);
    border-radius: 10px; padding: 3px; border: 1px solid var(--border);
}
.view-btn {
    padding: 8px 18px; border-radius: 8px; border: none;
    background: transparent; color: var(--text-secondary);
    cursor: pointer; font-size: 13px; font-weight: 600;
    transition: all .2s; white-space: nowrap;
}
.view-btn:hover { color: #fff; background: #1a1e24; }
.view-btn.active[data-view="traders"] {
    background: linear-gradient(135deg, #f0a500, #ff6b00);
    color: #000; font-weight: 700; box-shadow: 0 0 12px rgba(240, 165, 0, 0.3);
}
.view-btn.active[data-view="tokens"] {
    background: var(--green); color: #000; font-weight: 700;
    box-shadow: 0 0 12px rgba(46, 213, 115, 0.2);
}

/* ═══════════════════════════════════════
   Investor Guide Toggle & Panel
   ═══════════════════════════════════════ */
.guide-toggle-btn {
    padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-primary); color: var(--text-secondary);
    cursor: pointer; font-size: 12px; font-weight: 600;
    transition: all .2s; white-space: nowrap;
}
.guide-toggle-btn:hover { background: #1e2330; color: #fff; border-color: var(--accent-blue); }
.guide-toggle-btn.active {
    background: #1e2a3a; color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.guide-panel {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
}
.guide-panel.open { max-height: 300px; }

.guide-content {
    display: flex; gap: 24px; padding: 12px 16px;
    flex-wrap: wrap;
}
.guide-section { min-width: 200px; flex: 1; }
.guide-title {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-muted); margin-bottom: 6px;
}
.guide-items { display: flex; flex-direction: column; gap: 4px; }
.guide-item { display: flex; align-items: center; gap: 8px; }
.guide-item .inv-badge { min-width: 28px; text-align: center; flex-shrink: 0; }
.guide-item .inv-score-cell { min-width: 36px; text-align: center; flex-shrink: 0; }
.guide-label { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
.guide-label strong { color: var(--text-primary); }

/* Sub-filters */
.subfilters {
    display: flex; gap: 6px; padding: 8px 16px;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
}
.filter-btn {
    padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-primary); color: var(--text-secondary);
    cursor: pointer; font-size: 11px; transition: all .15s;
}
.filter-btn:hover { background: #1e2330; color: #fff; }
.filter-btn.active { border-color: var(--green); color: var(--green); background: var(--green-dim); }

.search-box {
    margin-left: auto; padding: 6px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg-primary);
    color: var(--text-primary); width: 260px; font-size: 12px; outline: none;
}
.search-box::placeholder { color: var(--text-muted); }
.search-box:focus { border-color: var(--accent-blue); }

.stats-bar { display: flex; gap: 8px; }
.stat-item {
    font-size: 11px; color: var(--text-muted); padding: 4px 8px;
    background: var(--bg-primary); border-radius: 4px; border: 1px solid var(--border);
}

/* Behavior dropdown */
.behavior-dropdown {
    padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-primary); color: var(--text-secondary);
    cursor: pointer; font-size: 11px; outline: none;
}
.behavior-dropdown:focus { border-color: var(--accent-blue); }
.behavior-dropdown option { background: var(--bg-secondary); color: var(--text-primary); }
.behavior-dropdown optgroup { color: var(--text-muted); font-style: normal; }

/* Table */
.table-container { overflow-x: auto; }
table { width: 100%; min-width: 1200px; border-collapse: collapse; }
thead th {
    position: sticky; top: 0; background: var(--bg-header);
    padding: 10px 12px; text-align: right; font-weight: 600;
    font-size: 11px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: .5px; border-bottom: 1px solid var(--border);
    white-space: nowrap; cursor: pointer; user-select: none;
}
thead th:first-child { text-align: left; padding-left: 16px; }
thead th:hover { color: var(--text-secondary); }
tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; cursor: pointer; }
tbody tr:hover { background: var(--bg-row-hover); }
td { padding: 12px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td:first-child { text-align: left; padding-left: 16px; }

/* Token Cell */
.token-cell { display: flex; align-items: center; gap: 10px; }
.token-rank { color: var(--text-muted); font-size: 11px; min-width: 24px; }
.token-icon {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #2a2d35, #1a1d25);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0; overflow: hidden;
}
.token-icon img { width: 100%; height: 100%; object-fit: cover; }
.token-info { display: flex; flex-direction: column; gap: 1px; }
.token-name { font-weight: 600; font-size: 13px; color: #fff; }
.token-chain { font-size: 11px; color: var(--text-muted); }
.badge { padding: 1px 5px; border-radius: 3px; font-size: 10px; font-weight: 600; }
.badge-amm { background: var(--green-dim); color: var(--green); }

/* Trader Cell */
.trader-cell { display: flex; align-items: center; gap: 10px; }
.trader-rank { font-size: 13px; font-weight: 700; min-width: 28px; text-align: center; }
.trader-rank.gold { color: #f0a500; }
.trader-rank.silver { color: #c0c0c0; }
.trader-rank.bronze { color: #cd7f32; }
.trader-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.trader-avatar.top1 { background: linear-gradient(135deg, #f0a500, #ff6b00); }
.trader-avatar.top2 { background: linear-gradient(135deg, #8a8a8a, #c0c0c0); }
.trader-avatar.top3 { background: linear-gradient(135deg, #8b4513, #cd7f32); }
.trader-avatar.normal { background: linear-gradient(135deg, #2a2d35, #1a1d25); }
.trader-info { display: flex; flex-direction: column; gap: 1px; }
.trader-address { font-weight: 600; font-size: 13px; color: #fff; font-family: monospace; }
.trader-tags { font-size: 11px; color: var(--text-muted); }
.tag {
    padding: 1px 6px; border-radius: 3px; font-size: 9px;
    font-weight: 700; text-transform: uppercase; margin-right: 4px;
}
.tag-whale { background: #1e2a3a; color: #60a5fa; }
.tag-bot { background: #3a1e3a; color: #c084fc; }
.tag-insider { background: #3a2e1e; color: var(--yellow); }

/* Values */
.price { color: var(--text-primary); font-weight: 500; }
.age { color: var(--text-secondary); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral { color: var(--text-muted); }
.pnl-positive { color: var(--green); font-weight: 600; }
.pnl-negative { color: var(--red); font-weight: 600; }
.pnl-big { padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.pnl-big.positive { background: var(--green-dim); color: var(--green); }
.pnl-big.negative { background: var(--red-dim); color: var(--red); }

/* Win Rate Bar */
.winrate-container { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.winrate-bar { width: 50px; height: 6px; background: #1c2028; border-radius: 3px; overflow: hidden; }
.winrate-fill { height: 100%; border-radius: 3px; transition: width .3s; }
.winrate-high { background: var(--green); }
.winrate-mid { background: var(--yellow); }
.winrate-low { background: var(--red); }

/* Status Bar */
.status-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; background: var(--bg-secondary);
    border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted);
}
.status-dot {
    display: inline-block; width: 6px; height: 6px;
    border-radius: 50%; background: var(--yellow); margin-right: 6px;
}
.status-dot.connected { background: var(--green); }
.status-dot.error { background: var(--red); }

/* ═══════════════════════════════════════
   Investor Classification Styles
   ═══════════════════════════════════════ */

.investors-cell {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 2px; min-width: 80px;
}
.inv-count { font-weight: 700; font-size: 13px; color: var(--text-primary); }
.inv-badges { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.inv-badge {
    padding: 1px 4px; border-radius: 3px; font-size: 9px;
    font-weight: 700; white-space: nowrap;
}
.inv-elite { background: #1a3a1e; color: #2ed573; }
.inv-profitable { background: #1e2a3a; color: #60a5fa; }
.inv-regular { background: #2a2d35; color: #8b8d93; }
.inv-bot-profit { background: #3a2e1e; color: #ffc312; }
.inv-bot { background: #3a1e3a; color: #c084fc; }
.inv-casual { background: #1c2028; color: #5c5e64; }
.inv-losing { background: #3a1e1e; color: #ff4757; }

.inv-bar {
    width: 50px; height: 4px; background: #3a1e3a;
    border-radius: 2px; overflow: hidden;
}
.inv-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.inv-quality-high .inv-bar-fill { background: var(--green); }
.inv-quality-mid .inv-bar-fill { background: var(--yellow); }
.inv-quality-low .inv-bar-fill { background: var(--red); }

.inv-score {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 16px; padding: 0 4px; border-radius: 8px;
    font-size: 9px; font-weight: 700;
    background: linear-gradient(135deg, #f0a500, #ff6b00);
    color: #000; margin-left: 4px;
}

.inv-score-cell {
    font-weight: 700; font-size: 13px; padding: 2px 8px;
    border-radius: 6px; display: inline-block;
}
.inv-score-high { background: var(--green-dim); color: var(--green); }
.inv-score-mid { background: #2a2d1e; color: var(--yellow); }
.inv-score-low { background: var(--red-dim); color: var(--red); }

.tag.inv-elite { background: #1a3a1e; color: #2ed573; border: 1px solid #2ed57340; }
.tag.inv-profitable { background: #1e2a3a; color: #60a5fa; border: 1px solid #60a5fa40; }
.tag.inv-regular { background: #2a2d35; color: #e1e3e6; }
.tag.inv-bot-profit { background: #3a2e1e; color: #ffc312; border: 1px solid #ffc31240; }
.tag.inv-bot { background: #3a1e3a; color: #c084fc; border: 1px solid #c084fc40; }
.tag.inv-casual { background: #1c2028; color: #5c5e64; }
.tag.inv-losing { background: #3a1e1e; color: #ff4757; border: 1px solid #ff475740; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #2a2d35; border-radius: 3px; }

@media (max-width: 768px) {
    .topbar { padding: 8px; }
    .search-box { width: 150px; }
    .stats-bar { display: none; }
    td, th { padding: 8px 6px; font-size: 11px; }
    .guide-content { flex-direction: column; gap: 12px; }
}
