/* Facility Analytics Dashboard Styles */

.facility-analytics-dashboard {
    padding: 20px;
    background: #1a1a2e;
    border-radius: 10px;
    margin-top: 20px;
}

/* Header Stats Cards */
.analytics-header {
    margin-bottom: 30px;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #2a2a3e 0%, #1f1f30 100%);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #333;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.stat-card.valid {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #2a3e2a 0%, #1f301f 100%);
}

.stat-card.invalid {
    border-color: #f44336;
    background: linear-gradient(135deg, #3e2a2a 0%, #301f1f 100%);
}

.stat-card.warning {
    border-color: #ff9800;
    background: linear-gradient(135deg, #3e352a 0%, #302a1f 100%);
}

.stat-label {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

/* Charts Grid */
.analytics-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.analytics-card {
    background: #2a2a3e;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #444;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.analytics-card:hover {
    border-color: #4CAF50;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.analytics-card-wide {
    grid-column: span 2;
}

.analytics-card h4 {
    margin: 0 0 15px 0;
    color: #4CAF50;
    font-size: 16px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.analytics-card canvas {
    max-height: 300px;
}

.chart-legend {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.chart-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    color: #ccc;
    font-size: 13px;
}

.stat-row strong {
    color: #fff;
}

.stat-row.positive strong {
    color: #4CAF50;
}

.stat-row.negative strong {
    color: #f44336;
}

/* Detailed Tables */
.analytics-tables {
    margin-top: 30px;
}

.analytics-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
}

.analytics-table-card {
    background: #2a2a3e;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #444;
}

.analytics-table-card h4 {
    margin: 0 0 15px 0;
    color: #4CAF50;
    font-size: 16px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.analytics-table thead {
    background: #1a1a2e;
}

.analytics-table th {
    padding: 10px;
    text-align: left;
    color: #4CAF50;
    font-weight: bold;
    border-bottom: 2px solid #333;
}

.analytics-table td {
    padding: 8px 10px;
    color: #ccc;
    border-bottom: 1px solid #333;
}

.analytics-table tr:hover {
    background: #333;
}

.analytics-table td.positive {
    color: #4CAF50;
}

.analytics-table td.negative {
    color: #f44336;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .analytics-charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .analytics-card-wide {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .stat-cards {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .analytics-charts-grid {
        grid-template-columns: 1fr;
    }

    .analytics-table-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 20px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.analytics-card {
    animation: fadeIn 0.5s ease-out;
}

.analytics-card:nth-child(1) { animation-delay: 0.05s; }
.analytics-card:nth-child(2) { animation-delay: 0.1s; }
.analytics-card:nth-child(3) { animation-delay: 0.15s; }
.analytics-card:nth-child(4) { animation-delay: 0.2s; }
.analytics-card:nth-child(5) { animation-delay: 0.25s; }
.analytics-card:nth-child(6) { animation-delay: 0.3s; }
