/* ========================================
   AI Signal Bot - Styles
   Dark Trading Theme
   ======================================== */

/* --- CSS Variables / Design Tokens --- */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-tertiary: #1a1a3e;
    --bg-card: #16163a;
    --bg-hover: #1e1e4a;
    --bg-input: #0e0e28;

    --text-primary: #f0f0f8;
    --text-secondary: #8888b8;
    --text-muted: #55557a;

    --accent-green: #00f260;
    --accent-green-dim: #00c04d;
    --accent-red: #ff3366;
    --accent-red-dim: #cc2952;
    --accent-blue: #0575e6;
    --accent-blue-dim: #0458b3;
    --accent-purple: #7c3aed;
    --accent-yellow: #fbbf24;
    --accent-cyan: #22d3ee;

    --border-color: #1e1e4a;
    --border-light: #2a2a5a;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow-green: 0 0 20px rgba(0, 242, 96, 0.15);
    --shadow-glow-red: 0 0 20px rgba(255, 51, 102, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Animated background grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 242, 96, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 96, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    display: flex;
    align-items: center;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.nav-title h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-stats {
    display: flex;
    gap: 28px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value.profit {
    color: var(--accent-green);
}

.stat-value.loss {
    color: var(--accent-red);
}

/* --- Container --- */
.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Control Panel --- */
.control-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    transition: border-color var(--transition-normal);
}

.control-panel:hover {
    border-color: var(--border-light);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 12px rgba(0, 242, 96, 0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--text-muted);
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(0, 242, 96, 0.3); }
    50% { box-shadow: 0 0 18px rgba(0, 242, 96, 0.6); }
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Timeframe Buttons */
.tf-selector {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tf-btn {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tf-btn.active {
    background: rgba(0, 242, 96, 0.12);
    border-color: var(--accent-green);
    color: var(--accent-green);
    box-shadow: var(--shadow-glow-green);
}

/* Symbol Buttons */
.symbol-selector {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.symbol-btn {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.symbol-btn.active {
    background: rgba(5, 117, 230, 0.12);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Risk Slider */
.risk-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.risk-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.risk-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-green);
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0, 242, 96, 0.3);
    transition: all var(--transition-fast);
}

.risk-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(0, 242, 96, 0.5);
}

.risk-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-green);
    min-width: 36px;
    text-align: right;
}

/* TradingView Price Widget */
.tv-price-group {
    min-width: 280px;
}

.tv-price-widget {
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.tv-price-widget iframe {
    border: none !important;
}

/* TradingView Chart Section */
.tv-chart-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    min-height: 480px;
    transition: border-color var(--transition-normal);
}

.tv-chart-section:hover {
    border-color: var(--border-light);
}

