/* hardhat for glance. same colour names and values as the site
   (website-mockups/hardhat/style.css), so both read as one thing:
   concrete tile, times, no boxes, yellow underlined headings, tables with
   lines and a sign plate on top. the mon-* classes are used by pages/ */

:root {
    --page: #1b1b1b; --tile: url(tile-dark.png);
    --line: #5c5c5c; --well: #222222; --face: #2b2b2b;
    --text: #dcdcdc; --dim: #9a9a9a;
    --link: #66ccff;
    --bar: #f5c400; --bar-text: #111111;
    --ok: #66dd66; --bad: #ff7070; --warn: #f5c400;
    --stripe-a: #f5c400; --stripe-b: #111111;

    /* glance knobs */
    font-size: 10px;
    --font-size-h1: 2.4rem;
    --font-size-h2: 2rem;
    --font-size-h3: 1.9rem;
    --font-size-h4: 1.7rem;
    --font-size-base: 1.7rem;
    --font-size-h5: 1.5rem;
    --font-size-h6: 1.4rem;
    --widget-gap: 26px;
    --widget-content-vertical-padding: 8px;
    --widget-content-horizontal-padding: 0px;
    --border-radius: 0px;
}
:root[data-scheme="light"] {
    --page: #c0c0c0; --tile: url(tile-light.png);
    --line: #555555; --well: #e6e6e6; --face: #adadad;
    --text: #111111; --dim: #444444;
    --link: #0000cc;
    --bar: #222222; --bar-text: #f5c400;
    --ok: #0f5f0f; --bad: #a01010; --warn: #7a5a00;
    --stripe-b: #1a1a1a;
}

html { background: var(--page) var(--tile); }
body {
    background: none;
    color: var(--text);
    font-family: "Times New Roman", Times, serif;
    font-size: var(--font-size-base);
    font-variant-ligatures: normal;
    line-height: 1.4;
}

/* the hazard bar between two lines, like at the top of the site */
body::before {
    content: "";
    display: block;
    height: 24px;
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
    background: repeating-linear-gradient(-45deg, var(--stripe-a) 0 12px, var(--stripe-b) 12px 24px) content-box;
}

/* --- no boxes. the page is one surface --- */

.widget-content:not(.widget-content-frameless), .widget-content-frame {
    background: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
}

/* headings: small capitals on a yellow line, the site sidebar look */
.widget-header {
    padding: 0 0 2px;
    margin-bottom: 4px;
    border-bottom: 3px solid var(--stripe-a);
    box-shadow: 0 1px 0 var(--line);
}
.widget-header h2, .widget-header h2 a {
    font-size: 1.4rem;
    font-weight: normal;
    letter-spacing: 1px;
    color: var(--text);
}

/* top bar: logo, then the tabs as plain words */
.header-container { --header-height: 56px; }
.header { border-bottom: 1px solid var(--line); }
.logo { border-right: 1px solid var(--line); }
.logo img { max-height: 44px; }
.nav-item { font-size: 1.8rem; color: var(--text); border-bottom-width: 3px; }
.nav-item.nav-item-current { border-bottom-color: var(--stripe-a); font-weight: bold; color: var(--text); }
.nav-item:not(.nav-item-current):hover { border-bottom-color: var(--line); color: var(--text); }

a { color: var(--link); }
.color-highlight { color: var(--text); }

/* --- the bits the templates use --- */

.mon-ok   { color: var(--ok); }
.mon-warn { color: var(--warn); font-weight: bold; }
.mon-crit { color: var(--bad); font-weight: bold; }
.mon-dim  { color: var(--dim); }
.mon-small { font-size: 1.4rem; color: var(--dim); }

/* problems: a bar in front of each line, yellow or red */
.mon-problems { list-style: none; margin: 0; padding: 0; }
.mon-problems li { padding: 2px 0 2px 10px; margin: 0 0 4px; border-left: 6px solid var(--warn); }
.mon-problems li.crit { border-left-color: var(--bad); }
.mon-quiet { font-family: Verdana, Geneva, sans-serif; font-weight: bold; color: var(--ok); }

/* tables with lines, like tables used to be */
.mon-table { border-collapse: collapse; width: 100%; }
.mon-table th, .mon-table td {
    padding: 3px 8px;
    text-align: left;
    vertical-align: top;
    border: 1px solid var(--line);
    background: var(--well);
}
.mon-table th {
    background: var(--bar);
    color: var(--bar-text);
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    font-weight: bold;
}
.mon-table td.num { text-align: right; }
.mon-table.tight th, .mon-table.tight td { padding: 3px 5px; white-space: nowrap; }
.mon-row-off td { color: var(--warn); }
.mon-row-dim td { color: var(--dim); }

/* the storage gauge from the site: striped fill in a thin frame */
.mon-meter { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.mon-meter > span:first-child { width: 8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-meter > span:last-child { width: 3.2em; text-align: right; }
.mon-gauge { flex: 1; height: 16px; padding: 2px; border: 1px solid var(--line); background: var(--well); }
.mon-gauge > i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--ok) 0 8px, transparent 8px 10px); }
.mon-gauge > i.warn { background: repeating-linear-gradient(90deg, var(--warn) 0 8px, transparent 8px 10px); }
.mon-gauge > i.crit { background: repeating-linear-gradient(90deg, var(--bad) 0 8px, transparent 8px 10px); }

