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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 15px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #0f172a;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 5px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.status-operational {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-degraded {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fed7aa;
}

.status-outage {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-no-data {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-operational { background-color: #16a34a; }
.dot-degraded { background-color: #d97706; }
.dot-outage { background-color: #dc2626; }
.dot-no-data { background-color: #94a3b8; }

/* Summary Stats */
.summary-stats-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
    padding: 5px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.stat-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.stat-number {
    font-weight: 700;
    font-size: 1.1rem;
}

.stat-label {
    color: #64748b;
    font-size: 0.8rem;
}

.stat-divider {
    color: #cbd5e1;
    font-weight: bold;
}

/* Models Section */
.models-section {
    margin-top: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
}

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

.time-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: #64748b;
    font-size: 0.875rem;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.time-btn:hover, .time-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 1px 3px 0 rgba(59, 130, 246, 0.5);
}

/* Model Cards */
.model-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.model-header {
    padding: 5px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.model-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

.model-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    flex-wrap: wrap;
}

.uptime-percentage {
    font-size: 0.875rem;
    color: #64748b;
}

/* Last Ping Status */
.last-ping-status {
    margin-left: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.last-ping-ok {
    color: #166534;
    background-color: #dcfce7;
    padding: 2px 6px;
    border-radius: 4px;
}

.last-ping-error {
    color: #991b1b;
    background-color: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
}

.last-ping-text {
    color: #64748b;
    font-style: italic;
}

/* Uptime Chart */
.uptime-chart {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-row {
    display: flex;
    gap: 2px;
    align-items: center;
}

.chart-label {
    min-width: 60px;
    font-size: 0.8rem;
    color: #64748b;
}

.chart-bars {
    display: flex;
    gap: 1px;
    flex: 1;
}

.chart-bar {
    height: 24px;
    flex: 1;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bar-operational { background-color: #16a34a; }
.bar-degraded { background-color: #d97706; }
.bar-outage { background-color: #dc2626; }
.bar-no-data { 
    background-color: #e2e8f0;
    border: 1px solid #cbd5e1;
}

/* Enhanced Tooltip */
.tooltip {
    position: fixed;
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    z-index: 1000;
    display: none;
    pointer-events: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-width: 250px;
    border: 1px solid #374151;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1f2937;
}

/* Chart Legend */
.chart-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    font-size: 0.8rem;
    color: #64748b;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.875rem;
}

/* Error Page Styles */
.error-card {
    background: white;
    padding: 60px 40px;
    border-radius: 12px;
    border: 1px solid #fee2e2;
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.error-card h1 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: #dc2626;
}

.error-message {
    margin-bottom: 32px;
    color: #64748b;
    font-size: 1.1rem;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #f8fafc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .time-controls {
        width: 100%;
        justify-content: center;
    }
    
    .model-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .model-status {
        width: 100%;
        justify-content: flex-start;
    }
    
    .chart-label {
        min-width: 50px;
        font-size: 0.75rem;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary, .btn-secondary {
        width: 200px;
    }
    
    .tooltip {
        max-width: 200px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

/* Animation for chart bars */
@keyframes chartBarLoad {
    from {
        transform: scaleY(0);
    }
    to {
        transform: scaleY(1);
    }
}

.chart-bar {
    transform-origin: bottom;
    animation: chartBarLoad 0.5s ease-out;
}