.tv-chart-widget {
    flex: 1;
    min-height: 420px;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.tv-chart-widget iframe {
    border: none !important;
}

.tv-powered {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Trading Mode Selector */
.mode-selector {
    display: flex;
    gap: 4px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px 10px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 60px;
}

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

.mode-btn.active {
    border-color: var(--border-light);
}

.mode-btn.scalping.active {
    background: rgba(0, 242, 96, 0.12);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.mode-btn.daytrade.active {
    background: rgba(5, 117, 230, 0.12);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.mode-btn.swing.active {
    background: rgba(123, 58, 237, 0.12);
    border-color: var(--accent-purple);
    color: #b07cff;
}

.mode-emoji {
    font-size: 16px;
    line-height: 1;
}

.mode-name {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mode-lao {
    font-size: 8px;
    opacity: 0.6;
    font-weight: 500;
}

/* Direction Buttons */
.direction-selector {
    display: flex;
    gap: 4px;
}

.direction-btn {
    padding: 6px 16px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.direction-btn.active {
    background: rgba(5, 117, 230, 0.12);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.direction-btn.long {
    color: var(--accent-green);
}
.direction-btn.long.active {
    background: rgba(0, 242, 96, 0.12);
    border-color: var(--accent-green);
    color: var(--accent-green);
}
.direction-btn.short {
    color: var(--accent-red);
}
.direction-btn.short.active {
    background: rgba(255, 51, 102, 0.12);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* --- Bot Actions --- */
.bot-actions {
    display: flex;
    gap: 12px;
}

.btn-start {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-green-dim));
    border: none;
    border-radius: var(--radius-md);
    color: #000;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-glow-green);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 242, 96, 0.3);
}

.btn-start:active {
    transform: translateY(0);
}

.btn-start.running {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-red-dim));
    box-shadow: var(--shadow-glow-red);
    animation: btnPulse 2s ease-in-out infinite;
}

.btn-start.running:hover {
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.3);
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 51, 102, 0.2); }
    50% { box-shadow: 0 0 25px rgba(255, 51, 102, 0.4); }
}

.btn-start .btn-icon {
    display: flex;
    align-items: center;
    transition: transform var(--transition-normal);
}

.btn-start.running .btn-icon {
    transform: rotate(90deg);
}

@keyframes btnFlash {
    0% { box-shadow: 0 0 0 0 rgba(0, 242, 96, 0.4); }
    50% { box-shadow: 0 0 30px 10px rgba(0, 242, 96, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(0, 242, 96, 0); }
}

.btn-clear {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* --- Bot Status Bar --- */
.bot-status-bar {
    margin-top: 16px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-family: var(--font-mono);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--transition-normal);
}

.status-indicator.running {
    background: var(--accent-green);
    box-shadow: 0 0 12px rgba(0, 242, 96, 0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

.status-right {
    color: var(--text-muted);
}

/* --- Signals Section --- */
.signals-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.section-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.signal-filters {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.filter-btn {
    padding: 5px 14px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.filter-btn.active {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.signal-count {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* --- Signals Container --- */
.signals-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    text-align: center;
}

.empty-state .empty-icon {
    opacity: 0.5;
    margin-bottom: 8px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 600;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 320px;
}

.empty-state strong {
    color: var(--accent-green);
}

/* --- Signal Card --- */
.signal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    transition: all var(--transition-normal);
    animation: slideIn 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.signal-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
}

.signal-card.long::before {
    background: var(--accent-green);
    box-shadow: 0 0 12px rgba(0, 242, 96, 0.3);
}

.signal-card.short::before {
    background: var(--accent-red);
    box-shadow: 0 0 12px rgba(255, 51, 102, 0.3);
}

.signal-card:hover {
    border-color: var(--border-light);
    transform: translateX(4px);
}

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

/* New signal flash */
.signal-card.new-signal {
    animation: flashNew 1.2s ease-out;
}

@keyframes flashNew {
    0% {
        background: rgba(0, 242, 96, 0.08);
        border-color: var(--accent-green);
    }
    100% {
        background: var(--bg-card);
        border-color: var(--border-color);
    }
}

.signal-card.short.new-signal {
    animation-name: flashNewShort;
}

@keyframes flashNewShort {
    0% {
        background: rgba(255, 51, 102, 0.08);
        border-color: var(--accent-red);
    }
    100% {
        background: var(--bg-card);
        border-color: var(--border-color);
    }
}

/* Signal Order Section (Direction + Order Type) */
.signal-order-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Signal Direction Badge */
.signal-direction {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
}

.signal-card.long .signal-direction {
    background: rgba(0, 242, 96, 0.1);
    color: var(--accent-green);
}

.signal-card.short .signal-direction {
    background: rgba(255, 51, 102, 0.1);
    color: var(--accent-red);
}

.signal-direction small {
    font-size: 9px;
    opacity: 0.7;
    font-weight: 500;
}

/* Order Type Badge */
.order-type-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    width: 100%;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.order-type-badge:hover {
    transform: scale(1.05);
}

.order-emoji {
    font-size: 16px;
    line-height: 1;
}

.order-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.order-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.order-lao {
    font-size: 9px;
    opacity: 0.7;
    font-weight: 500;
}

/* Market (Execute Now) */
.order-type-badge.market {
    background: rgba(0, 242, 96, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

/* Buy Limit */
.order-type-badge.buy_limit {
    background: rgba(34, 211, 238, 0.12);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Buy Stop */
.order-type-badge.buy_stop {
    background: rgba(123, 58, 237, 0.12);
    border-color: var(--accent-purple);
    color: #b07cff;
}

/* Sell Limit */
.order-type-badge.sell_limit {
    background: rgba(251, 191, 36, 0.12);
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

/* Sell Stop */
.order-type-badge.sell_stop {
    background: rgba(255, 51, 102, 0.15);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Signal Info */
.signal-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.signal-symbol {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.signal-details {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-value.tp {
    color: var(--accent-green);
}

.detail-value.sl {
    color: var(--accent-red);
}

.detail-value.entry {
    color: var(--accent-cyan);
}

.detail-analysis {
    width: 100%;
    margin-top: 2px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
}

.detail-value.analysis-note {
    color: var(--text-secondary);
    font-size: 10px;
    font-style: italic;
}

.detail-item.detail-analysis {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

/* Direction Forecast */
.detail-item.signal-forecast {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
}

.detail-value.direction-forecast {
    font-size: 10px;
    color: var(--accent-cyan);
    font-weight: 600;
    letter-spacing: 0.2px;
    font-style: normal;
}

/* Directional Bias Meter */
.signal-bias-meter-wrapper {
    width: 100% !important;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.bias-meter-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bias-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bias-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
}

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

.bias-value.bullish {
    color: var(--accent-green);
}

.bias-value.bearish {
    color: var(--accent-red);
}

.bias-meter-track {
    position: relative;
    width: 100%;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* Background gradient (red → gray → green) */
.bias-meter-track::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(255, 51, 102, 0.08),
        rgba(255, 51, 102, 0.02) 40%,
        transparent 45%,
        transparent 55%,
        rgba(0, 242, 96, 0.02) 60%,
        rgba(0, 242, 96, 0.08)
    );
    pointer-events: none;
}

.bias-meter-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 10px;
    transition: all var(--transition-normal);
    pointer-events: none;
}

.bias-meter-needle {
    position: absolute;
    top: -2px;
    width: 4px;
    height: 24px;
    background: var(--text-primary);
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(240, 240, 248, 0.4);
    transition: left var(--transition-normal);
    z-index: 2;
}

.bias-meter-needle::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(240, 240, 248, 0.5);
}

.bias-meter-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
    margin-top: 2px;
}

.bias-meter-label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    opacity: 0.5;
}

.bias-meter-label.bearish {
    color: var(--accent-red);
}

.bias-meter-label.neutral {
    color: var(--text-muted);
}

.bias-meter-label.bullish {
    color: var(--accent-green);
}

/* Signal Meta (Right side) */
.signal-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.signal-mode-badge {
    font-size: 14px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}

.signal-mode-badge.scalping {
    background: rgba(0, 242, 96, 0.1);
}

.signal-mode-badge.day_trade {
    background: rgba(5, 117, 230, 0.1);
}

.signal-mode-badge.swing {
    background: rgba(123, 58, 237, 0.1);
}

.signal-timeframe {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.signal-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.signal-closed-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
}

.signal-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signal-status.active {
    background: rgba(0, 242, 96, 0.1);
    color: var(--accent-green);
}

.signal-status.tp-hit {
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent-cyan);
}

.signal-status.sl-hit {
    background: rgba(255, 51, 102, 0.1);
    color: var(--accent-red);
}

/* --- Performance Section --- */
.performance-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
}

.performance-section h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.perf-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.perf-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all var(--transition-fast);
}

.perf-card:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.perf-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
}

.perf-value {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.perf-value.profit {
    color: var(--accent-green);
}

.perf-value.loss {
    color: var(--accent-red);
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    z-index: 200;
    pointer-events: none;
}

.toast {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease-out;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast-out {
    animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

.toast.toast-success {
    border-left: 3px solid var(--accent-green);
}

.toast.toast-error {
    border-left: 3px solid var(--accent-red);
}

.toast.toast-info {
    border-left: 3px solid var(--accent-blue);
}

/* --- Responsive Design --- */
@media (max-width: 1200px) {
    .perf-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .controls-grid {
        grid-template-columns: 1fr 1fr;
    }

    .nav-stats {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .panel-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .signal-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .signal-meta {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .perf-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bot-actions {
        flex-direction: column;
    }

    .btn-start {
        justify-content: center;
    }

    .navbar {
        padding: 0 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .signal-filters {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .perf-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tf-selector, .symbol-selector {
        justify-content: center;
    }
}
