/* ═══════════════════════════════════════════════════════════════════
   SENTINEL NODE — Tab Navigation, Sentinel Feed, Wallet
   Appended to existing style.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tab Navigation ─────────────────────────────────────────────── */
.tab-nav {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.3);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}
.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}
.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}
.tab-btn.active {
    color: var(--cyber-blue);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}
.tab-btn svg {
    opacity: 0.7;
}
.tab-btn.active svg {
    opacity: 1;
    stroke: var(--cyber-blue);
}
.tab-badge {
    background: var(--neon-green);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}
.mode-badge {
    background: rgba(255, 171, 64, 0.15);
    color: #ffab40;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid rgba(255, 171, 64, 0.3);
    margin-left: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Tab Content ────────────────────────────────────────────────── */
.tab-content {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 1.25rem;
}
.tab-content.active {
    display: flex;
}

/* ── Pair Change Badge ──────────────────────────────────────────── */
.pair-change {
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 2px;
}

/* ── Sentinel Layout ────────────────────────────────────────────── */
.sentinel-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
}

.sentinel-header {
    padding: 1.25rem;
}
.sentinel-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.sentinel-controls h2 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 1.1rem;
}
.scanner-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}
.status-dot.online {
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    animation: pulse 2s infinite;
}
.status-dot.offline {
    background: var(--neon-red);
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cyber-button.small {
    padding: 6px 14px;
    font-size: 0.75rem;
    margin-top: 0;
}

.sentinel-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.stat-card {
    text-align: center;
    padding: 0.75rem;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--cyber-blue);
}
.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ── Grade Filter ───────────────────────────────────────────────── */
.grade-filter {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
}
.grade-btn {
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}
.grade-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-main);
}
.grade-btn.active {
    color: var(--cyber-blue);
    border-color: var(--cyber-blue);
    background: rgba(0, 212, 255, 0.1);
}
.grade-btn.grade-a { color: var(--neon-green); }
.grade-btn.grade-a.active { border-color: var(--neon-green); background: rgba(0, 230, 118, 0.1); }
.grade-btn.grade-b { color: #4caf50; }
.grade-btn.grade-c { color: #ffab40; }
.grade-btn.grade-d { color: #ff9800; }
.grade-btn.grade-f { color: var(--neon-red); }
.grade-btn.grade-f.active { border-color: var(--neon-red); background: rgba(255, 51, 102, 0.1); }

/* ── Token Feed ─────────────────────────────────────────────────── */
.token-feed {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.token-feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-muted);
    text-align: center;
    flex: 1;
}
.token-card {
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.25s;
    animation: fadeSlideIn 0.3s ease forwards;
}
.token-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    transform: translateX(3px);
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.token-main {
    display: flex;
    align-items: center;
    gap: 10px;
}
.token-chain {
    font-size: 1.4rem;
    width: 32px;
    text-align: center;
}
.token-info {
    flex: 1;
}
.token-symbol {
    font-weight: 700;
    font-size: 1.05rem;
}
.token-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.token-grade {
    font-size: 1.2rem;
    font-weight: 800;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid;
}
.token-grade.grade-a {
    color: var(--neon-green);
    border-color: var(--neon-green);
    background: rgba(0, 230, 118, 0.1);
    text-shadow: 0 0 8px var(--neon-green);
}
.token-grade.grade-b { color: #4caf50; border-color: #4caf50; background: rgba(76,175,80,0.1); }
.token-grade.grade-c { color: #ffab40; border-color: #ffab40; background: rgba(255,171,64,0.1); }
.token-grade.grade-d { color: #ff9800; border-color: #ff9800; background: rgba(255,152,0,0.1); }
.token-grade.grade-f { color: var(--neon-red); border-color: var(--neon-red); background: rgba(255,51,102,0.1); }

.token-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.token-score {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.token-score .score-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}
.token-score span {
    position: absolute;
    right: 0;
    top: -14px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-main);
}
.token-buy-btn {
    margin-top: 8px;
    padding: 5px 12px;
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--neon-green);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}
.token-buy-btn:hover {
    background: rgba(0, 230, 118, 0.2);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
}
.vetoed-tag {
    font-size: 0.75rem;
    color: var(--neon-red);
    font-weight: 600;
}

/* ── Wallet Layout ──────────────────────────────────────────────── */
.wallet-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
}
.wallet-balance {
    padding: 1.25rem;
}
.wallet-balance h2 {
    margin-bottom: 1rem;
}
.balance-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.balance-card {
    text-align: center;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
}
.balance-chain {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.balance-amount {
    font-size: 1.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.wallet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.wallet-deposit, .wallet-withdraw {
    padding: 1.25rem;
}
.wallet-deposit h3, .wallet-withdraw h3 {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.chain-selector select,
.wallet-withdraw select,
.wallet-withdraw input[type="text"],
.wallet-withdraw input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}
.chain-selector select:focus,
.wallet-withdraw select:focus,
.wallet-withdraw input:focus {
    border-color: var(--cyber-blue);
    outline: none;
}

.deposit-address {
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    margin: 0.75rem 0;
    word-break: break-all;
}
.deposit-address code {
    font-size: 0.8rem;
    color: var(--cyber-blue);
    user-select: all;
}

.withdraw-status {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    padding: 8px;
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    min-height: 1.5em;
}

.trade-summary {
    padding: 1.25rem;
}
.trade-summary h3 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.summary-item {
    text-align: center;
    padding: 0.75rem;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}
.summary-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--cyber-blue);
    font-variant-numeric: tabular-nums;
}
.summary-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .tab-nav {
        flex-wrap: wrap;
    }
    .tab-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    .sentinel-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .balance-cards {
        grid-template-columns: 1fr;
    }
    .wallet-actions {
        grid-template-columns: 1fr;
    }
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Fix for main UI layout to allow scrolling */
.right-panel {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    max-height: 100%;
}
.right-panel::-webkit-scrollbar {
    width: 6px;
}
.right-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

/* ── Bot Dashboard Row (Launcher + Active Sims) ─────────────────── */
.bot-dashboard-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    width: 100%;
}

.strategy-launcher {
    flex: 1 1 300px;
    min-width: 300px;
}

.active-simulations-panel {
    flex: 2 1 400px;
    min-width: 300px;
}

/* ── Order Book ─────────────────────────────────────────────────── */
.order-book-container {
    margin-top: 20px;
    font-family: monospace;
    font-size: 0.9em;
}

.order-book {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
}

.ob-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 5px;
}

