/* ============================================
   CMMS Pro - Charts Styles
   Author: Your Name
   Purpose: Styling for dashboard analytics charts
   ============================================ */

/* Charts Section Container */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Individual Chart Card */
.chart-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-left: 3px solid #244855;  /* Primary theme color */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Chart Title */
.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #244855;  /* Primary theme color */
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f8f9fa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Chart Canvas Container */
.chart-card canvas {
    max-height: 300px;
    width: 100% !important;
}

/* Chart Loading State */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #555;
    font-size: 0.95rem;
}

.chart-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid #f8f9fa;
    border-top-color: #244855;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Chart Error State */
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #E64833;
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

/* Chart No Data State */
.chart-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .charts-section {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .charts-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-card {
        padding: 1rem;
    }
    
    .chart-card canvas {
        max-height: 250px;
    }
    
    .chart-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .chart-card canvas {
        max-height: 220px;
    }
    
    .charts-section {
        margin-bottom: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .chart-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .charts-section {
        display: block;
    }
    
    .chart-card {
        margin-bottom: 1rem;
    }
}