/* EGX Stock Chart Styles */

.egx-stock-chart-container {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Chart Controls */
.egx-chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    align-items: center;
}

.chart-type-selector,
.chart-period-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-type-selector label,
.chart-period-selector label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin: 0;
}

.chart-type-select,
.chart-period-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.chart-type-select:focus,
.chart-period-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Period Button Controls */
.period-buttons {
    display: flex;
    gap: 4px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 2px;
}

.period-btn {
    padding: 6px 8px;
    border: none;
    background: transparent;
    color: #495057;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 35px;
    text-align: center;
}

.period-btn:hover {
    background: #f8f9fa;
    color: #3498db;
}

.period-btn[data-active="true"] {
    background: #3498db;
    color: #fff;
    box-shadow: 0 1px 3px rgba(52, 152, 219, 0.3);
}

.period-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.period-btn:active {
    transform: translateY(1px);
}



/* Chart Wrapper */
.egx-chart-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.egx-chart-wrapper .apex-chart {
    background: #fff;
    border-radius: 4px;
}

/* Loading Animation */
.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    z-index: 10;
}

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

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

.chart-loading p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Error Message */
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    font-size: 16px;
}

.chart-error p {
    margin: 0;
}



/* Responsive Design */
@media (max-width: 768px) {
    .egx-chart-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chart-type-selector,
    .chart-period-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .period-buttons {
        flex-wrap: wrap;
        gap: 2px;
        justify-content: center;
    }
    
    .period-btn {
        padding: 5px 6px;
        font-size: 11px;
        min-width: 30px;
    }
    
    .egx-stock-chart-container {
        padding: 15px;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .egx-stock-chart-container {
        padding: 10px;
        margin: 10px 0;
    }
    
    .period-buttons {
        gap: 1px;
        padding: 1px;
    }
    
    .period-btn {
        padding: 4px 5px;
        font-size: 10px;
        min-width: 28px;
    }
}

/* ApexCharts Customizations */
.egx-stock-chart-container .apexcharts-canvas {
    margin: 0 auto;
}

.egx-stock-chart-container .apexcharts-tooltip {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid #e1e5e9 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border-radius: 6px !important;
}

.egx-stock-chart-container .apexcharts-tooltip-title {
    background: #f8f9fa !important;
    border-bottom: 1px solid #e1e5e9 !important;
    color: #495057 !important;
    font-weight: 600 !important;
    border-radius: 6px 6px 0 0 !important;
}

.egx-stock-chart-container .apexcharts-tooltip-series-group {
    background: transparent !important;
    padding: 8px 12px !important;
}

.egx-stock-chart-container .apexcharts-gridline {
    stroke: #f1f3f4;
}

.egx-stock-chart-container .apexcharts-text {
    fill: #495057;
    font-size: 12px;
}



/* Print Styles */
@media print {
    .egx-chart-controls {
        display: none;
    }
    
    .egx-stock-chart-container {
        box-shadow: none;
        border: 1px solid #000;
    }
} 