.ob-row.ask .price { color: #ff4d4d; }
.ob-row.bid .price { color: #00ffcc; }
.ob-row .size { color: rgba(255,255,255,0.7); }

.spread {
    text-align: center;
    padding: 5px 0;
    margin: 5px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #888;
    font-size: 0.85em;
}

/* ── Live Trades Controls ───────────────────────────────────────── */
.live-trades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.trades-controls {
    display: flex;
    gap: 10px;
}

.cyber-select.small {
    padding: 5px;
    font-size: 0.85em;
    height: auto;
}

/* ── Sortable Drag Area ─────────────────────────────────────────── */
.sortable-ghost {
    opacity: 0.4;
}
.drag-item {
    cursor: grab;
}
.drag-item:active {
    cursor: grabbing;
}

/* ── Strategy & Simulations (Legacy) ───────────────────────── */
.cyber-select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}
.cyber-select:focus {
    border-color: var(--cyber-blue);
    outline: none;
}

.estimate-panel {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.estimate-panel .neon-text {
    font-weight: 700;
    color: var(--neon-green);
    margin-left: 5px;
}

.active-simulations-container {
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 15px;
}
.active-simulations-container h3 {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 10px;
}
#active-simulations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.empty-sims {
    text-align: center;
    padding: 15px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
}
.sim-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sim-info {
    flex: 1;
}
.sim-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--cyber-blue);
}
.sim-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.sim-status.running {
    color: var(--neon-green);
}
.sim-actions .stop-btn {
    background: transparent;
    border: 1px solid rgba(255, 51, 102, 0.5);
    color: var(--neon-red);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}
.sim-actions .stop-btn:hover {
    background: rgba(255, 51, 102, 0.1);
}
