/* ========================================
   Base reset and typography
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
}

body {
    background: radial-gradient(1200px 600px at 10% -10%, rgba(106, 227, 255, 0.12), transparent 60%),
        radial-gradient(1000px 500px at 110% 10%, rgba(155, 140, 255, 0.12), transparent 60%),
        linear-gradient(180deg, #090d1a 0%, #0b1020 100%);
    min-height: 100vh;
    padding: 2rem;
}

/* ========================================
   Page level layout
   ======================================== */
.header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.header__navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    row-gap: 0.75rem;
    padding: 1rem 1.4rem;
    border-radius: 1.25rem;
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.55));
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 20px 45px rgba(8, 12, 25, 0.45);
    backdrop-filter: blur(12px);
    flex-wrap: wrap;
}

.header__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.header__brand-logo {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.6));
}

.header__brand-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.header__meta-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    flex: 1 1 220px;
    color: rgba(226, 232, 240, 0.9);
    padding: 0.25rem 0;
}

.header__meta-line {
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.header__meta-label {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    color: rgba(148, 163, 184, 0.9);
}

.header__meta-value {
    font-weight: 600;
    color: #f8fafc;
}

.header__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header__status-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.65rem 0.95rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(22, 163, 74, 0.18));
    border: 1px solid rgba(34, 197, 94, 0.45);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35);
}

.header__status-count,
.header__status-total {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f0fdf4;
}

.header__status-divider {
    font-size: 1rem;
    opacity: 0.7;
    color: #bbf7d0;
}

.header__status-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #bbf7d0;
}

.header__empty-state {
    text-align: center;
    color: rgba(226, 232, 240, 0.85);
    font-size: 1rem;
}

@media (max-width: 768px) {
    .header__navbar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.9rem;
        padding: 0.9rem 1.1rem;
    }

    .header__brand,
    .header__actions {
        justify-content: center;
    }

    .header__actions {
        margin-left: 0;
        gap: 0.75rem;
    }

    .header__meta-line {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    body {
        padding: 1.25rem;
    }

    .header__navbar {
        padding: 0.85rem 1rem;
        gap: 0.75rem;
        border-radius: 1rem;
    }

    .header__brand {
        gap: 0.65rem;
    }

    .header__brand-logo {
        width: 2.5rem;
        height: 2.5rem;
    }

    .header__brand-title {
        font-size: 1.6rem;
    }

    .header__meta-stack {
        gap: 0.25rem;
    }

    .header__meta-line {
        font-size: 0.88rem;
    }

    .header__status-badge {
        width: 100%;
        justify-content: center;
        align-items: center;
        padding: 0.55rem 0.75rem;
    }

    .header__status-count,
    .header__status-total {
        font-size: 1.05rem;
    }

    .header__status-label {
        font-size: 0.8rem;
    }
}

.header__toggle-all-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.1rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    box-shadow: 0 12px 30px rgba(249, 115, 22, 0.35);
    color: #fff7ed;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header__toggle-all-button:hover,
.header__toggle-all-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(249, 115, 22, 0.45);
    background: linear-gradient(135deg, #fb923c, #fdba74);
}

.header__toggle-all-button:focus-visible {
    outline: 2px solid rgba(249, 115, 22, 0.85);
    outline-offset: 3px;
}

.header__toggle-all-button:disabled,
.header__toggle-all-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

@media (max-width: 640px) {
    .header__toggle-all-button {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
    }
}

.header__toggle-all-icon {
    position: relative;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.header__toggle-all-icon::before,
.header__toggle-all-icon::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 2px;
    border-radius: 999px;
    background: #e2e8f0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.header__toggle-all-icon::after {
    transform: rotate(90deg);
}

.header__toggle-all-icon--expanded::after {
    transform: rotate(90deg) scaleX(0);
    opacity: 0;
}

.header__toggle-all-button:hover .header__toggle-all-icon,
.header__toggle-all-button:focus-visible .header__toggle-all-icon {
    background: rgba(15, 23, 42, 0.4);
}

.header__toggle-all-label {
    white-space: nowrap;
    letter-spacing: 0.04em;
}

.service-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 2rem;
    padding: 0.75rem;
}

/* ========================================
   Service cards
   ======================================== */
.service-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 320px;
    min-width: 20%;
    margin: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.service-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1rem;
}

.service-card__header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.service-card__header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: auto;
    text-align: right;
}

.service-card__service-name {
    font-size: 1.5rem;
    font-weight: 600;
}

.service-card__service-host {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Status badges communicate the current state at a glance. */
.service-card__service-status {
    display: inline-block;
    padding: 1.25rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
}

.service-card__service-status--ok {
    background-color: #73ad21;
}

.service-card__service-status--down {
    background-color: #dc3545;
}

.service-card__service-status--unknown {
    background-color: #6c757d;
}

/* ========================================
   Tables and metric grids
   ======================================== */
.service-card__metrics {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.service-card__metrics th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.service-card__metrics th,
.service-card__metrics td {
    padding: 0.75rem 1rem;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
}

/* ========================================
   Charts
   ======================================== */
.service-card__charts {
    overflow: hidden;
    max-height: 0;
    padding: 0 1.5rem;
    opacity: 0;
    transition: max-height 0.3s ease, padding-top 0.3s ease, padding-bottom 0.3s ease, opacity 0.3s ease;
}

.service-card__charts--expanded {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
    opacity: 1;
}

.service-card__chart {
    margin: 0 0 1.5rem;
}

.service-card__chart:last-child {
    margin-bottom: 0;
}

.service-card__toggle {
    width: 100%;
    border: none;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.35);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}

.service-card__toggle:hover,
.service-card__toggle:focus-visible {
    background: rgba(148, 163, 184, 0.25);
}

.service-card__toggle:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.service-card__toggle-icon {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #e2e8f0;
    transition: transform 0.2s ease-in-out;
}

.service-card__toggle[aria-expanded="true"] .service-card__toggle-icon {
    transform: rotate(180deg);
}
.hide_element {
    display: none;
}

/* ========================================
   Responsive adjustments
   ======================================== */
@media (max-width: 600px) {
    .service-list {
        grid-template-columns: 1fr;
    }

    .header__top {
        justify-content: center;
        text-align: center;
    }

    .header__controls {
        width: 100%;
        justify-content: center;
    }

    .header__meta {
        text-align: center;
    }
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    text-align: center;
}

.site-footer__links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.site-footer__links a {
    color: #cbd5f5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.site-footer__links a:hover,
.site-footer__links a:focus {
    color: #38bdf8;
}

/* ========================================
   About page
   ======================================== */
.content-wrapper {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.content-section {
    background: rgba(255, 255, 255, 0.04);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    text-align: left;
}

.content-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.content-section p,
.content-section ul {
    line-height: 1.6;
    color: rgba(226, 232, 240, 0.9);
}

.content-section ul {
    padding-left: 1.5rem;
}

.content-section a {
    color: #38bdf8;
    text-decoration: none;
}

.content-section a:hover,
.content-section a:focus {
    text-decoration: underline;
}

.back-link {
    align-self: flex-start;
    color: #cbd5f5;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover,
.back-link:focus {
    color: #38bdf8;
}
