/* PlatPlus Status — Gatus-inspired health dashboard */

:root {
    --st-bg: #000000;
    --st-bg-2: #050507;
    --st-panel: #0c0c12;
    --st-panel-2: #12121a;
    --st-line: rgba(148, 163, 184, 0.14);
    --st-text: #f1f2f6;
    --st-muted: #8b8fa3;
    --st-ok: #22c55e;
    --st-ok-bg: rgba(34, 197, 94, 0.15);
    --st-warn: #f59e0b;
    --st-warn-bg: rgba(245, 158, 11, 0.15);
    --st-bad: #ef4444;
    --st-bad-bg: rgba(239, 68, 68, 0.15);
    --st-accent: #7B61FF;
    --st-accent-2: #00A3FF;
    --st-accent-bg: rgba(123, 97, 255, 0.14);
    --st-shell: min(1180px, calc(100% - 2rem));
    --st-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

.st-body {
    font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
    background:
        radial-gradient(1000px 480px at 88% -8%, rgba(123, 97, 255, 0.16), transparent 55%),
        radial-gradient(800px 400px at -5% 8%, rgba(0, 163, 255, 0.1), transparent 55%),
        linear-gradient(180deg, #000000 0%, var(--st-bg) 45%, #000000 100%);
    background-attachment: fixed;
    color: var(--st-text);
    line-height: 1.6;
    position: relative;
}

.st-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, rgba(0, 0, 0, 0.6), transparent 70%);
    z-index: 0;
}

.st-top, .st-main, .st-foot { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

.st-shell {
    width: var(--st-shell);
    margin-inline: auto;
}

.st-top {
    border-bottom: 1px solid var(--st-line);
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.st-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 64px;
}

.st-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.05rem;
}

.st-brand img {
    border-radius: 8px;
}

.st-brand span span {
    background: linear-gradient(135deg, var(--st-accent-2), var(--st-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.st-brand em {
    font-style: normal;
    margin-right: 0.35rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--st-accent-bg);
    color: #c4b5fd;
    font-size: 0.72rem;
    font-weight: 700;
}

.st-nav {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--st-muted);
}

.st-nav a:hover { color: #fff; }

.st-main {
    padding: 2rem 0 3.5rem;
}

.st-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    animation: st-fade 0.5s var(--st-ease) both;
}

.st-kicker {
    margin: 0 0 0.35rem;
    color: var(--st-muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.st-hero h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3.5vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.st-lead {
    margin: 0.4rem 0 0;
    color: var(--st-muted);
}

.st-hero-actions {
    display: flex;
    gap: 0.5rem;
}

.st-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--st-line);
    background: var(--st-panel);
    color: var(--st-text);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s var(--st-ease), border-color 0.2s ease, background 0.2s ease;
}

.st-icon-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(123, 97, 255, 0.45);
}

.st-icon-btn.is-spin i {
    animation: st-spin 0.8s linear infinite;
}

.st-overall {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    border: 1px solid rgba(34, 197, 94, 0.25);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(10, 10, 14, 0.5));
    margin-bottom: 1.15rem;
    animation: st-fade 0.55s var(--st-ease) both;
    flex-wrap: wrap;
}

.st-overall > div { flex: 1; }
.st-overall > .st-countdown { margin-inline-start: auto; }

.st-overall--degraded {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(10, 10, 14, 0.5));
}

.st-overall--major_outage {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(10, 10, 14, 0.5));
}

.st-overall strong {
    display: block;
    font-size: 1.05rem;
}

.st-overall-meta {
    display: block;
    margin-top: 0.15rem;
    color: var(--st-muted);
    font-size: 0.82rem;
}

.st-overall-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--st-ok);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
    animation: st-pulse 2.2s ease-out infinite;
    flex-shrink: 0;
}

.st-overall--degraded .st-overall-dot { background: var(--st-warn); }
.st-overall--major_outage .st-overall-dot { background: var(--st-bad); }

.st-toolbar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.15rem;
}

.st-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--st-line);
    background: var(--st-panel);
    color: var(--st-muted);
    transition: border-color 0.2s ease;
}

.st-search:has(input:focus) {
    border-color: rgba(123, 97, 255, 0.5);
}

.st-search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--st-text);
    font: inherit;
}

