/* System Health Monitor Dashboard Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f8f9fa;
    color: #1a1a1a;
    line-height: 1.6;
}

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

header {
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    flex: 1;
}

.header-right {
    text-align: right;
    font-size: 0.9rem;
    color: #6c757d;
}

.header-right .timestamp {
    margin-bottom: 0.25rem;
    font-weight: bold;
    font-style: italic;
}

.header-right span {
    font-weight: bold;
    font-style: italic;
    color: #1a1a1a;
}

h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 300;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #6c757d;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}

/* Metrics Cards Section */
.metrics-section {
    margin-bottom: 2rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    border-radius: 10px;
    padding: clamp(1rem, 2vw, 1.25rem);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.metric-title {
    font-size: 0.85rem;
    color: #6c757d;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.metric-main-value {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.metric-main-value.good {
    color: #28a745;
}

.metric-main-value.warning {
    color: #ffc107;
}

.metric-main-value.bad {
    color: #dc3545;
}

.metric-details {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.metric-detail {
    text-align: center;
    flex: 1;
}

.metric-detail-value {
    font-size: 1.2rem;
    font-weight: 500;
    color: #1a1a1a;
}

.metric-detail-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Failed Checks Chart Section */
.chart-section {
    background: white;
    border-radius: 12px;
    padding: clamp(1rem, 3vw, 2rem);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.chart-header {
    margin-bottom: 2rem;
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.chart-subtitle {
    color: #6c757d;
    font-size: 0.95rem;
}

.chart-container {
    position: relative;
    height: 380px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(248,249,250,0.3));
    border-radius: 8px;
    padding: 10px;
    overflow: visible;
}

#failedChecksChart {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
    overflow: visible;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

footer {
    margin-top: 3rem;
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    border-top: 1px solid #e9ecef;
}

footer div {
    margin: 0.25rem 0;
}

/* Responsive Design */
@media (min-width: 640px) {
    .container {
        padding: 1.5rem;
    }

    header {
        margin-bottom: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 2rem;
    }

    header {
        margin-bottom: 3rem;
    }

    .metrics-section {
        margin-bottom: 2.5rem;
    }

    .chart-section {
        margin-bottom: 3rem;
    }
}

/* Small screens (mobile) */
@media (max-width: 639px) {
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .metric-title {
        font-size: 0.8rem;
    }

    .metric-detail-value {
        font-size: 1rem;
    }

    .metric-detail-label {
        font-size: 0.7rem;
    }

    .chart-container {
        height: 250px;
        padding: 5px;
    }

    .chart-title {
        font-size: 1.25rem;
    }

    .chart-subtitle {
        font-size: 0.875rem;
    }

    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    footer {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* Medium screens (tablets) */
@media (min-width: 640px) and (max-width: 1023px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-container {
        height: 320px;
    }
}

/* Large screens (desktop) */
@media (min-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .chart-container {
        height: 380px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}