/* ============================================
   Chart & CVD Styles
   ============================================ */

.chart-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.chart-toolbar {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.chart-tools {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tool-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

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

.tool-btn.active {
    background: var(--blue-bg);
    color: var(--blue);
    border-color: rgba(68,138,255,0.3);
}

.tool-btn.enabled {
    color: var(--green);
}

.tool-separator {
    width: 1px;
    height: 20px;
    background: var(--border-primary);
    margin: 0 4px;
}

/* Chart Container */
.chart-container {
    flex: 1;
    position: relative;
    background: var(--bg-primary);
    min-height: 200px;
    overflow: hidden;
}

.chart-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#overlay-chart {
    z-index: 2;
    pointer-events: none;
}

#main-chart {
    z-index: 1;
}

.crosshair-info {
    position: absolute;
    z-index: 10;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-primary);
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

/* CVD Container */
.cvd-container {
    height: 120px;
    min-height: 80px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    position: relative;
}

.cvd-header {
    position: absolute;
    top: 4px;
    left: 8px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.cvd-value {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
}

.cvd-divergence {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    animation: fadeIn 0.3s ease;
}

.cvd-divergence.bullish {
    background: var(--green-bg-strong);
    color: var(--green);
}

.cvd-divergence.bearish {
    background: var(--red-bg-strong);
    color: var(--red);
}

#cvd-chart {
    width: 100%;
    height: 100%;
}

/* DOM Container */
.dom-container {
    font-family: var(--font-mono);
    font-size: 11px;
}

.dom-level {
    display: flex;
    align-items: center;
    height: 22px;
    position: relative;
    margin-bottom: 1px;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.1s;
}

.dom-level:hover {
    filter: brightness(1.2);
}

.dom-bar {
    position: absolute;
    top: 0;
    height: 100%;
    opacity: 0.25;
    transition: width 0.3s ease;
}

.dom-level.ask .dom-bar {
    right: 0;
    background: var(--red);
}

.dom-level.bid .dom-bar {
    left: 0;
    background: var(--green);
}

.dom-price {
    position: relative;
    z-index: 2;
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
}

.dom-level.ask .dom-price { color: var(--red); }
.dom-level.bid .dom-price { color: var(--green); }

.dom-volume {
    position: relative;
    z-index: 2;
    width: 70px;
    text-align: right;
    padding-right: 6px;
    color: var(--text-secondary);
}

.dom-level.ask .dom-volume { text-align: left; padding-left: 6px; padding-right: 0; }

.dom-spread-indicator {
    text-align: center;
    padding: 3px;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin: 2px 0;
}

/* Order Book Heatmap */
.orderbook-heatmap {
    min-height: 200px;
    font-family: var(--font-mono);
    font-size: 11px;
}

.ob-row {
    display: flex;
    align-items: center;
    height: 20px;
    margin-bottom: 1px;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
}

.ob-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transition: width 0.5s, background 0.5s;
}

.ob-price {
    position: relative;
    z-index: 2;
    flex: 1;
    padding-left: 6px;
    font-weight: 500;
}

.ob-value {
    position: relative;
    z-index: 2;
    width: 60px;
    text-align: right;
    padding-right: 6px;
    color: var(--text-secondary);
}

/* Boltzmann Price Line (on chart) */
.boltzmann-label {
    position: absolute;
    right: 8px;
    background: var(--purple);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    z-index: 5;
    pointer-events: none;
}
