/* Performance Optimizations CSS */

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy loading styles */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Critical CSS placeholder */
.critical-content {
    display: block;
}

.non-critical-content {
    display: none;
}

.non-critical-content.loaded {
    display: block;
}

/* Performance monitoring styles */
.performance-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 9999;
    display: none;
}

/* Resource loading optimization */
.resource-loader {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.resource-loader.loaded {
    opacity: 1;
}

/* Chart loading optimization for Analysis page */
.chart-loading {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.chart-loading::before {
    content: "Loading chart...";
    color: #6c757d;
    font-style: italic;
}

/* Analysis page specific optimizations */
.analysis-tab-content {
    min-height: auto;
}

.chart-container {
    position: relative;
    overflow: hidden;
}

/* Prevent layout shifts */
.metric-card {
    min-height: 120px;
}

.forest-plot-container {
    min-height: 500px;
}

.transparency-card {
    min-height: 350px;
}

/* Responsive performance optimizations */
@media (max-width: 768px) {
    .chart-container {
        height: 300px !important;
    }
    
    .chart-container-large {
        height: 350px !important;
    }
    
    .analysis-metrics {
        grid-template-columns: 1fr;
    }
}

/* Print optimizations */
@media print {
    .performance-indicator,
    .chart-loading {
        display: none !important;
    }
}