/* ========================================
   Whale Alert AI - Main Stylesheet
   Dark Trading Terminal Theme
   ======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2332;
    --bg-card: #151d2c;
    --bg-hover: #1e2a3d;
    
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    
    --very-high: #ef4444;
    --very-high-bg: rgba(239, 68, 68, 0.15);
    --high: #f59e0b;
    --high-bg: rgba(245, 158, 11, 0.15);
    --medium: #3b82f6;
    --medium-bg: rgba(59, 130, 246, 0.15);
    
    /* Chain colors */
    --eth-color: #627eea;
    --bsc-color: #f3ba2f;
    --ton-color: #0098ea;
    --sol-color: #9945ff;
    --arb-color: #28a0f0;
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bg-tertiary);
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 2px;
}

/* Navigation */
.nav-menu {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--accent-primary), #6366f1);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.sound-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
}

.sound-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sound-btn.active {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.sound-btn.muted {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.main-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--danger);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.quick-stats {
    display: flex;
    gap: 24px;
}

.quick-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.quick-stat .stat-value {
    font-size: 18px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.quick-stat .stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #6366f1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--bg-hover);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-light);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-hover);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon.paused {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

/* Content Sections */
.content-section {
    display: none;
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.content-section.active {
    display: block;
}

/* ========================================
   Stats Cards
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--bg-tertiary);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card.very-high .stat-card-icon {
    background: var(--very-high-bg);
    color: var(--very-high);
}

.stat-card.high .stat-card-icon {
    background: var(--high-bg);
    color: var(--high);
}

.stat-card.medium .stat-card-icon {
    background: var(--medium-bg);
    color: var(--medium);
}

.stat-card.chains .stat-card-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stat-card-content {
    display: flex;
    flex-direction: column;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========================================
   Dashboard Grid
   ======================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    height: calc(100vh - var(--header-height) - 180px);
}

.right-panels {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Panels */
.panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel.full-width {
    width: 100%;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.panel-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h2 i {
    color: var(--accent-primary);
}

.panel-filters {
    display: flex;
    gap: 8px;
}

.filter-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-hover);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Live Feed Panel */
.live-feed-panel {
    flex: 1;
    min-height: 0;
}

.live-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 4px;
}

.empty-state span {
    font-size: 13px;
    opacity: 0.7;
}

/* Alert Card */
.alert-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--bg-tertiary);
    padding: 16px;
    transition: all var(--transition-fast);
    cursor: pointer;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.alert-card.very-high {
    border-left: 4px solid var(--very-high);
}

.alert-card.high {
    border-left: 4px solid var(--high);
}

.alert-card.medium {
    border-left: 4px solid var(--medium);
}

.alert-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.alert-level-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alert-level-badge.very-high {
    background: var(--very-high-bg);
    color: var(--very-high);
}

.alert-level-badge.high {
    background: var(--high-bg);
    color: var(--high);
}

.alert-level-badge.medium {
    background: var(--medium-bg);
    color: var(--medium);
}

.alert-time {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.source-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.chain-badge.binance {
    background: rgba(243, 186, 47, 0.2);
    color: #f3ba2f;
}

.chain-badge.forex {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.alert-card-body {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.alert-token-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.token-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--accent-primary);
}

.token-details {
    display: flex;
    flex-direction: column;
}

.token-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.token-chain {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chain-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.chain-badge.eth { background: rgba(98, 126, 234, 0.2); color: var(--eth-color); }
.chain-badge.bsc { background: rgba(243, 186, 47, 0.2); color: var(--bsc-color); }
.chain-badge.ton { background: rgba(0, 152, 234, 0.2); color: var(--ton-color); }
.chain-badge.sol { background: rgba(153, 69, 255, 0.2); color: var(--sol-color); }
.chain-badge.arb { background: rgba(40, 160, 240, 0.2); color: var(--arb-color); }

.alert-stats {
    display: flex;
    gap: 20px;
    flex: 1;
    justify-content: flex-end;
}

.alert-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.alert-stat-value {
    font-size: 16px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.alert-stat-value.positive { color: var(--success); }
.alert-stat-value.negative { color: var(--danger); }

.alert-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.alert-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

.alert-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--bg-tertiary);
}

.alert-address {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-actions {
    display: flex;
    gap: 8px;
}

.alert-action-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.alert-action-btn.track {
    background: var(--accent-primary);
    color: white;
}

.alert-action-btn.track:hover {
    background: var(--accent-secondary);
}

.alert-action-btn.copy {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.alert-action-btn.copy:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ========================================
   Whale Monitor
   ======================================== */
.whale-monitor {
    flex: 1;
}

.whale-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.whale-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.whale-entry:hover {
    background: var(--bg-hover);
}

.whale-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.whale-info {
    flex: 1;
}

.whale-address {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-primary);
}

.whale-activity {
    font-size: 11px;
    color: var(--text-muted);
}

.whale-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.whale-status.accumulating {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.whale-status.preparing {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.whale-status.active {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.whale-volume {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
}

.top-whale {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

.top-whale-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.top-whale:nth-child(1) .top-whale-rank {
    background: linear-gradient(135deg, #ffd700, #ffb800);
    color: #1a1a2e;
}

.top-whale:nth-child(2) .top-whale-rank {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #1a1a2e;
}

.top-whale:nth-child(3) .top-whale-rank {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #1a1a2e;
}

.top-whale.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.top-whale.clickable:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.whale-action {
    color: var(--text-muted);
    font-size: 12px;
}

.top-whale.clickable:hover .whale-action {
    color: var(--accent-primary);
}

/* Whale Details Modal */
.whale-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.whale-details-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--bg-tertiary);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.whale-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bg-tertiary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
}

.whale-details-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.whale-details-title .whale-icon {
    font-size: 32px;
}

.whale-details-title h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.whale-address-full {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.whale-details-header .close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.whale-details-header .close-btn:hover {
    background: var(--danger);
    color: white;
}

.whale-details-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bg-tertiary);
}

.whale-stat {
    text-align: center;
}

.whale-stat .stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}

.whale-stat .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.whale-details-actions {
    padding: 20px 24px;
}

.whale-details-actions h4 {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.whale-actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.whale-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

.whale-action-item .action-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    min-width: 70px;
}

.whale-action-item .action-token {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.whale-action-item .action-volume {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
}

.whale-action-item .action-level {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.whale-action-item .action-level.very_high {
    background: var(--very-high-bg);
    color: var(--very-high);
}

.whale-action-item .action-level.high {
    background: var(--high-bg);
    color: var(--high);
}

.whale-action-item .action-level.medium {
    background: var(--medium-bg);
    color: var(--medium);
}

.whale-details-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--bg-tertiary);
}

.whale-details-footer .btn {
    flex: 1;
}

/* ========================================
   Top Tokens
   ======================================== */
.tokens-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.token-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.token-entry:hover {
    background: var(--bg-hover);
}

.token-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.token-rank.top-3 {
    background: linear-gradient(135deg, var(--warning), #f59e0b);
    color: white;
}

.token-entry-info {
    flex: 1;
}

.token-entry-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.token-entry-chain {
    font-size: 11px;
    color: var(--text-muted);
}

.token-entry-stats {
    text-align: right;
}

.token-entry-volume {
    font-size: 13px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--success);
}

.token-entry-alerts {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========================================
   Connection Panel
   ======================================== */
.connection-panel .panel-body {
    padding: 12px;
}

.connection-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.connection-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.connection-icon.binance {
    background: rgba(243, 186, 47, 0.15);
    color: #f3ba2f;
}

.connection-icon.detector {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.connection-icon.forex {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.connection-icon.oanda {
    background: rgba(0, 131, 213, 0.15);
    color: #0083d5;
}

.connection-icon.security {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.connection-item.security-status {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.security-active {
    color: var(--success) !important;
    font-weight: 600;
}

.connection-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.connection-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.connection-status-text {
    font-size: 10px;
    color: var(--text-muted);
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.connection-dot.connected {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.connection-dot.disconnected {
    background: var(--danger);
}

.connection-dot.connecting {
    background: var(--warning);
    animation: pulse 1s infinite;
}

/* ========================================
   Forex Calendar Panel
   ======================================== */
.forex-panel .panel-body {
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.forex-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forex-event {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--text-muted);
    transition: all var(--transition-fast);
}

.forex-event.high-impact {
    border-left-color: var(--danger);
}

.forex-event.medium-impact {
    border-left-color: var(--warning);
}

.forex-event.imminent {
    background: rgba(239, 68, 68, 0.1);
    animation: imminentPulse 2s infinite;
}

@keyframes imminentPulse {
    0%, 100% { background: rgba(239, 68, 68, 0.1); }
    50% { background: rgba(239, 68, 68, 0.2); }
}

.forex-event-time {
    min-width: 50px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

.forex-event-info {
    flex: 1;
}

.forex-event-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.forex-event-currency {
    font-size: 10px;
    color: var(--text-muted);
}

.forex-event-impact {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.forex-event-impact.high {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.forex-event-impact.medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* Forex Event Details Button */
.forex-event-details-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.forex-event-details-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

.forex-event-details-btn i {
    font-size: 11px;
}

.forex-event {
    cursor: pointer;
}

.forex-event:hover {
    background: var(--bg-tertiary);
}

/* Forex Modal Styles */
.forex-modal .alert-modal-header.high-impact {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
}

.forex-modal .alert-modal-header.medium-impact {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
}

.forex-modal .alert-modal-header.low-impact {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
}

.impact-high {
    color: var(--danger);
}

.impact-medium {
    color: var(--warning);
}

.impact-low {
    color: var(--success);
}

.empty-state.small {
    padding: 20px;
}

.empty-state.small i {
    font-size: 24px;
}

.empty-state.small p {
    font-size: 12px;
}

/* ========================================
   Live Prices Panel
   ======================================== */
.prices-panel .panel-body {
    padding: 12px;
    max-height: 180px;
    overflow-y: auto;
}

.prices-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.price-symbol {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.price-value {
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

.price-value.up {
    color: var(--success);
}

.price-value.down {
    color: var(--danger);
}

/* ========================================
   Alert Modal
   ======================================== */
.alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.alert-modal.hidden {
    display: none;
}

.alert-modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 520px;
    border: 1px solid var(--bg-tertiary);
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.alert-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-modal-content.very-high .alert-modal-header {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), transparent);
}

.alert-modal-content.high .alert-modal-header {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), transparent);
}

.alert-modal-content.medium .alert-modal-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), transparent);
}

.alert-level {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.alert-modal-content.very-high .alert-icon {
    background: var(--very-high-bg);
    color: var(--very-high);
    animation: alertPulse 1s infinite;
}

.alert-modal-content.high .alert-icon {
    background: var(--high-bg);
    color: var(--high);
}

.alert-modal-content.medium .alert-icon {
    background: var(--medium-bg);
    color: var(--medium);
}

@keyframes alertPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.alert-level-text {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.alert-modal-content.very-high .alert-level-text { color: var(--very-high); }
.alert-modal-content.high .alert-level-text { color: var(--high); }
.alert-modal-content.medium .alert-level-text { color: var(--medium); }

.alert-confidence {
    font-size: 24px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.alert-modal-content.very-high .alert-confidence { color: var(--very-high); }
.alert-modal-content.high .alert-confidence { color: var(--high); }
.alert-modal-content.medium .alert-confidence { color: var(--medium); }

.alert-modal-body {
    padding: 24px;
}

.alert-token {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.alert-token .token-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-tertiary);
}

.alert-token .token-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.alert-token .token-chain {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.alert-modal-body .alert-message {
    margin-bottom: 20px;
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    line-height: 1.6;
}

.alert-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-label {
    width: 80px;
    font-size: 13px;
    color: var(--text-muted);
}

.detail-value {
    flex: 1;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.copy-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--accent-primary);
    color: white;
}

.alert-modal-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--bg-tertiary);
    display: flex;
    gap: 12px;
}

.alert-modal-actions .btn {
    flex: 1;
}

/* ========================================
   API Settings
   ======================================== */
.setting-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-hover);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
}

.setting-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.setting-input::placeholder {
    color: var(--text-muted);
}

.api-status {
    padding: 10px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
}

.api-status.connected {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.api-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* ========================================
   Neural Network Panel
   ======================================== */
.nn-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.nn-stat {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nn-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nn-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.nn-stat-value.ready {
    color: var(--success);
}

.nn-stat-value.training {
    color: var(--warning);
}

.nn-progress {
    margin-bottom: 10px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========================================
   History Section
   ======================================== */
.panel-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-hover);
    border-radius: var(--border-radius-sm);
    padding: 8px 14px;
    color: var(--text-primary);
    font-size: 13px;
    width: 250px;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--bg-tertiary);
}

.history-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
}

.history-table tr:hover {
    background: var(--bg-hover);
}

.history-table td {
    font-size: 13px;
    color: var(--text-primary);
}

.history-level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.history-level.very-high { background: var(--very-high-bg); color: var(--very-high); }
.history-level.high { background: var(--high-bg); color: var(--high); }
.history-level.medium { background: var(--medium-bg); color: var(--medium); }

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--bg-tertiary);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.page-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ========================================
   Settings Section
   ======================================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.settings-panel .panel-body {
    padding: 20px;
}

.setting-group {
    margin-bottom: 24px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-value {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
    font-weight: 600;
}

.setting-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

.setting-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Sound Settings */
.sound-settings {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sound-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.sound-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sound-level {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.sound-level.very-high { background: var(--very-high-bg); color: var(--very-high); }
.sound-level.high { background: var(--high-bg); color: var(--high); }
.sound-level.medium { background: var(--medium-bg); color: var(--medium); }

.sound-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-hover);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

/* Chains Settings */
.chains-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chain-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chain-toggle:hover {
    background: var(--bg-hover);
}

.chain-toggle input {
    display: none;
}

.chain-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.chain-icon.eth { background: var(--eth-color); }
.chain-icon.bsc { background: var(--bsc-color); }
.chain-icon.ton { background: var(--ton-color); }
.chain-icon.sol { background: var(--sol-color); }
.chain-icon.arb { background: var(--arb-color); }

.chain-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.chain-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.chain-toggle input:checked ~ .chain-status {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* DEX Settings */
.dex-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dex-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dex-toggle:hover {
    background: var(--bg-hover);
}

.dex-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.dex-name {
    font-size: 14px;
    color: var(--text-primary);
}

/* ========================================
   Statistics Section
   ======================================== */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.chart-panel .panel-body {
    padding: 20px;
    height: 350px;
}

.stats-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.top-whales-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-whale {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.top-whale-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warning), #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.top-whale-info {
    flex: 1;
}

.top-whale-address {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-primary);
}

.top-whale-trades {
    font-size: 11px;
    color: var(--text-muted);
}

.top-whale-volume {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
}

/* Accuracy Stats */
.accuracy-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px;
}

.accuracy-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.accuracy-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.accuracy-circle.very-high {
    background: var(--very-high-bg);
    color: var(--very-high);
    border: 3px solid var(--very-high);
}

.accuracy-circle.high {
    background: var(--high-bg);
    color: var(--high);
    border: 3px solid var(--high);
}

.accuracy-circle.medium {
    background: var(--medium-bg);
    color: var(--medium);
    border: 3px solid var(--medium);
}

.accuracy-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .right-panels {
        flex-direction: row;
    }
    
    .right-panels .panel {
        flex: 1;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    
    .logo-text,
    .nav-item span,
    .status-text {
        display: none;
    }
    
    .logo {
        justify-content: center;
    }
    
    .nav-item {
        justify-content: center;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-overview,
    .stats-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-right .quick-stats {
        display: none;
    }
    
    .panel-filters {
        flex-wrap: wrap;
    }
    
    .alert-modal-content {
        margin: 20px;
    }
}

/* ========================================
   Backtesting Section
   ======================================== */
.backtest-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.backtest-controls-panel .panel-body {
    padding: 24px;
}

.backtest-config {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.config-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.config-group {
    flex: 1;
    min-width: 140px;
}

.config-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-hover);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
}

.config-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.backtest-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

.speed-control label {
    font-size: 12px;
    color: var(--text-muted);
}

.speed-control input[type="range"] {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-hover);
    border-radius: 2px;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

#btSpeedValue {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 600;
    min-width: 40px;
}

.backtest-progress {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

.backtest-progress .progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

#btProgressText {
    color: var(--text-secondary);
}

#btProgressPercent {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
    font-weight: 600;
}

.backtest-progress .progress-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
}

.backtest-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #8b5cf6);
    border-radius: 4px;
    transition: width 0.2s ease;
}

/* Backtest Results Grid */
.backtest-results-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.backtest-metrics-panel .panel-body {
    padding: 20px;
}

.bt-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.bt-metric {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.bt-metric-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.bt-metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.bt-metric-value.highlight {
    color: var(--success);
}

.bt-metric-value.negative {
    color: var(--danger);
}

/* Accuracy Levels */
.bt-accuracy-levels {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bt-accuracy-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bt-accuracy-bar {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.bt-accuracy-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.bt-accuracy-item.very-high .bt-accuracy-fill {
    background: linear-gradient(90deg, var(--very-high), #f87171);
}

.bt-accuracy-item.high .bt-accuracy-fill {
    background: linear-gradient(90deg, var(--high), #fbbf24);
}

.bt-accuracy-item.medium .bt-accuracy-fill {
    background: linear-gradient(90deg, var(--medium), #60a5fa);
}

.bt-accuracy-label {
    width: 70px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.bt-accuracy-value {
    width: 50px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* Backtest Chart Panel */
.backtest-chart-panel .panel-body {
    padding: 20px;
    height: 300px;
}

/* Backtest Log Panel */
.backtest-log-panel .panel-body {
    padding: 0;
}

.bt-signals-table-container {
    max-height: 400px;
    overflow-y: auto;
}

.bt-signals-table {
    width: 100%;
    border-collapse: collapse;
}

.bt-signals-table th,
.bt-signals-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--bg-tertiary);
}

.bt-signals-table th {
    background: var(--bg-tertiary);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.bt-signals-table td {
    font-size: 13px;
    color: var(--text-primary);
}

.bt-signals-table tbody tr:hover {
    background: var(--bg-hover);
}

.bt-signals-table .empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.bt-signals-table .level-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.bt-signals-table .level-badge.very-high {
    background: var(--very-high-bg);
    color: var(--very-high);
}

.bt-signals-table .level-badge.high {
    background: var(--high-bg);
    color: var(--high);
}

.bt-signals-table .level-badge.medium {
    background: var(--medium-bg);
    color: var(--medium);
}

.bt-signals-table .profit {
    color: var(--success);
    font-weight: 600;
}

.bt-signals-table .loss {
    color: var(--danger);
    font-weight: 600;
}

.bt-signals-table .latency {
    font-family: 'JetBrains Mono', monospace;
}

.bt-signals-table .latency.fast {
    color: var(--success);
}

.bt-signals-table .latency.slow {
    color: var(--danger);
}

/* Responsive Backtest */
@media (max-width: 1200px) {
    .backtest-results-grid {
        grid-template-columns: 1fr;
    }
    
    .bt-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .config-row {
        flex-direction: column;
    }
    
    .config-group {
        min-width: 100%;
    }
    
    .backtest-actions {
        flex-direction: column;
    }
    
    .speed-control {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .bt-metrics-grid {
        grid-template-columns: 1fr;
    }
}
