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

:root {
    --bg: #1A1A2E;
    --bg-subtle: #1e2035;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.14);
    --text: #F0F2F5;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-dim: rgba(255, 255, 255, 0.35);
    --teal: #2BA5A5;
    --teal-deep: #0D4F4F;
    --teal-glow: rgba(43, 165, 165, 0.15);
    --green: #38A169;
    --green-glow: rgba(56, 161, 105, 0.12);
    --yellow: #ECC94B;
    --yellow-glow: rgba(236, 201, 75, 0.12);
    --red: #E53E3E;
    --red-glow: rgba(229, 62, 62, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('https://www.attriqs.com/fonts/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

/* Teal gradient wash at top */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 40% at 50% -10%, rgba(43, 165, 165, 0.06), transparent 70%);
    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: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

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

.back-link:hover {
    color: var(--teal);
    border-color: rgba(43, 165, 165, 0.3);
    background: var(--teal-glow);
}

/* ── Overall Banner ────────────────────────────────── */
.banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 28px;
    border-radius: var(--radius);
    margin-bottom: 32px;
    font-size: 17px;
    font-weight: 600;
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    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(56, 161, 105, 0.25);
}
.banner-operational .banner-dot {
    background: var(--green);
    box-shadow: 0 0 10px rgba(56, 161, 105, 0.6);
}

.banner-degraded {
    background: var(--yellow-glow);
    border-color: rgba(236, 201, 75, 0.25);
}
.banner-degraded .banner-dot {
    background: var(--yellow);
    box-shadow: 0 0 10px rgba(236, 201, 75, 0.6);
}

.banner-major_outage {
    background: var(--red-glow);
    border-color: rgba(229, 62, 62, 0.25);
}
.banner-major_outage .banner-dot {
    background: var(--red);
    box-shadow: 0 0 10px rgba(229, 62, 62, 0.6);
}

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

.service-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.service-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.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-dim);
}

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

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

.status-up .service-dot { background: var(--green); box-shadow: 0 0 6px rgba(56, 161, 105, 0.5); }
.status-up .service-label { color: var(--green); }

.status-degraded .service-dot { background: var(--yellow); box-shadow: 0 0 6px rgba(236, 201, 75, 0.5); }
.status-degraded .service-label { color: var(--yellow); }

.status-down .service-dot { background: var(--red); box-shadow: 0 0 6px rgba(229, 62, 62, 0.5); }
.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);
    animation: pulse 1.5s ease-in-out infinite;
}

/* ── Uptime Charts ─────────────────────────────────── */
.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    color: var(--text-muted);
}

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

.uptime-chart-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 10px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

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

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

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

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

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

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

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

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

.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: 18px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.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: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 9999px;
}

.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-dim);
}

/* 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(--teal);
}

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

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

.footer a:hover {
    color: #3cc0c0;
}

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

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