/* Thames Water Dashboard Styles */

:root {
    --primary-color: #0066cc;
    --secondary-color: #00a6ed;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --background-color: #f5f7fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

#last-sync {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.healthy {
    background-color: var(--success-color);
    color: white;
}

.status-badge.degraded {
    background-color: var(--warning-color);
    color: #333;
}

.status-badge.unhealthy {
    background-color: var(--danger-color);
    color: white;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.card h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.card .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.card .unit {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.alert-card .value {
    color: var(--danger-color);
}

.alert-card.no-alerts .value {
    color: var(--success-color);
}

/* Cost Cards */
.cost-cards {
    margin-top: -10px;
}

.cost-card .value {
    color: var(--success-color);
    font-size: 2rem;
}

.cost-card h3 {
    color: var(--success-color);
}

/* Chart Sections */
.chart-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-header h2 {
    font-size: 1.2rem;
    color: var(--text-color);
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--background-color);
}

.btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.date-picker {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* Alerts Section */
.alerts-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.alerts-list {
    max-height: 400px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-item .alert-info {
    flex: 1;
}

.alert-item .alert-type {
    font-weight: 600;
    color: var(--danger-color);
    margin-bottom: 5px;
}

.alert-item .alert-message {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.alert-item .alert-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: right;
}

.alert-item.acknowledged {
    opacity: 0.6;
}

.alert-item.acknowledged .alert-type {
    color: var(--text-muted);
}

.no-alerts-message {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

footer p {
    margin: 5px 0;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .card .value {
        font-size: 2rem;
    }

    .chart-container {
        height: 250px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }
}
