/**
 * MT5 Data Viewer Styles
 */

/* Container */
.mt5-data-viewer-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    margin: 20px 0;
    padding: 0;
    box-sizing: border-box;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.category-tab {
    padding: 10px 15px;
    margin-right: 5px;
    margin-bottom: -1px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-bottom-color: transparent;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.category-tab:hover {
    background-color: #eaeaea;
}

.category-tab.active {
    background-color: #fff;
    border-bottom-color: #fff;
    color: #0073aa;
}

/* Market Data Container */
.market-data-container {
    position: relative;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Market Table */
.mt5-market-table {
    width: 100%;
    border-collapse: collapse;
}

.mt5-market-table th,
.mt5-market-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.mt5-market-table th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: #333;
}

.mt5-market-table tr:last-child td {
    border-bottom: none;
}

.mt5-market-table tr:hover {
    background-color: #f5f5f5;
}

.symbol-name {
    font-weight: 500;
}

.bid-price, .ask-price {
    font-family: 'Courier New', monospace;
    text-align: right;
    transition: color 0.5s ease;
}

/* Up and down colors for bid and ask prices */
.price-up {
    color: #26a69a !important;
}

.price-down {
    color: #ef5350 !important;
}

.price-change {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.price-change.positive {
    background-color: rgba(38, 166, 154, 0.1);
    color: #26a69a;
}

.price-change.negative {
    background-color: rgba(239, 83, 80, 0.1);
    color: #ef5350;
}

/* Chart Container */
.chart-container {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
}

.chart-symbol-name {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.close-chart-btn {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.close-chart-btn:hover {
    color: #333;
}

/* Timeframe Selector */
.timeframe-selector {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 15px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
}

.timeframe-btn {
    padding: 6px 12px;
    margin-right: 5px;
    margin-bottom: 5px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.timeframe-btn:hover {
    background-color: #f5f5f5;
}

.timeframe-btn.active {
    background-color: #0073aa;
    border-color: #0073aa;
    color: white;
}

/* Chart Element */
.chart-element {
    width: 100%;
    height: 400px;
}

/* Error Message */
.error-message {
    padding: 10px 15px;
    margin-top: 15px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .category-tabs {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
    }
    
    .mt5-market-table {
        display: block;
        overflow-x: auto;
    }
    
    .timeframe-selector {
        overflow-x: auto;
        white-space: nowrap;
    }
} 