/* ----------------------------------------------------------------------------- */
/* Globals --------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------- */

/* Fonts import */

@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* Font classes */

.code {
    font-family: 'Fira Code', monospace;
    font-variant-ligatures: none;
    font-optical-sizing: auto;
    font-style: normal;
    font-size: 12px;
}

/* Box model */

* {
    box-sizing: border-box;
}

/* Global layout */

html {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    font-family: 'Fira Sans', sans-serif;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

body {
    padding: 0;
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

/* Coloring */

html {
    --color-blue-d1: rgb(0, 32, 56);
    --color-blue-l1: rgb(73, 155, 218);
    --color-blue-l2: rgb(148, 180, 204);
    --color-blue-l3-t1: rgba(202, 218, 230, 0.84);
    --color-blue-l3-t2: rgba(202, 218, 230, 0.42);
    --color-blue-l3: rgb(202, 218, 230);
    --color-blue: rgb(0, 75, 133);
    --color-gray-d1: rgb(148, 148, 148);
    --color-gray: rgb(224, 224, 224);
    --color-green-d1: rgb(0, 56, 35);
    --color-green-l1: rgb(0, 200, 117);
    --color-green-t2: rgba(0, 132, 82, 0.42);
    --color-green: rgb(0, 132, 82);
    --color-red-d1: rgb(104, 0, 12);
    --color-red-l1: rgb(255, 77, 79);
    --color-red: rgb(214, 0, 25);
    --color-yellow-d1: rgb(137, 96, 0);
    --color-yellow: rgb(247, 174, 0);
}

.codeXXX {
    border-color: salmon;
    background-color: lightsalmon;
}

.code1XX,
.code2XX {
    border-color: green;
    background-color: lightgreen;
}

.code4XX,
.code5XX {
    border-color: red;
    background-color: lightcoral;
}

.bg-blue {
    background: linear-gradient(90deg, #2196f3, #03a9f4);
}

.bg-green {
    background: linear-gradient(90deg, #4caf50, #8bc34a);
}

.bg-red {
    background: linear-gradient(90deg, #f44336, #e57373);
}

/* ----------------------------------------------------------------------------- */
/* Layout ---------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------- */

/* SPA ------------------------------------------------------------------------- */

/* Layout */

header,
main,
footer {
    display: flex;
    padding: 16px;
    gap: 8px;
}

header,
footer {
    padding-left: 19px;
    padding-right: 19px;
}

header > *,
main > *:not(dialog),
footer > * {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

footer > *:first-child,
header > *:first-child {
    text-align: left;
}

header > *:not(:first-child):not(:last-child),
footer > *:not(:first-child):not(:last-child) {
    text-align: center;
}

header > *:last-child:not(:first-child),
footer > *:last-child:not(:first-child) {
    text-align: right;
}

header > * > *,
footer > * > * {
    margin: 0px;
    padding: 0px;
    position: relative;
}

main {
    flex: 1;
    flex-direction: row;
    position: relative;
}

footer {
    line-height: 14px;
}

/* Format */

header,
footer {
    background-color: var(--color-blue-l2);
    border-style: solid;
    border-color: var(--color-blue-d1);
    border-width: 2px 0;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: gainsboro;
}

*::-webkit-scrollbar-thumb {
    background: gray;
    cursor: default;
}

/* Dialog ---------------------------------------------------------------------- */

/* Layout */

dialog {
    gap: 4px;
    flex-direction: column;
}

dialog[open] {
    display: flex;
}

dialog > * {
    margin: 0;
    padding: 0;
}

dialog.layover {
    top: 0px;
    left: 0px;
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 100px calc(max(100px, 50% - 300px + 12px)) 100px
        calc(max(100px, 50% - 300px + 12px));
    z-index: 10;
    border: none;
    z-index: 200;
}

dialog.layover::before {
    content: '';
    position: absolute;
    top: 84px;
    left: calc(max(84px, 50% - 300px - 2px));
    width: calc(100% - 168px);
    max-width: 600px;
    height: calc(100% - 168px);
    z-index: -1;
}

/* Format */

dialog.layover {
    background-color: var(--color-blue-l3-t1);
}

dialog.layover > *:first-child {
    margin-top: 8px;
}

dialog.layover p {
    text-align: justify;
    margin: 8px 0;
}

dialog.layover::before {
    background-color: white;
    border: 2px solid var(--color-blue-d1);
    border-radius: 4px;
}

/* Flex classes ---------------------------------------------------------------- */

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.flex-gap-0 {
    gap: 0;
}

/* Sizings --------------------------------------------------------------------- */

.padding-top-0 {
    padding-top: 0;
}

.padding-bottom-0 {
    padding-bottom: 0;
}

.h100p {
    height: 100%;
}

.w50p {
    width: 50%;
}

.wmin {
    width: 1px;
    white-space: nowrap;
}

.min700 {
    min-width: 700px;
}

/* Alignments ------------------------------------------------------------------ */

.align-left {
    text-align: left;
}

.align-center {
    text-align: center;
}

.align-right {
    text-align: right;
}

.align-justify {
    text-align: justify;
}

/* ----------------------------------------------------------------------------- */
/* Forms ----------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------- */

/* Layout ---------------------------------------------------------------------- */

form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

form > * {
    margin: 0;
    padding: 0;
}

form > h4 {
    margin: 12px 2px;
}

form > label {
    margin-left: 2px;
}

.row {
    display: flex;
    gap: 4px;
}

.row > button {
    flex: 1;
}

/* Inputs ---------------------------------------------------------------------- */

button,
input,
textarea {
    border: 2px solid var(--color-blue-d1);
    border-radius: 4px;
    padding: 7px;
    font-family: inherit;
}

textarea {
    resize: none;
    overflow: auto;
}

button {
    font-family: inherit;
    font-size: 1em;
    background-color: var(--color-blue-l3);
}

button:hover {
    background-color: var(--color-blue-l2);
}

button:active {
    border-color: var(--color-blue-l1);
}

/* ----------------------------------------------------------------------------- */
/* Formatting ------------------------------------------------------------------ */
/* ----------------------------------------------------------------------------- */

/* Properties ------------------------------------------------------------------ */

.nonvisible {
    visibility: hidden;
}

.unselectable {
    user-select: none;
}

/* Links ----------------------------------------------------------------------- */

a {
    color: black;
    text-decoration: none;
}

a:hover {
    color: var(--color-blue);
}

/* Box Border ------------------------------------------------------------------ */

.box-border {
    border: 2px solid var(--color-blue-d1);
    border-radius: 4px;
}

.box-border > * {
    padding: 0px 8px;
}

.box-border > :first-child:not(dialog) {
    padding-top: 8px;
}

.box-border > :not(dialog):not(:has(~ :not(dialog))) {
    padding-bottom: 8px;
}

/* Tables ---------------------------------------------------------------------- */

/* Layout */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid var(--color-blue-d1);
    border-radius: 4px;
}

table tr {
    height: 32px;
}

table td,
table th {
    padding: 4px;
}

table th:first-child,
table td:first-child {
    padding-left: 6px;
}

table th:last-child,
table td:last-child {
    padding-right: 6px;
}

/* Format */

table thead {
    background-color: var(--color-blue-l3);
}

table thead th {
    border-bottom: 2px solid var(--color-blue-d1);
}

table thead tr:first-child th:first-child {
    border-top-left-radius: 3px;
}

table thead tr:first-child th:last-child {
    border-top-right-radius: 3px;
}

table tbody td {
    border-bottom: 1px solid var(--color-blue-d1);
}

table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 3px;
}

table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 3px;
}

/* Utils ----------------------------------------------------------------------- */

*[tooltip] {
    position: relative;
    cursor: default;
}

*[tooltip]::after {
    content: attr(tooltip);
    position: absolute;
    bottom: 50%;
    right: 50%;
    background: var(--color-blue-l3-t1);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

*[tooltip]:hover::after {
    opacity: 1;
}

/* Effects --------------------------------------------------------------------- */

.pulse-opacity {
    animation: pulse-opacity 0.75s linear infinite;
}

.pulse-opacity:hover {
    animation: none;
}

@keyframes pulse-opacity {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.42;
    }
    100% {
        opacity: 1;
    }
}

.pulse-single-ok {
    animation: pulse-single-ok 0.75s ease;
}

@keyframes pulse-single-ok {
    0% {
        background-color: transparent;
    }
    10% {
        background-color: var(--color-green-t2);
    }
    100% {
        background-color: transparent;
    }
}

/* Progress Bars */

/* .progress-bar {
    background: gainsboro;
    border-radius: 4px;
    height: 21px;
    width: 100%;
    position: relative;
    overflow: hidden;
} */

/* .progress-bar-fill,
.progress-bar-fill-right {
    height: 100%;
} */
/* 
.progress-bar-fill-right {
    position: absolute;
    right: 0;
    left: auto;
} */

/* .progress-bar-label {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    line-height: 21px;
    font-weight: bold;
} */
