/* =========================================================
   ENGSTROM OS
   Complete dashboard stylesheet
   ========================================================= */

:root {
    --background: #0d1117;
    --card: #1b2028;
    --card-hover: #202630;
    --border: #303844;
    --input: #303845;

    --text: #f5f7fa;
    --muted: #9ca7b5;

    --green: #18c964;
    --green-dark: #0ea852;
    --red: #ff5f67;
    --yellow: #f5c451;
    --blue: #4aa3ff;

    --radius: 18px;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.4;
}

button,
input,
textarea,
select {
    font: inherit;
}

/* =========================================================
   PAGE
   ========================================================= */

.container {
    width: 95%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 38px 24px 60px;
}

.header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 38px;
}

h1 {
    margin: 0;
    font-size: clamp(42px, 5vw, 68px);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 19px;
}

.statusBadge {
    flex-shrink: 0;
    padding: 13px 22px;
    border-radius: 999px;
    background: var(--green);
    color: #07150d;
    font-size: 17px;
    font-weight: 800;
    box-shadow: 0 0 22px rgba(24, 201, 100, 0.24);
}

/* =========================================================
   GRID AND CARDS
   ========================================================= */

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    align-items: stretch;
}

.card {
    min-width: 0;
    padding: 30px;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.025);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition:
        transform 160ms ease,
        background 160ms ease,
        border-color 160ms ease;
}

.card:hover {
    transform: translateY(-2px);
    background: var(--card-hover);
    border-color: rgba(255, 255, 255, 0.06);
}

.card h2 {
    margin: 0 0 24px;
    font-size: 29px;
    line-height: 1.15;
}

.card h3 {
    margin: 0;
    font-size: 19px;
}

.cardSubtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.cardHeader {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.cardHeader h2 {
    margin-bottom: 0;
}

/* =========================================================
   SYSTEM METRICS
   ========================================================= */

.metric {
    margin-top: 22px;
}

.metric label,
.statLabel {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.metric > div {
    margin-top: 8px;
    font-size: 30px;
    font-weight: 800;
}

.systemInfo {
    margin-top: 26px;
    color: #d7dce3;
}

.systemInfo p {
    margin: 3px 0;
}

/* =========================================================
   PROGRESS BARS
   ========================================================= */

progress {
    display: block;
    width: 100%;
    height: 18px;
    overflow: hidden;
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: var(--input);
}

progress::-webkit-progress-bar {
    background: var(--input);
    border-radius: 999px;
}

progress::-webkit-progress-value {
    background: linear-gradient(
        90deg,
        var(--green),
        #00dd72
    );
    border-radius: 999px;
    transition: width 300ms ease;
}

progress::-moz-progress-bar {
    background: linear-gradient(
        90deg,
        var(--green),
        #00dd72
    );
    border-radius: 999px;
}

/* =========================================================
   STORAGE
   ========================================================= */

.drive {
    margin-bottom: 28px;
}

.drive:last-child {
    margin-bottom: 0;
}

.drive h3 {
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.drive p {
    margin: 8px 0 0;
    color: #c2cad4;
}

/* =========================================================
   MINECRAFT
   ========================================================= */

.minecraftCard {
    border-top: 4px solid var(--green);
}

.statusPill {
    min-width: 105px;
    padding: 8px 13px;
    border-radius: 999px;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
}

.statusChecking {
    background: rgba(245, 196, 81, 0.14);
    color: var(--yellow);
}

.statusOnline {
    background: rgba(24, 201, 100, 0.14);
    color: var(--green);
    box-shadow: inset 0 0 0 1px rgba(24, 201, 100, 0.24);
}

.statusOffline {
    background: rgba(255, 95, 103, 0.14);
    color: var(--red);
    box-shadow: inset 0 0 0 1px rgba(255, 95, 103, 0.22);
}

.minecraftStats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.statBox {
    padding: 16px;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.statBox strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 20px;
}

.minecraftMotd {
    padding: 16px;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.minecraftMotd p {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.minecraftPlayersSection {
    margin-top: 22px;
}

.minecraftPlayersSection h3 {
    margin-bottom: 12px;
}

#minecraftPlayerList {
    min-height: 48px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.minecraftPlayer,
#minecraftPlayerList li {
    margin-bottom: 8px;
    padding: 11px 13px;
    background: rgba(0, 0, 0, 0.14);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.minecraftActions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.minecraftActions .actionLink {
    grid-column: 1 / -1;
}

/* =========================================================
   BUTTONS AND ACTION LINKS
   ========================================================= */

button,
.actionLink {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 11px 15px;
    border: 0;
    border-radius: 10px;
    background: var(--input);
    color: var(--text);
    text-align: center;
    text-decoration: none;
    font-weight: 750;
    cursor: pointer;
    transition:
        background 150ms ease,
        transform 150ms ease,
        opacity 150ms ease;
}

button:hover:not(:disabled),
.actionLink:hover {
    transform: translateY(-1px);
    background: var(--green-dark);
}

button:active:not(:disabled),
.actionLink:active {
    transform: translateY(0);
}

button:disabled {
    color: #7d8794;
    background: #292f38;
    cursor: not-allowed;
    opacity: 0.65;
}

.buttonGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.buttonGrid button {
    width: 100%;
}

/* =========================================================
   SERVICES / INFRASTRUCTURE
   ========================================================= */

.serviceTable {
    width: 100%;
    border-collapse: collapse;
}

.serviceTable td {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    font-size: 17px;
}

.serviceTable tr:last-child td {
    border-bottom: 0;
}

.serviceTable td:last-child {
    text-align: right;
    font-weight: 750;
}

.online {
    color: var(--green);
    font-weight: 800;
}

.offline {
    color: var(--red);
    font-weight: 800;
}

/* =========================================================
   ACTIVITY AND MODULES
   ========================================================= */

#activityLog {
    display: grid;
    gap: 10px;
}

.activityItem {
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.14);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.moduleList {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.moduleList li {
    padding: 11px 13px;
    background: rgba(0, 0, 0, 0.14);
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* =========================================================
   EMPTY / LOADING STATES
   ========================================================= */

.emptyState {
    color: var(--muted);
    font-style: italic;
}

/* =========================================================
   LINKS
   ========================================================= */

a {
    color: var(--text);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(74, 163, 255, 0.65);
    outline-offset: 2px;
}

/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #151a21;
}

::-webkit-scrollbar-thumb {
    background: #3a4553;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--green);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1250px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .container {
        width: 100%;
        padding: 24px 16px 42px;
    }

    .header {
        align-items: flex-start;
        flex-direction: column;
    }

    .statusBadge {
        align-self: stretch;
        text-align: center;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .card {
        padding: 22px;
    }

    .cardHeader {
        flex-direction: column;
    }

    .minecraftStats,
    .buttonGrid {
        grid-template-columns: 1fr;
    }

    .minecraftActions {
        grid-template-columns: 1fr;
    }

    .minecraftActions .actionLink {
        grid-column: auto;
    }
}