:root {
    /* Premium Dark Theme Colors */
    --bg-main: #0a0b10;
    --bg-secondary: #13151c;
    --bg-glass: rgba(19, 21, 28, 0.6);
    --bg-glass-hover: rgba(26, 30, 41, 0.8);

    --text-primary: #ebf0f8;
    --text-secondary: #8b94a5;
    --text-muted: #565e70;

    --accent-primary: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.4);

    --color-buy: #059669;
    --color-buy-glow: rgba(5, 150, 105, 0.3);
    --color-sell: #dc2626;
    --color-sell-glow: rgba(220, 38, 38, 0.3);

    --border-color: rgba(255, 255, 255, 0.05);

    --font-main: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);

    height: auto;
}

/* Background gradient effect */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.05), transparent 60%);
    z-index: -1;
    pointer-events: none;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), #60a5fa);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo-container h2 {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.logo-container span {
    color: var(--accent-primary);
}

.main-nav ul {
    list-style: none;
}

.main-nav li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.main-nav li a:hover,
.main-nav li.active a {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.main-nav li.active a {
    border-left-color: var(--accent-primary);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), transparent);
}

.connection-status {
    margin-top: auto;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--color-buy);
    box-shadow: 0 0 10px var(--color-buy);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 260px;
    /* Offset for the fixed sidebar */
    padding: 0.8rem 1rem;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pair-selector select {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    outline: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-glass);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.balance-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.balance-display .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-display .value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 0.6rem;
    grid-template-rows: auto 1fr auto;
    height: 100%;
}

/* Glass Card Global Styles */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.6rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.card-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Modules placement */
.market-overview {
    grid-column: 1 / span 3;
    grid-row: 1;
    padding: 0.2rem 0.6rem;
    min-height: 10em;
}

.ai-signal {
    grid-column: 4 / span 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    height: auto;
    /* Allow content to dictate height */
    min-height: 380px;
    /* Ensure enough space for all tools */
    overflow: hidden;
}

.signal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.chart-container {
    grid-column: 1 / span 3;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Force grid child to take 100% of grid slot */
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 10;
}

.chart-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    margin: 0;
    border-radius: 0;
    border: none;
    background: var(--bg-main);
}

.chart-container.fullscreen .tradingview-wrapper {
    height: calc(100vh - 50px) !important;
}

/* Chart Canvas Drawing Overlay */
.chart-canvas-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tradingview-wrapper {
    width: 100%;
    height: 100%;
}

.drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    cursor: crosshair;
}

.drawing-canvas.draw-mode {
    pointer-events: all;
}

.chart-container .card-header {
    flex-shrink: 0;
    /* Don't squash the header */
}