/* service tiles: a word on green or on red */
.mon-tiles { margin: 2px 0 6px; }
.mon-tiles b { display: inline-block; width: 3.6em; font-weight: normal; font-size: 1.3rem; text-transform: uppercase; color: var(--dim); }
.mon-tile { display: inline-block; margin: 0 3px 4px 0; padding: 0 6px; font-size: 1.5rem; color: #111111; background: #66dd66; }
.mon-tile.down { color: #ffffff; background: #c01818; font-weight: bold; }

/* drive bays. sff stand upright, lff lie flat. a bay is a little sign */
.mon-chassis { margin: 0 0 14px; }
.mon-chassis-name { margin-bottom: 4px; }
.mon-bays { display: inline-grid; gap: 4px; padding: 6px; border: 1px solid var(--line); background: var(--stripe-b); max-width: 100%; }
.mon-bays.sff { grid-template-columns: repeat(var(--cols), minmax(0, 96px)); }
.mon-bays.lff { grid-template-columns: repeat(var(--cols), minmax(0, 190px)); }
.mon-bays.sff2 { grid-template-columns: repeat(var(--cols), minmax(0, 150px)); }
.mon-bays.by-column { grid-template-rows: repeat(var(--rows), auto); grid-auto-flow: column; }
.mon-bay {
    padding: 3px 5px;
    font-size: 1.3rem;
    line-height: 1.25;
    color: #111111;
    background: #66dd66;
    border-left: 6px solid #2f7f2f;
    overflow: hidden;
}
.mon-bays.sff .mon-bay { min-height: 92px; }
.mon-bays.lff .mon-bay { min-height: 46px; }
.mon-bays.sff2 .mon-bay { min-height: 46px; }
a.mon-bay { display: block; text-decoration: none; }
a.mon-bay[href]:hover { outline: 3px solid var(--stripe-a); outline-offset: -3px; }
.mon-bay b { display: block; }
.mon-bay.bad { background: #c01818; color: #ffffff; border-left-color: #600; }
.mon-bay.missing { background: repeating-linear-gradient(-45deg, var(--stripe-a) 0 8px, var(--stripe-b) 8px 16px); color: #111111; }
.mon-bay.missing b { background: var(--stripe-a); display: inline-block; padding: 0 3px; }
.mon-bay.empty { background: var(--face); color: var(--dim); border-left-color: var(--line); }

/* --- the name in the top bar, where glance had its logo. like the
   site name on the site: italic, bold, big --- */
.logo {
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    font-weight: bold;
    font-size: 2.8rem;
    color: var(--text);
    padding-right: 16px;
}

/* --- the footer is only for the login page --- */
body:not(:has(#login-container)) .footer { display: none; }

/* --- login, made to look like the webmail sign-in page: the name of the
   place on the left, a link home on the right, the hazard bar under it,
   then a small form with a grey title plate, labels left of the fields.
   glances own markup stays, only the looks change --- */
body:has(#login-container)::before { display: none; }
body:has(#login-container) .body-content > .grow { align-items: flex-start; padding: 12px 0 0 !important; }
body:has(#login-container) .footer {
    order: -1;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: left;
    color: var(--text);
}
.mon-login-top {
    height: 40px;
    line-height: 40px;
    padding: 0 8px;
    font-size: 28px;
    white-space: nowrap;
    overflow: hidden;
}
.mon-login-home { float: right; font-size: 16px; color: var(--link); }
.mon-login-bar {
    height: 24px;
    padding: 4px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: repeating-linear-gradient(-45deg, var(--stripe-a) 0 12px, var(--stripe-b) 12px 24px) content-box;
}

#login-container { max-width: 350px; padding: 0; font-size: 16px; }
#login-container::before {
    content: "512mb Monitoring Login";
    display: block;
    padding: 1px 0;
    margin-bottom: 4px;
    text-align: center;
    font-weight: bold;
    background: var(--face);
}
#login-container .animate-entrance { animation: none; display: flex; align-items: center; margin: 3px 0; }
#login-container .form-label {
    flex: 0 0 30%;
    margin: 0;
    padding: 0 4px 0 0;
    border: 0;
    box-shadow: none;
    justify-content: flex-end;
    text-align: right;
    text-transform: none;
    font-size: 0;
    letter-spacing: 0;
}
#login-container .form-label[for="username"]::after { content: "Name:"; font-size: 16px; }
#login-container .form-label[for="password"]::after { content: "Password:"; font-size: 16px; }
#login-container .form-input {
    flex: 0 0 200px;
    padding: 0;
    gap: 0;
    background: var(--well);
    border: 1px solid var(--line);
}
#login-container .form-input:focus-within { outline: 2px solid var(--text); border-color: var(--text); }
#login-container .form-input input {
    height: 22px;
    padding: 1px 3px;
    font-family: "Times New Roman", Times, serif;
    font-size: 16px;
    letter-spacing: 0;
    color: var(--text);
}
#login-container .form-input input::placeholder { color: transparent; }
#login-container .form-input-icon, #login-container .toggle-password-visibility { display: none; }
#login-container .login-error-message:not(:empty) { margin: 6px 0; text-align: center; color: var(--bad); }
#login-container .login-button {
    width: auto;
    margin: 6px auto 0;
    padding: 2px 10px;
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    background: var(--face);
    color: var(--text);
    font-family: "Times New Roman", Times, serif;
    font-size: 0;
    gap: 0;
}
#login-container .login-button::after { content: "Login"; font-size: 16px; }
#login-container .login-button svg { display: none; }
#login-container .login-button:hover:not(:disabled) { background: var(--stripe-a); color: #111111; }

/* --- no fading in. things are just there, like on the site --- */
.footer,
.login-error-message,
.animate-entrance,
.page.content-ready > .page-content,
.page-loading-container { animation: none !important; }
.login-error-message::before { display: none; }
