/* CSS Variables - Contio Brand Colors */
:root {
    --color-operational: #22c55e;
    --color-degraded: #f59e0b;
    --color-outage: #ef4444;
    --color-unknown: #6b7280;
    --color-bg: #f8fafc;
    --color-card: #ffffff;
    --color-text: #0f172a;
    --color-text-secondary: #64748b;
    --color-border: #e2e8f0;
    --color-primary: #5E48D6;
    --color-primary-light: #A55BFF;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header */
.header {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.logo-icon {
    width: 28px;
    height: 28px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.logo-divider {
    width: 1px;
    height: 20px;
    background: var(--color-border);
}

.logo-status {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

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

/* Main */
.main {
    flex: 1;
    padding: 2.5rem 0;
}

/* Status Banner */
.status-banner {
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid var(--color-border);
}

.status-banner.operational {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.status-banner.degraded {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
}

.status-banner.outage {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-unknown);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.status-dot.operational, .status-dot.healthy { background: var(--color-operational); }
.status-dot.degraded { background: var(--color-degraded); }
.status-dot.outage, .status-dot.unhealthy { background: var(--color-outage); }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

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

/* Sections */
.services-section h2,
.incidents-section h2,
.uptime-section h2 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

/* Services List */
.services-list {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s ease;
}

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

.service-item:hover {
    background-color: #f8fafc;
}

.service-name {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--color-text);
}

.service-status {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
}

.service-status .status-dot {
    width: 10px;
    height: 10px;
    animation: none;
}

.service-status-text {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.service-status-text.operational, .service-status-text.healthy { color: var(--color-operational); }
.service-status-text.degraded { color: var(--color-degraded); }
.service-status-text.outage, .service-status-text.unhealthy { color: var(--color-outage); }

.service-response-time {
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    background: #f1f5f9;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* Incidents */
.incidents-section {
    margin-top: 2rem;
}

.incidents-list {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    padding: 1.25rem;
}

.no-incidents {
    color: var(--color-text-secondary);
    text-align: center;
    font-size: 0.9375rem;
    padding: 0.5rem 0;
}

.incident-item {
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border-left: 4px solid var(--color-border);
    background: #fafafa;
}

.incident-item:last-child { margin-bottom: 0; }

.incident-item.critical {
    border-left-color: var(--color-outage);
    background: #fef7f7;
}
.incident-item.major {
    border-left-color: var(--color-degraded);
    background: #fffdf7;
}
.incident-item.minor {
    border-left-color: var(--color-operational);
    background: #f7fdf9;
}

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

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

.incident-meta {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.incident-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.incident-badge.critical { background: #fef2f2; color: var(--color-outage); }
.incident-badge.major { background: #fffbeb; color: var(--color-degraded); }
.incident-badge.minor { background: #f0fdf4; color: var(--color-operational); }

.incident-status-badge {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--color-text-secondary);
}

.incident-status-badge.investigating { background: #fef3c7; color: #92400e; }
.incident-status-badge.identified { background: #dbeafe; color: #1e40af; }
.incident-status-badge.monitoring { background: #d1fae5; color: #065f46; }
.incident-status-badge.resolved { background: #f0fdf4; color: var(--color-operational); }

.incident-message {
    font-size: 0.9375rem;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.incident-affected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.incident-affected-label {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.incident-service {
    font-size: 0.75rem;
    background: #e2e8f0;
    color: var(--color-text);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

.incident-updates {
    border-top: 1px solid var(--color-border);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.incident-update {
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.incident-update-time {
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

.incident-update-status {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    margin-left: 0.5rem;
}

.incident-update-message {
    margin-top: 0.25rem;
    color: var(--color-text);
}

.incident-date {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
}

/* Uptime Chart */
.uptime-section {
    margin-top: 2rem;
}

.uptime-chart {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
}

.uptime-bars {
    display: flex;
    gap: 3px;
    height: 32px;
    margin-bottom: 0.75rem;
}

.uptime-bar {
    flex: 1;
    border-radius: 3px;
    background: var(--color-operational);
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.uptime-bar:hover {
    transform: scaleY(1.15);
    opacity: 0.9;
}
.uptime-bar.degraded { background: var(--color-degraded); }
.uptime-bar.outage { background: var(--color-outage); }
.uptime-bar.no-data { background: #e2e8f0; }

.uptime-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.uptime-percentage {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-operational);
    margin-top: 1rem;
}

/* Footer */
.footer {
    background: var(--color-card);
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
    margin-top: 2rem;
}

.footer a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer a:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}
.footer p { margin-bottom: 0.375rem; }
.footer p:last-child { margin-bottom: 0; }

/* Loading */
.loading {
    text-align: center;
    padding: 2.5rem;
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .logo {
        gap: 0.5rem;
    }

    .logo-icon {
        width: 24px;
        height: 24px;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    .status-banner {
        padding: 1.5rem 1rem;
    }

    .status-text {
        font-size: 1.25rem;
    }

    .service-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625rem;
        padding: 1rem;
    }

    .uptime-bars {
        height: 28px;
        gap: 2px;
    }

    .uptime-percentage {
        font-size: 1.5rem;
    }
}
