@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #0d1117;
    --bg-card: #161b22;
    --bg-card-hover: #1c2230;
    --border: #21262d;
    --border-light: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #484f58;

    --online: #3fb950;
    --online-bg: rgba(63, 185, 80, 0.12);
    --online-border: rgba(63, 185, 80, 0.25);

    --degraded: #d29922;
    --degraded-bg: rgba(210, 153, 34, 0.12);
    --degraded-border: rgba(210, 153, 34, 0.25);

    --offline: #f85149;
    --offline-bg: rgba(248, 81, 73, 0.12);
    --offline-border: rgba(248, 81, 73, 0.25);

    --checking: #388bfd;
    --checking-bg: rgba(56, 139, 253, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ─── Layout ──────────────────────────────────────────────── */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ─── Header ──────────────────────────────────────────────── */
.site-header {
    padding: 48px 0 32px;
    text-align: center;
}

.site-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #388bfd, #3fb950);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 20px rgba(56, 139, 253, 0.3);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.site-title {
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 700;
    margin-bottom: 8px;
}

.site-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ─── Status Banner ───────────────────────────────────────── */
.status-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid;
    margin: 24px 0 32px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
}

.status-banner.all-online {
    background: var(--online-bg);
    border-color: var(--online-border);
    color: var(--online);
}

.status-banner.has-issue {
    background: var(--offline-bg);
    border-color: var(--offline-border);
    color: var(--offline);
}

.status-banner.checking {
    background: var(--checking-bg);
    border-color: rgba(56, 139, 253, 0.25);
    color: var(--checking);
}

.banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.banner-dot.pulse {
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 currentColor;
        opacity: 1;
    }

    70% {
        box-shadow: 0 0 0 7px transparent;
        opacity: 0.7;
    }

    100% {
        box-shadow: 0 0 0 0 transparent;
        opacity: 1;
    }
}

.banner-meta {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: inherit;
    opacity: 0.75;
}

/* ─── Refresh Button ──────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-refresh.spinning i {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ─── Service Group ───────────────────────────────────────── */
.service-group {
    margin-bottom: 32px;
}

.group-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 4px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

/* ─── Service Card ────────────────────────────────────────── */
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 8px;
    transition: border-color 0.2s ease, background 0.2s ease;
    cursor: default;
}

.service-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.service-card.loading {
    opacity: 0.65;
}

.card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-url {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 380px;
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.response-time {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-badge.online {
    background: var(--online-bg);
    color: var(--online);
    border-color: var(--online-border);
}

.status-badge.degraded {
    background: var(--degraded-bg);
    color: var(--degraded);
    border-color: var(--degraded-border);
}

.status-badge.offline {
    background: var(--offline-bg);
    color: var(--offline);
    border-color: var(--offline-border);
}

.status-badge.checking {
    background: var(--checking-bg);
    color: var(--checking);
    border-color: rgba(56, 139, 253, 0.25);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.online .badge-dot,
.status-badge.checking .badge-dot {
    animation: pulse 1.8s infinite;
}

/* ─── Uptime Bar ──────────────────────────────────────────── */
.uptime-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.uptime-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.uptime-pct {
    color: var(--text-secondary);
    font-weight: 600;
}

.uptime-bar {
    display: flex;
    gap: 2px;
    height: 28px;
    align-items: flex-end;
}

.uptime-day {
    flex: 1;
    border-radius: 3px;
    transition: height 0.4s ease, opacity 0.2s;
    cursor: pointer;
    position: relative;
}

.uptime-day:hover {
    opacity: 0.8;
}

.uptime-day:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1c2230;
    color: var(--text-primary);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid var(--border-light);
    pointer-events: none;
    z-index: 10;
}

.uptime-day.up {
    background: var(--online);
    height: 100%;
}

.uptime-day.down {
    background: var(--offline);
    height: 40%;
}

.uptime-day.empty {
    background: var(--border);
    height: 30%;
}

/* ─── Footer ──────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 40px 0 32px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--text-primary);
}

/* ─── Skeleton Loader ─────────────────────────────────────── */
.skel {
    background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
    display: inline-block;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .service-url {
        display: none;
    }

    .uptime-section {
        display: none;
    }

    .service-meta {
        gap: 6px;
    }

    .site-header {
        padding: 32px 0 20px;
    }
}