/*!
 * Copyright (c) 2026 Daki.cc — Niclas Specht. All rights reserved.
 * Proprietary and confidential.
 */

/* Status page (daki.cc/status): the LED wall hero from the home page
   (animated-grid.css + hero-led.js), then the live board drawn by status.js
   from /api/status — summary tiles, one card per node group with a 90-day
   LED strip per node — and the help section. Colours follow subpages.css. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #111111;
    color: #fff;
    font-family: 'Work Sans', sans-serif;
    overflow-x: clip;
}

:root {
    --st-up: #3ddc84;
    --st-up-rgb: 61, 220, 132;
    --st-warn: #f4b740;
    --st-warn-rgb: 244, 183, 64;
    --st-down: #ff5468;
    --st-down-rgb: 255, 84, 104;
    --st-maint: #7aa7ff;
    --st-maint-rgb: 122, 167, 255;
    --st-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.st-icon { width: 16px; height: 16px; flex-shrink: 0; }

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
    color: #cf5ee0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.section-kicker::before { content: ''; width: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #c026d3, rgba(192, 38, 211, 0)); }

/* ── Hero: the shared LED subpage header (animated-grid.css) ──── */
.st-hero .btn-hero-primary .btn-arrow { width: 16px; height: 16px; }
.st-hero .btn-hero-primary:hover .btn-arrow { transform: translateY(2px); }
.st-hero .st-icon-discord { width: 18px; height: 18px; color: #f0c2f8; }

/* When something is wrong the accent says so in its own colour. */
.st-hero[data-state="degraded"] .led-panel .hero-accent {
    background-image: linear-gradient(100deg, transparent 42%, rgba(255, 250, 235, 0.95) 50%, transparent 58%), linear-gradient(118deg, #fde3ae 0%, #f4b740 55%, #e8932c 100%);
}
.st-hero[data-state="down"] .led-panel .hero-accent {
    background-image: linear-gradient(100deg, transparent 42%, rgba(255, 240, 242, 0.95) 50%, transparent 58%), linear-gradient(118deg, #ffc2ca 0%, #ff5468 55%, #e0344d 100%);
}

/* ── Main ──────────────────────────────────────────────────────── */
.st-main { flex-grow: 1; padding: 64px 0 24px; }
.st-main :focus-visible { outline: 2px solid #d48ae6; outline-offset: 3px; }
.st-main [hidden] { display: none !important; }

.st-card,
.st-tile,
.st-group,
.st-help-card,
.st-notice,
.st-fallback {
    border: 1px solid var(--sp-border, #343039);
    border-radius: 13px;
    background:
        radial-gradient(ellipse at var(--glow-x, 85%) var(--glow-y, 0%), rgba(118, 9, 145, var(--glow-opacity, .08)), transparent 70%),
        var(--sp-surface, #181818);
}

.st-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid #3a3140;
    border-radius: 9px;
    background: #1b171f;
    color: #f2edf5;
    font-size: .84rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.st-btn:hover { border-color: #855493; background: #221a27; color: #fff; }
.st-btn .st-icon { width: 14px; height: 14px; }
.st-btn.is-spinning .st-icon { animation: st-spin .8s linear; }
.st-btn:disabled { cursor: progress; opacity: .7; }

/* ── Board head ────────────────────────────────────────────────── */
.st-board-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 24px; margin-bottom: 22px; }
.st-board-head h2 { margin: 0 0 6px; color: #f2edf5; font: 700 clamp(1.6rem, 3.4vw, 2.1rem)/1.15 'Poppins', sans-serif; letter-spacing: -.03em; }
.st-board-sub { margin: 0; color: var(--sp-muted, #a99eb0); font-size: .88rem; }
.st-board-tools { display: flex; flex-wrap: wrap; gap: 8px; }

/* HetrixTools "News", shown when it says more than "all good". */
.st-notice {
    --c: var(--st-warn-rgb);
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border-color: rgba(var(--c), .4);
    background: linear-gradient(90deg, rgba(var(--c), .1), rgba(var(--c), .02) 60%), var(--sp-surface, #181818);
    box-shadow: inset 3px 0 0 rgb(var(--c));
}
.st-notice[data-level="danger"] { --c: var(--st-down-rgb); }
.st-notice[data-level="info"], .st-notice[data-level="ok"] { --c: 214, 94, 240; }
.st-notice .st-icon { width: 20px; height: 20px; margin-top: 1px; color: rgb(var(--c)); }
.st-notice b { display: block; margin-bottom: 2px; color: #f2edf5; font: 600 .98rem/1.35 'Poppins', sans-serif; }
.st-notice p { margin: 0; color: var(--sp-text, #d8d0dc); font-size: .92rem; line-height: 1.55; white-space: pre-line; }

/* ── Summary tiles ─────────────────────────────────────────────── */
.st-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.st-tile { display: flex; flex-direction: column; min-width: 0; padding: 18px 20px; --glow-y: 100%; }
.st-tile--state { --glow-x: 0%; --glow-y: 0%; --glow-opacity: .14; border-color: #684376; }
.st-tile-label { color: var(--sp-muted, #a99eb0); font: 500 10.5px/1.2 var(--st-mono); letter-spacing: .1em; text-transform: uppercase; }
.st-tile-value { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 12px 0 6px; color: #f2edf5; font: 500 1.75rem/1.1 'Work Sans', sans-serif; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-tile-value > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.st-tile-value small { color: var(--sp-muted, #a99eb0); font-size: .55em; letter-spacing: -.01em; }
.st-tile-note { overflow: hidden; color: var(--sp-muted, #a99eb0); font-size: .8rem; white-space: nowrap; text-overflow: ellipsis; }
.st-tile--state .st-tile-value { font-size: 1.45rem; letter-spacing: -.03em; }

/* Status LEDs */
.st-led { --c: 169, 158, 176; position: relative; display: inline-block; flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--c)); box-shadow: 0 0 10px rgba(var(--c), .75); }
.st-led[data-s="up"] { --c: var(--st-up-rgb); }
.st-led[data-s="degraded"] { --c: var(--st-warn-rgb); }
.st-led[data-s="down"] { --c: var(--st-down-rgb); }
.st-led[data-s="maintenance"] { --c: var(--st-maint-rgb); }
.st-led[data-s="down"]::after,
.st-tile--state .st-led[data-s]::after {
    content: '';
    position: absolute;
    inset: -5px;
    border: 2px solid rgba(var(--c), .5);
    border-radius: 50%;
    animation: st-ping 2.4s ease-out infinite;
}

/* ── Groups ────────────────────────────────────────────────────── */
.st-groups { display: flex; flex-direction: column; gap: 16px; }
.st-group { --glow-x: 100%; --glow-opacity: .06; overflow: hidden; }
.st-group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.st-group-head h3 { margin: 0; color: #f2edf5; font: 600 1.05rem/1.3 'Poppins', sans-serif; letter-spacing: -.01em; }
.st-group-head p { margin: 2px 0 0; color: var(--sp-muted, #a99eb0); font-size: .82rem; }
.st-group-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.st-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid #3a3140; border-radius: 999px; background: #141216; color: #d8cadd; font: 500 10.5px/1.2 var(--st-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.st-badge .st-led { width: 6px; height: 6px; box-shadow: 0 0 6px rgba(var(--c), .8); }
.st-badge b { color: #fff; font-weight: 600; }

/* One node: summary row (name, 90-day strip, uptime) that opens into details. */
.st-cols { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) 76px 16px; align-items: center; gap: 18px; }
.st-mon + .st-mon { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.st-mon > summary { padding: 13px 20px; list-style: none; cursor: pointer; transition: background .2s ease; }
.st-mon > summary::-webkit-details-marker { display: none; }
.st-mon > summary:hover, .st-mon[open] > summary { background: rgba(255, 255, 255, 0.025); }
.st-mon-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st-mon-name > span { min-width: 0; }
.st-mon-name b { display: block; overflow: hidden; color: #f2edf5; font-size: .95rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.st-mon-name small { display: block; overflow: hidden; color: #9f8fa8; font: 11px/1.4 var(--st-mono); white-space: nowrap; text-overflow: ellipsis; }
.st-mon-up { color: #f2edf5; font-size: .92rem; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.st-mon-up small { display: block; color: #9f8fa8; font: 10px/1.3 var(--st-mono); letter-spacing: .06em; text-transform: uppercase; }
.st-chev { width: 16px; height: 16px; color: #9f8fa8; transition: transform .25s ease, color .2s ease; }
.st-mon > summary:hover .st-chev { color: #f0c2f8; }
.st-mon[open] .st-chev { transform: rotate(180deg); }

/* The 90-day strip: one LED bar per day. */
.st-bars { display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px; height: 30px; }
.st-day { display: block; min-width: 0; border-radius: 1.5px; background: #2a2330; transition: filter .15s ease, transform .15s ease; }
.st-day[data-s="ok"] { background: linear-gradient(180deg, #a84cc4 0%, #7d2a98 100%); }
.st-day[data-s="partial"] { background: linear-gradient(180deg, #ffe08a 0 3px, var(--st-warn) 3px); box-shadow: 0 0 8px rgba(var(--st-warn-rgb), .45); }
.st-day[data-s="major"] { background: linear-gradient(180deg, #ffd0d6 0 3px, var(--st-down) 3px); box-shadow: 0 0 8px rgba(var(--st-down-rgb), .5); }
.st-bars .st-day:hover, .st-bars .st-day.is-active { filter: brightness(1.45); transform: scaleY(1.12); }
.st-scale { padding: 0 20px 12px; color: #7d6b86; font: 10px/1 var(--st-mono); letter-spacing: .06em; text-transform: uppercase; }
.st-scale > span:nth-child(2) { display: flex; justify-content: space-between; gap: 10px; }
.st-scale .is-short { display: none; }

/* Details */
.st-mon-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 4px 20px 20px; }
.st-panel { min-width: 0; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 10px; background: rgba(8, 4, 11, 0.4); }
.st-panel h4 { margin: 0 0 12px; color: var(--sp-muted, #a99eb0); font: 500 10.5px/1.2 var(--st-mono); letter-spacing: .1em; text-transform: uppercase; }
.st-panel dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: .86rem; }
.st-panel dt { color: var(--sp-muted, #a99eb0); font-weight: 400; }
.st-panel dd { margin: 0; color: #f2edf5; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.st-panel a { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--sp-link, #cc96de); font-size: .84rem; font-weight: 600; text-decoration: none; }
.st-panel a:hover { color: #fff; }
.st-panel a .st-icon { width: 13px; height: 13px; }

/* Segmented LED meters for CPU / RAM / disk. */
.st-meter { display: grid; grid-template-columns: 38px minmax(0, 1fr) 52px; align-items: center; gap: 10px; font-size: .82rem; }
.st-meter + .st-meter { margin-top: 9px; }
.st-meter > span { color: var(--sp-muted, #a99eb0); font: 500 10.5px/1 var(--st-mono); letter-spacing: .08em; text-transform: uppercase; }
.st-meter > b { color: #f2edf5; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.st-seg { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 2px; height: 10px; }
.st-seg i { border-radius: 1.5px; background: rgba(214, 160, 232, 0.1); }
.st-seg i.on { background: #d65ef0; box-shadow: 0 0 5px rgba(214, 94, 240, 0.6); }
.st-seg.is-high i.on { background: var(--st-warn); box-shadow: 0 0 5px rgba(var(--st-warn-rgb), 0.6); }
.st-net { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.06); color: var(--sp-muted, #a99eb0); font-size: .8rem; }
.st-net b { color: #f2edf5; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Tooltip for the day bars */
.st-tip {
    position: fixed;
    z-index: 1080;
    min-width: 150px;
    padding: 9px 12px;
    border: 1px solid #4a3a52;
    border-radius: 9px;
    background: rgba(24, 17, 28, 0.96);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
    color: #d8cadd;
    font-size: .8rem;
    line-height: 1.45;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 6px));
    transition: opacity .12s ease;
}
.st-tip.is-on { opacity: 1; }
.st-tip b { display: block; color: #fff; font-weight: 600; }
.st-tip i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 1.5px; vertical-align: 1px; }

/* Skeleton while the first answer is on its way */
.st-group--skeleton { padding: 8px 20px; }
.st-skel-row { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) 76px; align-items: center; gap: 18px; padding: 16px 0; }
.st-skel-row + .st-skel-row { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.st-skel-row span {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #1a161d 0%, #2a2230 50%, #1a161d 100%);
    background-size: 200% 100%;
    animation: st-shimmer 1.4s ease-in-out infinite;
}
.st-skel-row span:nth-child(2) { height: 28px; border-radius: 4px; }

/* Fallback: the HetrixTools report itself */
.st-fallback { overflow: hidden; }
.st-fallback > p { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); color: var(--sp-muted, #a99eb0); font-size: .88rem; line-height: 1.55; }
.st-fallback > p .st-icon { margin-top: 2px; color: #cc96de; }
.st-fallback[data-mode="down"] > p { padding: 22px 22px; border-bottom: 0; color: var(--sp-text, #d8d0dc); font-size: .95rem; }
.st-fallback[data-mode="down"] > p .st-icon { width: 20px; height: 20px; margin-top: 1px; }
.st-fallback[data-mode="down"] .st-frame-wrap { display: none; }
.st-frame-wrap { position: relative; min-height: 460px; background: #0c0c0d; }
/* iframe-resizer needs width:1px + min-width:100% to size correctly. */
.st-frame { display: block; width: 1px; min-width: 100%; min-height: 460px; border: 0; }
.st-noscript { padding: 16px 20px; border: 1px solid var(--sp-border, #343039); border-radius: 13px; color: var(--sp-text, #d8d0dc); }
.st-noscript a { color: var(--sp-link, #cc96de); }

.st-board-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 16px; color: var(--sp-muted, #a99eb0); font-size: .8rem; }
.st-board-foot a { color: var(--sp-link, #cc96de); text-decoration: none; }
.st-board-foot a:hover { color: #fff; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font: 500 10.5px/1.2 var(--st-mono); letter-spacing: .06em; text-transform: uppercase; }
.st-legend li { display: flex; align-items: center; gap: 7px; }
.st-legend .st-day { width: 6px; height: 14px; }

/* ── Help ──────────────────────────────────────────────────────── */
.st-help { margin-top: 88px; text-align: center; }
.st-help h2 { margin: 0 0 8px; font: 700 clamp(1.6rem, 3.4vw, 2.1rem)/1.15 'Poppins', sans-serif; letter-spacing: -.03em; }
.st-help > p { max-width: 560px; margin: 0 auto 26px; color: var(--sp-muted, #a99eb0); }
.st-help-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; text-align: left; }
.st-help-card { position: relative; display: flex; flex-direction: column; padding: 22px; color: inherit; text-decoration: none; transition: border-color .25s ease, transform .3s ease, box-shadow .25s ease; }
.st-help-card:hover { transform: translateY(-4px); border-color: #855493; box-shadow: 0 14px 34px -14px rgba(192, 38, 211, 0.45); color: inherit; }
.st-help-step { display: inline-grid; place-items: center; align-self: flex-start; min-width: 32px; height: 26px; margin-bottom: 16px; padding: 0 7px; border: 1px solid rgba(214, 160, 232, 0.25); border-radius: 7px; background: rgba(8, 4, 11, 0.55); color: #ec9cfb; font: 600 12px/1 var(--st-mono); font-variant-numeric: tabular-nums; text-shadow: 0 0 8px rgba(214, 94, 240, 0.7); }
.st-help-card b { margin-bottom: 6px; color: #f2edf5; font: 600 1.05rem/1.3 'Poppins', sans-serif; letter-spacing: -.01em; }
.st-help-card b small { color: var(--sp-muted, #a99eb0); font-family: 'Work Sans', sans-serif; font-size: .78em; font-weight: 500; }
.st-help-card > span:not(.st-help-step) { flex-grow: 1; color: var(--sp-text, #d8d0dc); font-size: .9rem; line-height: 1.55; }
.st-help-card em { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--sp-link, #cc96de); font-size: .86rem; font-style: normal; font-weight: 600; }
.st-help-card em .st-icon { width: 14px; height: 14px; transition: transform .25s ease; }
.st-help-card:hover em .st-icon { transform: translateX(3px); }

@keyframes st-ping {
    0% { transform: scale(.4); opacity: 1; }
    80%, 100% { transform: scale(1.5); opacity: 0; }
}
@keyframes st-spin { to { transform: rotate(360deg); } }
@keyframes st-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .st-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-mon-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-mon-body .st-panel:first-child { grid-column: 1 / -1; }
    .st-help-grid { grid-template-columns: 1fr; }
}
/* Phones: the last 30 days only, and the strip moves under the name. */
@media (max-width: 767px) {
    .st-main { padding-top: 48px; }
    .st-cols { grid-template-columns: minmax(0, 1fr) auto 16px; grid-template-areas: 'name up chev' 'bars bars bars'; gap: 10px 14px; }
    .st-mon-name { grid-area: name; }
    .st-mon-up { grid-area: up; }
    .st-chev { grid-area: chev; }
    .st-cols > .st-bars { grid-area: bars; }
    .st-bars { grid-template-columns: repeat(30, minmax(0, 1fr)); height: 24px; }
    .st-bars .st-day:nth-child(-n+60) { display: none; }
    .st-scale { display: none; }
    .st-mon > summary, .st-group-head { padding-left: 16px; padding-right: 16px; }
    .st-mon-body { grid-template-columns: minmax(0, 1fr); padding: 2px 16px 16px; }
    .st-skel-row { grid-template-columns: minmax(0, 1fr) 60px; }
    .st-skel-row span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 575px) {
    .st-tiles { gap: 10px; }
    .st-tile { padding: 14px 14px; }
    .st-tile-value { font-size: 1.4rem; }
    .st-tile--state .st-tile-value { font-size: 1.15rem; }
    .st-tile-note { white-space: normal; }
    .st-board-tools { width: 100%; }
    .st-board-tools .st-btn { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .st-led::after, .st-skel-row span, .st-btn.is-spinning .st-icon { animation: none !important; }
    .st-help-card, .st-btn, .st-day, .st-chev, .st-tip { transition: none; }
    .st-help-card:hover { transform: none; }
    .st-bars .st-day:hover, .st-bars .st-day.is-active { transform: none; }
}
