/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-color: #1e40af;
    --secondary-color: #3b82f6;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    /* Status Colors */
    --status-operational: #22c55e;
    --status-degraded: #eab308;
    --status-outage: #ef4444;
    --status-maintenance: #9ca3af;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-md);
}

.header-content {
    text-align: center;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Status Banner */
.status-banner {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.status-dot.operational {
    background-color: var(--status-operational);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.status-dot.degraded {
    background-color: var(--status-degraded);
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
}

.status-dot.outage {
    background-color: var(--status-outage);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-dot.maintenance {
    background-color: var(--status-maintenance);
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.2);
}

.status-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.last-updated {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Services Grid */
.services-section {
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.card-status .status-dot {
    width: 12px;
    height: 12px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.card-message {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Uptime Section */
.uptime-section {
    margin-bottom: 3rem;
}

.uptime-container {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.uptime-service {
    margin-bottom: 2rem;
}

.uptime-service:last-child {
    margin-bottom: 0;
}

.uptime-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.uptime-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.uptime-stat {
    text-align: center;
}

.uptime-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--status-operational);
}

.uptime-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.uptime-history {
    display: flex;
    gap: 2px;
    height: 40px;
    margin-top: 1rem;
    border-radius: 0.25rem;
    overflow: hidden;
}

.uptime-bar {
    flex: 1;
    background-color: var(--status-operational);
    transition: background-color 0.3s;
}

.uptime-bar.degraded {
    background-color: var(--status-degraded);
}

.uptime-bar.outage {
    background-color: var(--status-outage);
}

.uptime-bar.maintenance {
    background-color: var(--status-maintenance);
}

/* Incidents Section */
.incidents-section {
    margin-bottom: 3rem;
}

.incidents-container {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.no-incidents {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.incident-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.incident-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.incident-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.incident-status.investigating {
    background-color: #fef3c7;
    color: #92400e;
}

.incident-status.identified {
    background-color: #dbeafe;
    color: #1e40af;
}

.incident-status.monitoring {
    background-color: #e0e7ff;
    color: #3730a3;
}

.incident-status.resolved {
    background-color: #d1fae5;
    color: #065f46;
}

.incident-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.incident-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
}

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

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

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

.refresh-btn:active {
    transform: scale(0.98);
}

.refresh-btn.spinning svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-text {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 0.875rem;
    }
    
    .banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .uptime-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus States */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
