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

:root {
    --bg: #0a0e1a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --green: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.15);
    --yellow: #f59e0b;
    --yellow-glow: rgba(245, 158, 11, 0.15);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.15);
    --indigo: #6366f1;
    --radius: 16px;
    --radius-sm: 10px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Subtle gradient overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.08), transparent);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.back-link:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--bg-card);
}

/* ── Overall Banner ────────────────────────────────── */
.banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-bottom: 32px;
    font-size: 18px;
    font-weight: 600;
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.4s ease;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.4s ease;
}

.banner-loading {
    background: var(--bg-card);
}
.banner-loading .banner-dot {
    background: var(--text-dim);
    animation: pulse 1.5s ease-in-out infinite;
}

.banner-operational {
    background: var(--green-glow);
    border-color: rgba(34, 197, 94, 0.2);
}
.banner-operational .banner-dot {
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
}

.banner-degraded {
    background: var(--yellow-glow);
    border-color: rgba(245, 158, 11, 0.2);
}
.banner-degraded .banner-dot {
    background: var(--yellow);
    box-shadow: 0 0 12px var(--yellow);
}

.banner-major_outage {
    background: var(--red-glow);
    border-color: rgba(239, 68, 68, 0.2);
}
.banner-major_outage .banner-dot {
    background: var(--red);
    box-shadow: 0 0 12px var(--red);
}

/* ── Service Cards ─────────────────────────────────── */
.services {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.service-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s;
}

.service-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.service-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.service-name {
    font-weight: 600;
    font-size: 15px;
}

.service-latency {
    font-size: 13px;
    color: var(--text-muted);
}

.service-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

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

.status-up .service-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-up .service-label { color: var(--green); }

.status-degraded .service-dot { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.status-degraded .service-label { color: var(--yellow); }

.status-down .service-dot { background: var(--red); box-shadow: 0 0 6px var(--red); }
.status-down .service-label { color: var(--red); }

/* Skeleton */
.skeleton-card {
    height: 68px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    animation: pulse 1.5s ease-in-out infinite;
}

/* ── Uptime Charts ─────────────────────────────────── */
.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.uptime-section {
    margin-bottom: 40px;
}

.uptime-chart-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 22px;
    margin-bottom: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.uptime-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.uptime-chart-name {
    font-weight: 600;
    font-size: 14px;
}

.uptime-chart-pct {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.uptime-bars {
    display: flex;
    gap: 2px;
    height: 32px;
    align-items: flex-end;
}

.uptime-bar {
    flex: 1;
    min-width: 0;
    border-radius: 2px;
    height: 100%;
    position: relative;
    cursor: pointer;
    transition: opacity 0.15s;
}

.uptime-bar:hover {
    opacity: 0.8;
}

.uptime-bar.up { background: var(--green); }
.uptime-bar.degraded { background: var(--yellow); }
.uptime-bar.down { background: var(--red); }
.uptime-bar.empty { background: rgba(255, 255, 255, 0.05); }

/* Tooltip */
.uptime-bar .tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.uptime-bar:hover .tooltip {
    display: block;
}

.uptime-dates {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-dim);
}

/* ── Incidents ─────────────────────────────────────── */
.incidents-section {
    margin-bottom: 40px;
}

.incident-card {
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

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

.incident-title {
    font-weight: 600;
    font-size: 14px;
}

.incident-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 6px;
}

.incident-badge.resolved {
    background: var(--green-glow);
    color: var(--green);
}

.incident-badge.investigating {
    background: var(--yellow-glow);
    color: var(--yellow);
}

.incident-badge.identified {
    background: var(--yellow-glow);
    color: var(--yellow);
}

.incident-meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* No incidents */
.no-incidents {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 40px;
}

.no-incidents svg {
    color: var(--green);
}

/* ── Footer ────────────────────────────────────────── */
.footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer a {
    color: var(--indigo);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ── Animations ────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 480px) {
    .container { padding: 24px 16px 40px; }
    .banner { padding: 16px 18px; font-size: 16px; }
    .uptime-bars { height: 24px; }
    .header { flex-wrap: wrap; gap: 12px; }
}
