/* Energy Anomalies Dashboard Styles */



/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--theme-colour);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0;
}

/* Minimal Stats Bar */
.stats-minimal {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid var(--theme-colour);
    flex-wrap: wrap;
    font-size: 1rem;
}

.stat-mini {
    color: #333;
}

.stat-mini strong {
    color: var(--theme-colour);
}

/* Table Header */
.table-header {
    background: var(--theme-colour);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--theme-colour);
}

/* Table Styling */
.table-responsive {
    background: white;
}

.table {
    font-size: 1rem;
    margin: 0;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid var(--theme-colour);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 0.5rem 0.5rem;
    border-color: #e9ecef;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Anomaly Row Highlighting */
.anomaly-row {
    background-color: #fff5f5 !important;
    border-left: 3px solid var(--theme-colour) !important;
    font-weight: 500;
}

.anomaly-row:hover {
    background-color: #fff0f0 !important;
}

/* Normal row hover effect */
.table-hover tbody tr:not(.anomaly-row):hover {
    background-color: #fafbfc;
}

/* Stats display */
#statsCards .display-6 {
    font-weight: 700;
    color: #6502ec;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Page header mobile */
    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    /* Stats bar mobile */
    .stats-minimal {
        gap: 1rem;
        font-size: 0.95rem;
    }

    /* Table responsive improvements */
    .table thead th {
        font-size: 0.8rem;
        padding: 0.4rem 0.3rem;
    }

    .table tbody td {
        font-size: 0.9rem;
        padding: 0.4rem 0.3rem;
    }

    .table-header {
        font-size: 1rem;
        padding: 0.4rem 0.75rem;
    }
}

@media (max-width: 576px) {
    .stats-minimal {
        gap: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Loading spinner animation */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Smooth transitions for state changes */
#loadingState,
#errorState,
#tablesContainer {
    animation: fadeIn 0.3s ease-in;
}

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

/* Filter controls */
.form-select,
.form-label {
    font-size: 1rem;
}

.form-select:focus {
    border-color: #6502ec;
    box-shadow: 0 0 0 0.2rem rgba(101, 2, 236, 0.25);
}

/* Refresh button */
.btn-primary {
    background-color: #6502ec;
    border-color: #6502ec;
}

.btn-primary:hover {
    background-color: #5102bd;
    border-color: #5102bd;
}

/* Alert styling */
.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Icon colors */
.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #0dcaf0 !important;
}

/* Border colors for stat cards */
.border-warning {
    border-color: #ffc107 !important;
    border-width: 2px !important;
}

.border-info {
    border-color: #0dcaf0 !important;
    border-width: 2px !important;
}

/* Table striping */
.table-striped tbody tr:nth-of-type(odd):not(.anomaly-row) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Card body padding adjustment for tables */
.card-body.p-0 {
    padding: 0 !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #1a1a1a;
        border-color: #333;
    }

    .card-header {
        background-color: #2a2a2a !important;
        border-bottom-color: #333;
    }

    .table {
        color: #e0e0e0;
    }

    .table thead th {
        background-color: #2a2a2a;
        color: #e0e0e0;
        border-color: #444;
    }

    .table tbody td {
        border-color: #333;
    }

    .table-hover tbody tr:not(.anomaly-row):hover {
        background-color: #2a2a2a;
    }

    .anomaly-row {
        background-color: #5a1a1a !important;
    }

    .anomaly-row:hover {
        background-color: #6a2a2a !important;
    }

    .anomaly-row td {
        color: #ff6b6b;
    }
}

/* Utility classes */
.fw-bold {
    font-weight: 600 !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Anomaly details expandable row */
.anomaly-details-row {
    background-color: #fff8e1 !important;
}

.anomaly-details {
    padding: 1rem;
    border-left: 4px solid #ff9800;
}

.anomaly-details h6 {
    color: #e65100;
    font-weight: 600;
}

.anomaly-details .detail-item {
    margin-bottom: 0.5rem;
}

.anomaly-details .detail-item span.fw-bold {
    display: inline-block;
    min-width: 120px;
    color: #424242;
}

.anomaly-toggle {
    transition: transform 0.3s ease;
}

.anomaly-row {
    transition: background-color 0.2s ease;
}

/* Dark mode adjustments for anomaly details */
@media (prefers-color-scheme: dark) {
    .anomaly-details-row {
        background-color: #3e2723 !important;
    }

    .anomaly-details {
        border-left-color: #ff9800;
    }

    .anomaly-details h6 {
        color: #ffb74d;
    }

    .anomaly-details .detail-item span.fw-bold {
        color: #e0e0e0;
    }
}

/* Badge styling for metrics */
.badge.bg-danger {
    background-color: #d32f2f !important;
}

.badge.bg-warning {
    background-color: #ffa726 !important;
}
