/* ============================================
   DMX Dashboard Module - 8 Widget Grid
   Matching Screenshot Design
   ============================================ */

.dmx-dashboard {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #000000;
    overflow: hidden;
}

/* Header */
.dmx-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dmx-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dmx-title i {
    color: #F39C12;
    font-size: 14px;
}

.dmx-title h2 {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.dmx-symbol-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dmx-symbol-select select {
    padding: 6px 24px 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    outline: none;
}

/* Grid Layout - 2 rows x 4 columns */
.dmx-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

/* Widget Container */
.dmx-widget {
    background: #000000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.dmx-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.dmx-widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 500;
    color: #888;
}

.dmx-widget-title i {
    color: #F39C12;
    font-size: 10px;
}

.dmx-widget-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 10px;
}

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

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-dot.short {
    background: #ff6b9d;
}

.legend-dot.long {
    background: #26a69a;
}

.legend-text {
    color: #888;
}

.dmx-widget-content {
    flex: 1;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

/* Widget 1: Price Chart (TradingView style) */
.price-chart-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.price-chart-info {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 10;
}

.price-symbol {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.price-timeframe {
    font-size: 10px;
    color: #888;
    margin-left: 4px;
}

.price-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 2px;
}

.price-current {
    font-size: 14px;
    font-weight: 600;
    color: #F39C12;
    font-family: 'JetBrains Mono', monospace;
}

.price-change {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.price-change.positive {
    color: #22c55e;
}

.price-change.negative {
    color: #ef4444;
}

.price-chart-svg {
    width: 100%;
    height: 100%;
}

/* Widget 2: DXM Donut */
.donut-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.donut-svg {
    width: 120px;
    height: 120px;
}

.donut-center {
    position: absolute;
    text-align: center;
}

.donut-long {
    font-size: 12px;
    font-weight: 600;
    color: #26a69a;
}

.donut-short {
    font-size: 10px;
    color: #ff6b9d;
}

/* Widget 3: Percentage Stacked Bar */
.stacked-bar-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.stacked-bar-chart {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding-bottom: 4px;
}

.stacked-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 12px;
}

.stacked-bar-short {
    background: #ff6b9d;
}

.stacked-bar-long {
    background: #26a69a;
}

.stacked-bar-midline {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #ef4444;
    top: 50%;
}

/* Widget 4: Open Interest */
.oi-bar-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding: 4px;
}

.oi-bar {
    flex: 1;
    background: #26a69a;
    border-radius: 1px 1px 0 0;
    min-width: 6px;
    max-width: 14px;
}

/* Widget 5: Parcelle (Stacked Area) */
.parcelle-container {
    width: 100%;
    height: 100%;
}

.parcelle-svg {
    width: 100%;
    height: 100%;
}

/* Widget 6: Position Lines */
.position-lines-container {
    width: 100%;
    height: 100%;
}

.position-lines-svg {
    width: 100%;
    height: 100%;
}

/* Widget 7: Multi OI */
.multi-oi-container {
    width: 100%;
    height: 100%;
}

.multi-oi-svg {
    width: 100%;
    height: 100%;
}

.multi-oi-legend {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 150px;
}

.multi-oi-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 8px;
    color: #888;
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
}

.multi-oi-dot {
    width: 6px;
    height: 6px;
    border-radius: 1px;
}

/* Widget 8: DXM Table */
.dmx-table-container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 4px;
}

.dmx-data-table {
    width: 100%;
}

.dmx-data-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.dmx-data-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.dmx-data-label {
    color: #888;
    font-size: 10px;
}

.dmx-data-value {
    color: #fff;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.dmx-data-value.positive {
    color: #26a69a;
}

.dmx-data-value.negative {
    color: #ff6b9d;
}

/* Y-Axis Labels */
.chart-y-axis {
    position: absolute;
    right: 4px;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 8px;
    color: #555;
    font-family: 'JetBrains Mono', monospace;
}

/* TradingView badge */
.tv-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size: 10px;
    color: #555;
    font-weight: 600;
}

/* Color palette for multi-series */
.color-euraud { background: #26a69a; }
.color-eurcad { background: #ff6b9d; }
.color-eurchf { background: #F39C12; }
.color-eurgbp { background: #4ade80; }
.color-eurjpy { background: #facc15; }
.color-eurnzd { background: #06b6d4; }
.color-eurusd { background: #e5e5e5; }

/* Responsive */
@media (max-width: 1200px) {
    .dmx-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .dmx-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(8, 1fr);
    }
}