.st-toolbar-meta {
    color: var(--st-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.st-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.st-card {
    background: linear-gradient(180deg, var(--st-panel-2), var(--st-panel));
    border: 1px solid var(--st-line);
    border-radius: 16px;
    padding: 1.05rem 1.1rem 0.95rem;
    animation: st-rise 0.5s var(--st-ease) both;
    transition: border-color 0.2s ease, transform 0.2s var(--st-ease);
}

.st-card:nth-child(2) { animation-delay: 0.05s; }
.st-card:nth-child(3) { animation-delay: 0.1s; }
.st-card:nth-child(4) { animation-delay: 0.15s; }

.st-card:hover {
    transform: translateY(-2px);
    border-color: rgba(123, 97, 255, 0.32);
    box-shadow: 0 12px 32px rgba(123, 97, 255, 0.08);
}

.st-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.st-card-head h2 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
}

.st-card-sub {
    margin: 0.2rem 0 0;
    color: var(--st-muted);
    font-size: 0.78rem;
    word-break: break-all;
}

.st-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: var(--st-ok-bg);
    color: #86efac;
    white-space: nowrap;
}

.st-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.st-pill--degraded {
    background: var(--st-warn-bg);
    color: #fcd34d;
}

.st-pill--major_outage {
    background: var(--st-bad-bg);
    color: #fca5a5;
}

.st-card-lat {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 0.55rem;
    color: var(--st-muted);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.55rem;
}

.st-uptime {
    color: #86efac;
    font-size: 0.75rem;
}

.st-bars {
    display: grid;
    grid-template-columns: repeat(48, minmax(0, 1fr));
    gap: 2px;
    height: 38px;
    align-items: end;
}

.st-bars span {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: var(--st-ok);
    opacity: 0.92;
    min-width: 0;
}

.st-bars span.bad {
    background: var(--st-bad);
    height: 70%;
    align-self: end;
}

.st-bars span.unk {
    background: #334155;
    height: 35%;
    opacity: 0.55;
    align-self: end;
}

.st-bars-label {
    display: flex;
    justify-content: space-between;
    margin-top: 0.45rem;
    color: var(--st-muted);
    font-size: 0.72rem;
}

.st-incidents {
    margin-top: 2.25rem;
}

.st-incidents h2 {
    margin: 0 0 0.85rem;
    font-size: 1.15rem;
}

.st-empty {
    margin: 0;
    padding: 1rem 1.1rem;
    border: 1px dashed var(--st-line);
    border-radius: 12px;
    color: var(--st-muted);
    background: rgba(15, 23, 42, 0.35);
}

.st-incident-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.st-incident {
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid var(--st-line);
    background: var(--st-panel);
    border-right: 3px solid var(--st-warn);
}

.st-incident--resolved { border-right-color: var(--st-ok); }
.st-incident--investigating,
.st-incident--identified { border-right-color: var(--st-bad); }

.st-incident-top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    align-items: center;
    margin-bottom: 0.35rem;
}

.st-incident-top strong {
    margin-left: auto;
}

.st-incident p {
    margin: 0.25rem 0 0.5rem;
    color: var(--st-muted);
    font-size: 0.92rem;
}

.st-incident-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    color: var(--st-muted);
    font-size: 0.78rem;
}

.st-mini {
    display: inline-flex;
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.12);
    font-size: 0.72rem;
    color: var(--st-muted);
}

.st-foot {
    border-top: 1px solid var(--st-line);
    padding: 1.25rem 0 1.75rem;
    color: var(--st-muted);
    font-size: 0.82rem;
}

.st-foot a {
    color: var(--st-accent-2);
}

/* Overall uptime highlight stat */
.st-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.15rem;
}

.st-stat {
    padding: 0.95rem 1.05rem;
    border-radius: 14px;
    border: 1px solid var(--st-line);
    background: linear-gradient(180deg, var(--st-panel-2), var(--st-panel));
}

.st-stat b {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--st-accent-2), var(--st-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.st-stat span {
    color: var(--st-muted);
    font-size: 0.8rem;
}

.st-countdown {
    color: var(--st-muted);
    font-size: 0.72rem;
}

.st-countdown b {
    color: var(--st-text);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* Grouped sections */
.st-group {
    margin-bottom: 1.6rem;
}

.st-group-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.75rem;
    color: var(--st-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.st-group-title::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--st-accent);
}

@media (max-width: 640px) {
    .st-stats { grid-template-columns: 1fr; }
}

@keyframes st-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
    70% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes st-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes st-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes st-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
    .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .st-grid { grid-template-columns: 1fr; }
    .st-nav { display: none; }
    .st-hero { flex-direction: column; }
    .st-toolbar { flex-direction: column; align-items: stretch; }
}
