/* Cards and the bot status card, shared by the admin panel and the public page state/ */

.card {
    min-width: 0;
    padding: 20px 22px;
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    background: rgba(255, 255, 255, 0.02);
}

.card.wide {
    grid-column: 1 / -1;
}

.card h2 {
    display: flex;
    align-items: center;
    margin: 0 0 14px;
    font-size: 16px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #efe2f7;
}

.card h2 i {
    margin-right: 10px;
    font: normal 0.9em "Sanakan Mono", monospace;
    color: var(--accent);
}

.card h2::after {
    content: "";
    flex: 1;
    height: 1px;
    margin-left: 14px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.5), transparent);
}

/* Bot status */
.status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #80848e;
}

.status-dot.online {
    background: #23a55a;
    box-shadow: 0 0 8px rgba(35, 165, 90, 0.7);
}

.status-dot.idle {
    background: #f0b232;
}

/* do not disturb, during a planned break: red with a bar across */
.status-dot.maintenance {
    background: linear-gradient(#141517, #141517) center / 8px 3px no-repeat, #f23f43;
}

.status-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 200px;
}

.status-text b {
    color: #efe2f7;
}

.status-text span {
    font-size: 13px;
    color: rgba(220, 221, 222, 0.55);
}

/* 24 h in 15 minute parts */
/* the 24 h, 30 day and 12 month bars */
.bar {
    margin-top: 18px;
}

.bar-head,
.bar-ends {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: rgba(220, 221, 222, 0.45);
}

.bar-head {
    margin-bottom: 6px;
    font-size: 13px;
    color: rgba(220, 221, 222, 0.7);
}

.bar-head b {
    font: 13px "JetBrains Mono", Consolas, monospace;
    color: #efe2f7;
}

.bar-ends {
    margin-top: 4px;
}

.timeline {
    display: flex;
    gap: 2px;
    height: 28px;
}

.timeline span {
    flex: 1;
    min-width: 1px;
    background: rgba(220, 221, 222, 0.08);
}

.timeline .ok,
.timeline-legend .ok {
    background: rgba(35, 165, 90, 0.75);
}

.timeline .warn,
.timeline-legend .warn {
    background: rgba(240, 178, 50, 0.8);
}

.timeline .fail,
.timeline-legend .fail {
    background: rgba(217, 83, 79, 0.85);
}

/* a planned maintenance break, in the colour of the planned outages below */
.timeline .planned,
.timeline-legend .planned {
    background: rgba(88, 101, 242, 0.8);
}

.timeline-legend .none {
    background: rgba(220, 221, 222, 0.08);
}

.timeline-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    margin-top: 16px;
    font-size: 12px;
    color: rgba(220, 221, 222, 0.45);
}

.timeline-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 5px 0 10px;
    vertical-align: -1px;
}

/* the bot's own report (api/health): Discord, database, Shinden, commands */
.health {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.health-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-left: 2px solid rgba(35, 165, 90, 0.75);
    background: rgba(255, 255, 255, 0.02);
    font-size: 12px;
    color: rgba(220, 221, 222, 0.55);
}

.health-box.warn {
    border-left-color: rgba(240, 178, 50, 0.8);
}

.health-box.fail {
    border-left-color: rgba(217, 83, 79, 0.85);
}

.health-box h3 {
    margin: 0 0 2px;
    font: 12px "Sanakan Mono", monospace;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-light);
}

.health-box b {
    font-size: 14px;
    font-weight: normal;
    color: #efe2f7;
}

.health-box.fail b {
    color: #f08a87;
}

/* answer times: a column per 15 minutes, as high as its average */
.response-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 48px;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.25);
}

.response-chart span {
    display: flex;
    flex: 1;
    align-items: flex-end;
    min-width: 1px;
    height: 100%;
}

.response-chart i {
    width: 100%;
    background: rgba(var(--accent-rgb), 0.65);
}

.response-chart span:hover i {
    background: var(--accent-light);
}

/* outages of the last 90 days */
.incidents {
    margin-top: 24px;
}

.incident-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.incident-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding: 7px 12px;
    border-left: 2px solid rgba(217, 83, 79, 0.85);
    background: rgba(255, 255, 255, 0.02);
    font: 13px "JetBrains Mono", Consolas, monospace;
    color: rgba(220, 221, 222, 0.75);
}

.incident-list b {
    font-weight: normal;
    color: #efe2f7;
    white-space: nowrap;
}

.incident-list .ongoing {
    background: rgba(217, 83, 79, 0.1);
}

.incident-list .ongoing span {
    color: #f08a87;
}

/* during a planned maintenance break */
.planned-count {
    color: #aab1ff;
}

.incident-list .planned {
    border-left-color: #5865f2;
}

.incident-list .planned.ongoing {
    background: rgba(88, 101, 242, 0.1);
}

.incident-list .planned.ongoing span {
    color: #aab1ff;
}

.incident-list small {
    margin-left: 8px;
    font: 11px "Sanakan Mono", monospace;
    letter-spacing: 0.08em;
    color: #8f98ff;
}

/* the notice set in the admin panel, on state/ */
.notice-bar {
    margin: 28px 0 0;
    padding: 12px 16px;
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    border-left-width: 3px;
    background: rgba(var(--accent-rgb), 0.08);
    color: #efe2f7;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-line;
}

.notice-bar.maintenance {
    border-color: rgba(88, 101, 242, 0.6);
    background: rgba(88, 101, 242, 0.08);
}

.incidents-none {
    margin: 4px 0 0;
    font-size: 13px;
    color: rgba(220, 221, 222, 0.45);
}

/* the other Sanakan sites on state/: dot, name, state, 90 days and their bar */
.services {
    margin: 0;
    padding: 0;
    list-style: none;
}

.services li {
    display: grid;
    grid-template-columns: 14px 120px minmax(150px, 1fr) 62px minmax(160px, 1.4fr);
    align-items: center;
    gap: 8px 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
}

.services li:last-child {
    border-bottom: 0;
}

.service-name {
    color: #efe2f7;
    font-weight: 700;
    text-decoration: none;
}

.service-name:hover {
    color: var(--accent-light);
}

.service-state {
    font-size: 13px;
    color: rgba(220, 221, 222, 0.6);
}

.service-state.down {
    color: #f08a87;
}

.service-uptime {
    font: 13px "JetBrains Mono", Consolas, monospace;
    color: #efe2f7;
    text-align: right;
}

/* 90 days in one bar: thinner gaps */
.timeline.days {
    gap: 1px;
}

.timeline.service-bar {
    height: 16px;
    gap: 1px;
}

.status-dot.none {
    background: rgba(220, 221, 222, 0.15);
}

@media only screen and (max-width: 700px) {
    .services li {
        grid-template-columns: 14px 1fr auto;
    }

    .service-state {
        grid-column: 2 / 4;
        grid-row: 2;
    }

    .timeline.service-bar {
        grid-column: 1 / 4;
    }
}

/* Public status page state/ */
.state-content {
    max-width: 1000px;
}

.state-card {
    margin-top: 36px;
}

.state-note {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: rgba(220, 221, 222, 0.4);
}

@media only screen and (max-width: 600px) {
    .timeline,
    .response-chart {
        gap: 1px;
    }
}
