﻿/* Core layout */
html, body, #app {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    font-family: var(--mud-typography-default-family);
}

.mud-container {
    flex-grow: 1;
}

/* 2) Use the MudBlazor CSS variables for background & text */
body {
    margin: 0;
    background-color: var(--mud-palette-background) !important;
    color: var(--mud-palette-text-primary) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.main-content, .hero-section, .service-section {
    flex: 0 0 auto;
}


/* Map */
#mapContainer {
    height: 300px;
    width: 100%;
    border-radius: var(--mud-shape-default);
}

.perc {
    font-variant-numeric: tabular-nums;
}

.hrow {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: #a0a7ba;
}

.number {
    width: 64px;
    background: #1a2030;
    color: var(--ink);
    border: 1px solid #2b3242;
    border-radius: 10px;
    padding: 4px 6px;
}

@media (max-width: 900px) {
    .chemRow {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

/* Per-column stack: fixed segment heights for alignment */
:root {
    --chemH: 40px;
    --pumpH: 50px;
    --tankH: 300px;
}


.muted {
    color: #a0a7ba;
    opacity: .85;
}


.sliderV {
    width: calc(100% - 12px);
    margin: calc(var(--jugH) - 70px) 6px 0 6px;
}

.title {
    font-size: 12px;
    color: #a0a7ba;
    margin-top: 6px;
}

.meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #a0a7ba;
}

.val {
    font-weight: 700;
    color: var(--ink);
}

/* grid: pack tighter for shorter tanks */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
    gap: var(--gap);
    justify-items: center;
}

/* 3) MudLayout regions */
.mud-layout {
    background-color: var(--mud-palette-background) !important;
}

.mud-main-content {
    background-color: var(--mud-palette-background) !important;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .25rem; /* tighter */
}

/* Reduce “heavy” look of all Papers slightly */
:root {
    --mud-elevation-1: 0 2px 10px rgba(0,0,0,.06);
}

.mud-grid, .mud-item {
    margin: 0 !important;
    padding: 0 !important;
}

/* 4) Links should also adapt to your primary colour */
a {
    color: var(--mud-palette-primary);
}

/* 5) If you need the AppBar/Drawer outside of MudLayout to pick up colours: */
.mud-appbar .mud-breadcrumbs,
.mud-appbar .mud-breadcrumbs a,
.mud-appbar .mud-breadcrumbs .mud-breadcrumb-separator {
    color: var(--mud-palette-appbar-text) !important;
}


.mud-appbar .mud-breadcrumbs a:hover {
    color: var(--mud-palette-appbar-text) !important;
}

/* make the drawer itself use the “surface” colour (white in light, dark‐grey in dark) */
.mud-drawer {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}

/* if you want the icons in the drawer to follow the text color */
.mud-drawer .mud-icon-root {
    color: var(--mud-palette-drawer-icon) !important;
}

/* and links or buttons inside the drawer */
.mud-drawer a,
.mud-drawer .mud-nav-link,
.mud-drawer .mud-list-item {
    color: var(--mud-palette-text-primary) !important;
}


/* 5) Cards & Papers (if you want surface-level containers to be your “surface” color) */
.mud-card, .mud-paper {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}

/* 6) Links */
a {
    color: var(--mud-palette-primary);
}

/* 7) Tables, inputs, etc (optional: pick up surface & text colors) */
.mud-table, .mud-input-slot {
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}

/* Only apply inside a MudThemeProvider (your main app) */
.mud-theme-provider-root body {
    background-color: var(--mud-palette-background) !important;
    color: var(--mud-palette-text-primary) !important;
}

.mud-theme-provider-root .mud-layout,
.mud-theme-provider-root .mud-main-content {
    background-color: var(--mud-palette-background) !important;
}

.mud-theme-provider-root .mud-card,
.mud-theme-provider-root .mud-paper {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}

.mud-theme-provider-root .mud-drawer {
    background-color: var(--mud-palette-drawer-background) !important;
    color: var(--mud-palette-drawer-text) !important;
}

.page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-layout {
    display: flex;
    flex: 1;
}

.content {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
}

.sidebar {
    width: 250px;
    height: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.mud-tabs .mud-tab-panel .mud-tab-button {
    justify-content: flex-end; /* Align the tab icons to the right */
}

.vnc-screen {
    position: relative;
    width: 100%;
    height: 80vh; /* or any height you want your VNC canvas to fill */
    background-color: #000; /* optional, looks nicer */
    overflow: hidden;
}

.vnc-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; /* stack items vertically */
    align-items: center; /* center horizontally */
    justify-content: center; /* center vertically */

    background-color: rgba(0, 0, 0, 0.5); /* optional dark overlay */
    text-align: center;
    z-index: 10;
}

/* ---- Mobile visibility patch ---- */
@media (max-width: 768px) {
    /* 1) Readable typography */
    body {
        font-size: 16.5px;
        line-height: 1.55;
        -webkit-text-size-adjust: 100%;
    }

    h1, .mud-typography-h1 {
        font-size: 1.85rem;
        line-height: 1.2;
        text-wrap: balance;
    }

    h2, .mud-typography-h2 {
        font-size: 1.55rem;
        line-height: 1.25;
        text-wrap: balance;
    }

    h3, .mud-typography-h3 {
        font-size: 1.32rem;
        line-height: 1.3;
        text-wrap: balance;
    }

    .mud-typography-subtitle1 {
        font-size: 1rem;
        line-height: 1.45;
    }

    /* 2) Restore gutters & container padding */
    .mud-container {
        padding-left: 12px;
        padding-right: 12px;
        flex-grow: 0 !important;
    }
    /* override the global 0-gutters without breaking other sides */
    .mud-grid {
        margin-left: -6px !important;
        margin-right: -6px !important;
    }

    .mud-item {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    /* 3) Tap targets */
    .mud-button {
        min-height: 44px;
        padding-inline: 14px;
    }

    .mud-icon-button {
        width: 44px;
        height: 44px;
    }

    .mud-card, .mud-paper {
        background: var(--mud-palette-surface);
    }

    /* 5) App bar breathing room */
    .mud-appbar {
        padding-inline: 6px;
    }

    /* 6) Media safety */
    img, video {
        max-width: 100%;
        height: auto;
    }

    .mud-table-root .mud-table-head {
        display: none !important;
    }

    /* turn rows into cards */
    .mud-table-root .mud-table-container table {
        display: block !important;
        width: 100%;
    }

    .mud-table-root .mud-table-body {
        display: grid;
        gap: 12px;
    }

    .mud-table-root .mud-table-row {
        display: grid;
        background: var(--mud-palette-surface);
        border: 1px solid var(--mud-palette-divider);
        border-radius: 12px;
        padding: 10px 12px;
        box-shadow: var(--mud-elevation-1);
    }

    /* label/value layout using DataLabel on each MudTd */
    .mud-table-root .mud-table-cell {
        display: grid;
        grid-template-columns: minmax(96px, 40%) 1fr;
        align-items: start;
        padding: 6px 0; /* slightly tighter */
    }

    .mud-table-root .mud-table-cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--mud-palette-text-secondary);
        margin-right: 10px;
    }
}

/* Very narrow phones */
@media (max-width: 380px) {
    body {
        font-size: 16px;
    }
}