:root {
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --border: #30363d;
    --text-main: #c9d1d9;
    --text-dim: #8b949e;
    --bullish: #26a69a;
    --bearish: #ef5350;
    --neutral: #ffa726;
    --liquidation: #9c27b0;
    --poc: #ffa726;
}

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 20px;
    line-height: 1.5;
}

.da-container {
    max-width: 1600px;
    margin: 0 auto;
}

/* --- HEADER --- */
.da-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.da-header-left h1 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--neutral);
}

.da-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.da-select, .da-input {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 16px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
}

.da-select:hover, .da-input:hover {
    border-color: var(--neutral);
}

.da-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.da-btn.primary {
    background: var(--bullish);
    color: white;
}

.da-btn.primary:hover {
    background: #2ea043;
}

/* --- STATUS --- */
.da-header-right {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.da-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
    white-space: nowrap;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f85149;
}

.status-dot.connected {
    background: var(--bullish);
    box-shadow: 0 0 8px var(--bullish);
}

/* --- LAYOUT & CHARTS --- */
.da-main-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    height: 550px;
}

.da-price-chart-container {
    flex: 4;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.da-chart {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Слой для пузырьков */
.bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* --- BUBBLES --- */
.bubble {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.8;
    z-index: 110;
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: auto;
    animation: bubbleIn 0.3s ease-out;
}

.bubble.buy {
    background: radial-gradient(circle, var(--bullish) 30%, rgba(38, 166, 154, 0.1) 100%);
    box-shadow: 0 0 12px rgba(38, 166, 154, 0.4);
}

.bubble.sell {
    background: radial-gradient(circle, var(--bearish) 30%, rgba(239, 83, 80, 0.1) 100%);
    box-shadow: 0 0 12px rgba(239, 83, 80, 0.4);
}

.bubble.liquidation {
    background: var(--liquidation) !important;
    box-shadow: 0 0 20px var(--liquidation);
    border: 2px solid #fff;
    opacity: 1;
    z-index: 120;
}

/* --- VOLUME PROFILE & POC --- */
.da-volume-panel {
    width: 130px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.vp-bar {
    position: absolute;
    right: 0;
    background: rgba(88, 166, 255, 0.4);
    border-radius: 2px 0 0 2px;
    height: 4px;
    transition: width 0.3s ease;
}

.vp-bar-poc {
    background: var(--poc);
    box-shadow: 0 0 10px var(--poc);
    height: 6px;
    z-index: 10;
}

.da-volume-profile {
    flex: 1;
    position: relative;
}

.da-poc-info {
    padding: 10px;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* --- OI & CVD PANELS --- */
.da-cvd-panel, .da-oi-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.da-cvd-chart, .da-oi-chart {
    height: 180px;
    width: 100%;
}

/* --- LEGEND --- */
.da-legend {
    display: flex;
    gap: 15px;
    font-size: 0.75rem;
    align-items: center;
    padding: 10px 15px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.legend-dot.buy { background: var(--bullish); }
.legend-dot.sell { background: var(--bearish); }
.legend-dot.liq { background: var(--liquidation); border: 1px solid #fff; }
.legend-line.poc {
    width: 15px;
    height: 2px;
    background: var(--poc);
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

/* --- CONTEXT CARDS --- */
.da-context-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.da-context-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    border-bottom: 3px solid transparent;
}

.context-value {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 5px 0;
}

.context-value.positive { color: var(--bullish); }
.context-value.negative { color: var(--bearish); }

/* --- SUMMARY PANEL --- */
.da-summary-panel {
    margin-top: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.summary-content h3 {
    color: var(--neutral);
    margin-bottom: 8px;
}

.summary-content p {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.ai-btn {
    background: linear-gradient(135deg, #7928ca, #ff0080);
    color: white;
    padding: 15px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(121, 40, 202, 0.3);
    cursor: pointer;
    transition: 0.2s;
}

.ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(121, 40, 202, 0.5);
}

/* Анимации */
@keyframes bubbleIn {
    from {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
}

/* Адаптивность */
@media (max-width: 1200px) {
    .da-main-layout {
        flex-direction: column;
        height: auto;
    }
    .da-price-chart-container {
        height: 500px;
    }
    .da-volume-panel {
        width: 100%;
        height: auto;
        min-height: 100px;
    }
    .da-context-panel {
        grid-template-columns: repeat(2, 1fr);
    }
    .da-summary-panel {
        flex-direction: column;
        text-align: center;
    }
}