/* Chart Toolbar Buttons */
.chart-tools {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.tool-btn.active {
    background: rgba(37, 99, 235, 0.2);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.tool-btn.draw-tool.active-draw {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.tool-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.2rem;
}

/* Drawing Tool Active HUD */
.drawing-tool-hud {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.hud-hint {
    font-weight: 400;
    opacity: 0.7;
}

.trade-logs {
    grid-column: 1 / span 1;
    grid-row: 3;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.profit-calculator {
    grid-column: 4 / span 1;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.patterns-dashboard {
    grid-column: 2 / span 2;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-settings {
    grid-column: 4 / span 1;
    grid-row: 1;
    /* Moved up */
    display: flex;
    flex-direction: column;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-row {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
}

.setting-info h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.setting-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.threshold-value {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Custom Toggle Switch */
.switch {
    display: flex;
    position: absolute;
    right: 1rem;
    top: 1.2rem;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--color-buy);
}

input:checked+.slider:before {
    transform: translateX(20px);
    background-color: white;
}

/* Custom Range Slider */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin-top: 0.5rem;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
}

.knowledge-badge {
    background: rgba(37, 99, 235, 0.2);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.calculator-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-top: 0.4rem;
}

.input-grid-calc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.input-group-calc {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.input-group-calc label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.input-group-calc input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.input-group-calc input:focus {
    border-color: var(--accent-primary);
}

.results-table {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.2rem;
}

.table-header {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    padding: 0 0.6rem;
    margin-bottom: 0.2rem;
}

.table-header span {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
}

.result-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border: 1px solid transparent;
}

.result-row.highlight {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.2);
}

.profit-target {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.price-target {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-buy);
}

.calc-note {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: auto;
}

#calc-entry-price {
    font-weight: 700;
    color: var(--text-primary);
}

/* Market Stats Layout */
.market-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.2rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-box .label {
    font-size: 0.65rem;
    /* Tiny label */
    color: var(--text-secondary);
}

.stat-box .value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    /* Smaller value */
    font-weight: 700;
}

.stat-box .value.positive {
    color: var(--color-buy);
}

.stat-box .value.negative {
    color: var(--color-sell);
}

.stat-box .time-label {
    font-size: 0.6rem;
    color: var(--accent-primary);
    font-family: var(--font-mono);
    margin-top: -2px;
}

.stat-box .time-label.skeleton {
    color: transparent;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    display: inline-block;
    width: 60%;
    height: 10px;
}

/* AI Signal Module */
.ai-pulse {
    width: 12px;
    height: 12px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 1);
    transform: scale(1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

/* Compact AI Signal Styles */
.compact-signal .signal-main {
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.compact-signal .signal-badge {
    font-size: 1.2rem;
    padding: 0.3rem 0.8rem;
}

.compact-signal .circular-chart {
    max-width: 40px;
    max-height: 40px;
}

.compact-signal .ai-insight {
    padding: 0.4rem;
    margin-bottom: 0.4rem;
}

.compact-signal .ai-insight p {
    font-size: 0.75rem;
    display: block;
    overflow: visible;
}

.compact-signal .timeframe-signals {
    display: grid;
    margin-bottom: 0.5rem;
}

.compact-signal .action-buttons {
    display: block;
    margin-top: auto;
}

.signal-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.signal-badge {
    font-size: 2rem;
    font-weight: 800;
    padding: 0.5rem 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.signal-badge.buy {
    color: var(--color-buy);
    background: var(--color-buy-glow);
    border-color: var(--color-buy);
    box-shadow: 0 0 20px var(--color-buy-glow);
}

.signal-badge.sell {
    color: var(--color-sell);
    background: var(--color-sell-glow);
    border-color: var(--color-sell);
    box-shadow: 0 0 20px var(--color-sell-glow);
}

.confidence-meter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.confidence-meter span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Circular Chart SVG */
.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 60px;
    max-height: 60px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 3.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out;
}

.circular-chart.green .circle {
    stroke: var(--color-buy);
}

.circular-chart.red .circle {
    stroke: var(--color-sell);
}

.circular-chart.blue .circle {
    stroke: var(--accent-primary);
}

.percentage {
    fill: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.5em;
    text-anchor: middle;
    font-weight: bold;
}

.ai-insight {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.6rem;
    border-radius: 8px;
    margin-bottom: 0.6rem;
    flex: 1;
}

.ai-insight p {
    font-size: 0.85rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.sentiment {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* Multi-Timeframe Signals */
.timeframe-signals {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.tf-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.tf-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.tf-value {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.tf-value.buy {
    color: var(--color-buy);
}

.tf-value.sell {
    color: var(--color-sell);
}

.tf-value.hold {
    color: var(--text-secondary);
}

.action-buttons button {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-buy {
    background: linear-gradient(135deg, var(--accent-primary), #3b82f6);
    color: white;
}

.btn-buy:not(.disabled):hover {
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-buy.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #4b5563;
}

/* Loading State for AI Card */
.loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
    color: var(--text-secondary);
}

.is-loading .loading-state {
    display: flex;
}

.is-loading .signal-content {
    display: none;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s infinite linear;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Chart Area */
.chart-tools button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    font-family: var(--font-main);
    cursor: pointer;
    border-radius: 6px;
}

.chart-tools button.active,
.chart-tools button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tradingview-wrapper {
    position: relative;
    flex: 1;
    /* Takes remaining height below header */
    width: 100%;
    min-height: 150px;
    border-radius: 12px;
    overflow: hidden;
}

.tradingview-wrapper>iframe,
.tradingview-wrapper>div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Trade Logs */
.log-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-list::-webkit-scrollbar {
    width: 6px;
}

.log-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.log-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.log-item.info {
    border-left-color: var(--accent-primary);
}

.log-item.buy {
    border-left-color: var(--color-buy);
}

.log-item.sell {
    border-left-color: var(--color-sell);
}

.log-time {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-right: 1rem;
}

/* Utils */
.hidden {
    display: none !important;
}

/* 1m Pattern Signal Prediction Badges */
.signal-prediction-badge {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    z-index: 5;
}

.signal-prediction-badge.buy {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.signal-prediction-badge.sell {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.compact-signal-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.55rem;
    font-weight: 900;
    margin-left: 0.6rem;
    vertical-align: middle;
    text-transform: uppercase;
}

.compact-signal-badge.buy {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.compact-signal-badge.sell {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Dual Tables Layout */
.dual-tables-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.side-table {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.4rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.side-table.active-side {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.side-table.buy-side.active-side {
    border-color: rgba(16, 185, 129, 0.4);
}

.side-table.sell-side.active-side {
    border-color: rgba(239, 68, 68, 0.4);
}

.table-title {
    font-size: 0.6rem;
    font-weight: 800;
    text-align: center;
    padding: 0.2rem;
    border-radius: 4px;
    letter-spacing: 0.05rem;
}

.buy-side .table-title {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.sell-side .table-title {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.results-table {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 0.7fr 0.7fr;
    padding: 0 0.3rem;
}

.table-header span {
    font-size: 0.5rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
}

.result-row {
    display: grid;
    grid-template-columns: 1fr 1fr 0.7fr 0.7fr;
    align-items: center;
    padding: 0.25rem 0.3rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.profit-target {
    font-size: 0.52rem;
    color: var(--text-secondary);
}

.price-target {
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.price-prob {
    font-size: 0.6rem;
    font-family: var(--font-mono);
    font-weight: 700;
    text-align: right;
    padding-right: 0.2rem;
}

.price-time {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: right;
    font-family: var(--font-mono);
}

.price-prob.high {
    color: #10b981;
}

.price-prob.med {
    color: #f59e0b;
}

.price-prob.low {
    color: #ef4444;
}

.result-row.highlight {
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.1);
}

.side-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.6rem;
    font-weight: 800;
}

.side-badge.buy {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.side-badge.sell {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.calc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.calc-note {
    margin: 0 !important;
}

.micro-pattern-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.65rem;
}

.micro-pattern-status .label {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
}

.micro-pattern-status .value {
    color: var(--accent-primary);
    font-weight: 800;
    font-family: var(--font-mono);
}

.micro-pattern-status .value.bullish {
    color: #10b981;
}

.micro-pattern-status .value.bearish {
    color: #ef4444;
}

.pulse-subtle {
    animation: pulse-subtle 2s infinite;
}

@keyframes pulse-subtle {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.live-badge {
    background: rgba(5, 150, 105, 0.2);
    color: var(--color-buy);
    border: 1px solid var(--color-buy);
}

/* Skeleton Loading Animation */
.skeleton {
    color: transparent !important;
    background: linear-gradient(90deg, #1e222d 25%, #2a2e39 50%, #1e222d 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
    min-width: 60px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* AI Models View */
.models-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow-y: auto;
}

.models-header {
    margin-bottom: 2rem;
}

.models-header h2 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.models-header p {
    color: var(--text-secondary);
}

.bot-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.bot-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(16px);
}

.bot-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.bot-card.active-bot {
    border-color: var(--color-buy);
    box-shadow: 0 0 20px var(--color-buy-glow);
}

.bot-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.bot-icon.scalper {
    background: rgba(37, 99, 235, 0.2);
    color: #3b82f6;
}

.bot-icon.swing {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.bot-icon.grid {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.bot-icon.sentiment {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.bot-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.bot-risk {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.bot-risk.high {
    background: rgba(220, 38, 38, 0.2);
    color: var(--color-sell);
    border: 1px solid var(--color-sell);
}

.bot-risk.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.bot-risk.low {
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-buy);
    border: 1px solid var(--color-buy);
}

.bot-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 1rem;
    flex: 1;
}

.bot-stats {
    list-style: none;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.8rem;
}

.bot-stats li {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.bot-stats li:last-child {
    margin-bottom: 0;
}

.bot-stats li span {
    color: var(--text-muted);
}

.btn-select-bot {
    width: 100%;
    padding: 0.8rem;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-select-bot:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bot-card.active-bot .btn-select-bot {
    background: var(--color-buy);
    color: white;
}

/* Signals View Styles */
.signals-view {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.signals-view::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.1;
}

.signals-view::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(37, 99, 235, 0.1) 0%, transparent 10%, transparent 90%, rgba(37, 99, 235, 0.1) 100%);
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 3;
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

.signals-header {
    margin-bottom: 1rem;
    position: relative;
    z-index: 5;
}

.signals-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.signals-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.signals-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Strategy Guides */
.strategy-section-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-main);
}

.strategy-section-title.bullish-title {
    background: linear-gradient(90deg, #10b981, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.3));
}

.strategy-section-title.bearish-title {
    background: linear-gradient(90deg, #ef4444, #f59e0b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.3));
}

.strategy-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
}

.strategy-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.6rem;
}

.strategy-card {
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent);
    background-color: rgba(19, 21, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    transition: 0.5s;
    pointer-events: none;
}

.strategy-card:hover::before {
    left: 100%;
}

.strategy-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: rgba(255, 255, 255, 0.15);
}

.strategy-card.bullish-card:hover {
    box-shadow: 0 15px 45px -10px rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.3);
}

.strategy-card.bearish-card:hover {
    box-shadow: 0 15px 45px -10px rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.3);
}

.sc-header {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
}

.sc-header h4 {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.strategy-card p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.3;
    opacity: 0.7;
    margin-top: 0.2rem;
}

/* Candlestick Diagram Graphics */
.candle-diagram {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(0, 0, 0, 0.3);
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 20px 20px, 10px 10px, 10px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.2rem;
    position: relative;
    overflow: hidden;
}

.candle-diagram::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 80%);
    pointer-events: none;
}

.candle {
    position: relative;
    width: 8px;
    height: 30px;
}

.candle .wick {
    position: absolute;
    width: 2px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 1px;
}

.candle .body {
    position: absolute;
    width: 100%;
    left: 0;
    border-radius: 2px;
}

.candle.bullish-candle .wick,
.candle.bullish-candle .body {
    background: var(--color-buy);
}

.candle.bearish-candle .wick,
.candle.bearish-candle .body {
    background: var(--color-sell);
}

/* Patterns View Styles */
.patterns-grid {
    display: grid;
    grid-template-columns: 2.3fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.pattern-feed-container {
    height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
}

.pattern-feed {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    scrollbar-width: thin;
    scrollbar-color: var(--color-buy) transparent;
}

/* Signal Convergence Indicator */
.convergence-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 1.2rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.conv-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.conv-value {
    font-size: 0.75rem;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.conv-value.aligned {
    color: var(--color-buy);
}

.conv-value.conflict {
    color: var(--color-sell);
}

.conv-value.neutral {
    color: var(--text-secondary);
}

.pattern-feed::-webkit-scrollbar {
    width: 6px;
}

.pattern-feed::-webkit-scrollbar-thumb {
    background: var(--color-buy);
    border-radius: 10px;
}

.detection-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    animation: slideInLeft 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.detection-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.detection-card.bullish {
    border-left: 4px solid var(--color-buy);
    box-shadow: inset 10px 0 20px -10px rgba(5, 150, 105, 0.2);
}

.detection-card.bearish {
    border-left: 4px solid var(--color-sell);
    box-shadow: inset 10px 0 20px -10px rgba(220, 38, 38, 0.2);
}

.detection-card .pattern-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.bullish .pattern-icon {
    color: var(--color-buy);
    border: 1px solid rgba(5, 150, 105, 0.3);
}

.bearish .pattern-icon {
    color: var(--color-sell);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.detection-info {
    flex: 1;
}

.detection-info h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.detection-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.detection-meta {
    text-align: right;
    min-width: 90px;
}

.time-ago {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Courier New', Courier, monospace;
}

.status-badge.live {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-buy);
    font-size: 0.65rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    letter-spacing: 0.5px;
    font-weight: 700;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.empty-feed-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 1rem;
    opacity: 0.5;
}

.empty-feed-msg i {
    font-size: 2.5rem;
}

.pattern-stats .stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.si-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.si-value strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.pattern-log-preview {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.pattern-log-preview h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    letter-spacing: 1.5px;
    font-weight: 800;
}

.node-status {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-buy);
}

.node-status .pulse {
    width: 6px;
    height: 6px;
    background: var(--color-buy);
    border-radius: 50%;
    display: inline-block;
    animation: blink 1s infinite;
}

@keyframes lineScan {
    from {
        left: -100%;
    }

    to {
        left: 100%;
    }
}

.ch-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.scan-line {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-buy), transparent);
    display: block;
    position: relative;
    overflow: hidden;
}

.scan-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: lineScan 2s linear infinite;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    animation: modalSlideUp 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.modal-header h2 i {
    color: var(--accent-primary);
}

.btn-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: var(--color-sell);
    border-color: var(--color-sell);
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.library-search {
    position: relative;
    margin-bottom: 1.5rem;
}

.library-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.library-search input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    color: var(--text-primary);
    font-family: var(--font-main);
}

.patterns-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.library-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.library-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.lib-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.lib-info {
    flex: 1;
}

.lib-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.signal-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 1px;
}

.signal-badge.buy {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-buy);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.signal-badge.sell {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-sell);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.modal-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.btn-icon-toggle {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: var(--accent-primary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon-toggle:hover {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.ch-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.history-item.bullish {
    border-left: 3px solid var(--color-buy);
}

.history-item.bearish {
    border-left: 3px solid var(--color-sell);
}

.hist-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.bullish .hist-icon {
    color: var(--color-buy);
}

.bearish .hist-icon {
    color: var(--color-sell);
}

.hist-info {
    flex: 1;
}

.hist-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.hist-meta {
    text-align: right;
    font-family: var(--font-mono);
}

.hist-time {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Energy Bar (Probability Meter) */
.energy-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 0.6rem;
    overflow: hidden;
    position: relative;
}

.energy-bar {
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 1s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
}

.energy-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: energyShine 2s infinite;
}

@keyframes energyShine {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

.bullish .energy-bar {
    background: linear-gradient(90deg, #10b981, #06b6d4);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.bearish .energy-bar {
    background: linear-gradient(90deg, #ef4444, #f97316);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.energy-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.3rem;
    font-family: var(--font-mono);
}

.energy-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-target {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.price-prob {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 600;
}

.price-prob.high {
    color: #10b981;
}

.price-prob.med {
    color: #f59e0b;
}

.price-prob.low {
    color: #ef4444;
}

.price-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* High Confidence Pulse */
.energy-value.high-confidence {
    color: #06b6d4;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
    animation: pulseConfidence 2s infinite;
}

@keyframes pulseConfidence {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.compact-energy-container {
    height: 2px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 4px;
    border-radius: 1px;
    overflow: hidden;
}

.compact-energy-bar {
    height: 100%;
    transition: width 1s ease;
}

.bullish .compact-energy-bar {
    background: var(--color-buy);
}

.bearish .compact-energy-bar {
    background: var(--color-sell);
}

.hidden {
    display: none !important;
}

/* --- MOBILE RESPONSIVENESS --- */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    transition: color 0.3s;
}

.mobile-menu-btn:hover {
    color: var(--accent-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Breakpoints */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .market-overview {
        grid-column: 1 / span 2;
        grid-row: 1;
    }

    .ai-settings {
        grid-column: 1 / span 2;
        grid-row: 2;
    }

    .ai-signal {
        grid-column: 1 / span 2;
        grid-row: 3;
    }

    .chart-container {
        grid-column: 1 / span 2;
        grid-row: 4;
        min-height: 400px;
    }

    .patterns-dashboard {
        grid-column: 1 / span 2;
        grid-row: 5;
    }

    .profit-calculator {
        grid-column: 1 / span 2;
        grid-row: 6;
    }

    .trade-logs {
        grid-column: 1 / span 2;
        grid-row: 7;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .mobile-menu-btn {
        display: block;
    }

    .header-left {
        display: flex;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .market-overview,
    .ai-settings,
    .ai-signal,
    .chart-container,
    .patterns-dashboard,
    .profit-calculator,
    .trade-logs {
        grid-column: 1;
    }

    .market-stats {
        grid-template-columns: 1fr 1fr;
    }

    .top-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .user-profile {
        justify-content: space-between;
    }

    .pair-selector select {
        width: 100%;
    }

    .chart-tools {
        flex-wrap: wrap;
    }

    /* Dual tables stack */
    .dual-tables-container {
        flex-direction: column;
    }

    .bot-cards-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .market-stats {
        grid-template-columns: 1fr;
    }
}