/* ============================== Base Styles ============================== */
:root {
    --input-border-color-a: #777;
    --input-border-color-b: #444;
    --input-background-color: #101010;
    --input-text-color: white;
    --ui-font: 'Noto Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --code-font: 'Cascadia Code', 'Hack', 'Fira Code', 'Consolas', 'Courier New', monospace;
}

html {
    background-color: #222;
    color: #ddd;
    font-family: var(--ui-font);
}

body {
    margin-top: 0;
    margin-left: 2em;
    margin-right: 2em;
    padding: 0;
}

a {
    color: rgb(25, 238, 209);
}

a:visited {
    color: rgb(57, 197, 178);
}

#wrap {
    padding: 1.5em;
    max-width: 2200px;
    margin-left: auto;
    margin-right: auto;

    border: 1px solid #444;
    background-color: #303030;
    border-radius: 0.3em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
}

/* Header bar to make it obvious what server you're connected to */
#main-header {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin-bottom: 1em;
}
#main-header > h1 {
    margin: 0;
    padding: 0.3em 0.6em;
    min-width: 75%;

    border: 1px solid rgba(255, 255, 255, 0.25);
    border-top: none;
    border-radius: 0 0 0.6em 0.6em;
    box-shadow: 0 0 0.5em rgba(0, 0, 0, 0.25);

    background-color: rgb(0, 0, 0); /* default background color if not specified */
    
    font-size: 18px;
    font-weight: normal;
    text-align: center;
}

#main-menu > ul {
    list-style-type: none;
    margin: 0;
    padding: 0;

    display: flex;
    flex-direction: row;
    justify-content: right;
    gap: 1em;
}

header.ose {
    display: flex;
    flex-direction: row;
    width: 100%;
}

header.ose > h1 {
    margin-top: 0;
    flex-grow: 1;
}

header.ose > .right {
    align-self: center;
    justify-self: center;
    text-align: right;
}

/* Optional overlay block that templates can use to put fixed overlay content (like a websockets connection indicator) */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

/* Buttons */
button,
a.button,
input[type='button'],
input[type='submit'] {
    box-sizing: border-box;

    font-size: 14px;
    color: var(--input-text-color);
    background-color: var(--input-background-color);
    padding: 0.4em 1em;
    border-radius: 0.4em;

    border-top: 2px solid var(--input-border-color-a);
    border-left: 2px solid var(--input-border-color-a);
    border-bottom: 2px solid var(--input-border-color-b);
    border-right: 2px solid var(--input-border-color-b);
}

a.button {
    display: inline-block;
}

button:disabled,
a.button:disabled,
input[type='button']:disabled,
input[type='submit']:disabled {
    opacity: 0.8;
    color: #aaa;

    --input-border-color-a: #666;
    --input-border-color-b: #333;
}

button:active:not(:disabled),
a.button:active:not(:disabled),
input[type='button']:active:not(:disabled),
input[type='submit']:active:not(:disabled) {
    border-top-color: var(--input-border-color-b);
    border-left-color: var(--input-border-color-b);
    border-bottom-color: var(--input-border-color-a);
    border-right-color: var(--input-border-color-a);
}

/* Text Input */
input[type='text'],
input[type='password'],
select {
    font-size: 14px;
    color: var(--input-text-color);
    background-color: var(--input-background-color);

    box-sizing: border-box;
    border: 2px solid var(--input-border-color-a);
    padding: 0.3em 0.5em;
}

/* ============================== Forms ============================== */

.ose-form {
    display: grid;
    grid-template-columns: 1fr 2fr;

    gap: 0.5em;
    margin-top: 0.4em;
    margin-bottom: 0.4em;
}

.ose-form > .label {
    grid-column: 1;
    min-width: 10em;
    font-size: 13px;
    flex-grow: 1;
}

.ose-form > .input {
    grid-column: 2;
}

.ose-form > .input > input,
.ose-form > .input > select,
.ose-form > .input > textarea {
    width: 100%;
}

/* ============================== Modal Dialogs ============================== */
dialog.ose {
    position: fixed;
    top: 50px;
    min-width: min(600px, 50vw);
    max-width: calc(100vw - 100px);
    max-height: calc(100vh - 100px);
    background: black;
    color: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 0 40px black;

    flex-direction: column;
}

dialog.ose .content {
    flex-grow: 1;

    display: flex;
    flex-direction: column;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 75vh;
}

dialog.ose.visible {
    display: flex;
}

dialog.ose > .top-right {
    position: absolute;
    top: 10px;
    right: 10px;
}

dialog.ose > h1 {
    margin-top: 0;
}
