/* ============================================
   Currency Strength Index (CSI) Module
   Professional Multi-Currency Chart
   ============================================ */

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

/* Header */
.csi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.csi-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.csi-main-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.csi-main-title i {
    color: #F39C12;
    font-size: 16px;
}

.csi-timeframe-badge {
    color: #F39C12;
    font-weight: 400;
    font-size: 13px;
}

.csi-header-controls {
    display: flex;
    gap: 6px;
}

.csi-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.csi-btn:hover {
    background: rgba(243, 156, 18, 0.1);
    border-color: rgba(243, 156, 18, 0.3);
    color: #F39C12;
}

/* Toolbar */
.csi-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.csi-timeframes {
    display: flex;
    gap: 4px;
}

.tf-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #666;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tf-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.tf-btn.active {
    background: rgba(243, 156, 18, 0.15);
    border-color: rgba(243, 156, 18, 0.4);
    color: #F39C12;
}

/* Legend */
.csi-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.currency-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.currency-toggle input {
    display: none;
}

.currency-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

.currency-toggle.active {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.toggle-indicator {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.currency-toggle.active .toggle-indicator {
    opacity: 1;
}

.toggle-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
}

.currency-toggle.active .toggle-label {
    color: #fff;
}

/* Content */
.csi-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.csi-chart-container {
    flex: 1;
    position: relative;
    min-height: 300px;
}

.csi-chart-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.csi-tooltip {
    position: absolute;
    display: none;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 12px;
    color: #fff;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
}

/* Values Panel */
.csi-values-panel {
    width: 140px;
    background: #000000;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.values-header {
    font-size: 10px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
}

.value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    transition: background 0.2s;
}

.value-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.value-row.positive {
    border-left: 2px solid #00C292;
}

.value-row.negative {
    border-left: 2px solid #E74C3C;
}

.value-currency {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
}

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

.value-number {
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.value-row.positive .value-number {
    color: #00C292;
}

.value-row.negative .value-number {
    color: #E74C3C;
}

/* Footer */
.csi-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.csi-badges {
    display: flex;
    gap: 6px;
}

.currency-badge {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid;
    border-radius: 3px;
    background: transparent;
}

.csi-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #666;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #666;
}

.status-dot.live {
    background: #00C292;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.update-time {
    color: #555;
    font-size: 10px;
}

/* Responsive */
@media (max-width: 1200px) {
    .csi-values-panel {
        width: 120px;
    }
    
    .csi-legend {
        display: none;
    }
}

@media (max-width: 900px) {
    .csi-content {
        flex-direction: column;
    }
    
    .csi-values-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .values-header {
        width: 100%;
    }
    
    .value-row {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 600px) {
    .csi-toolbar {
        flex-direction: column;
        gap: 12px;
    }
    
    .csi-timeframes {
        width: 100%;
        justify-content: center;
    }
    
    .csi-badges {
        flex-wrap: wrap;
        justify-content: center;
    }
}
