@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital@0&family=Roboto+Mono:wght@400;700&display=swap');

:root {
    --dark-background: #111;
    --overall-background: #222;
    --overall-background-light: #555;
    --content-background: #333;
    
    --text-color: #fff;
    --link-color: #0090a3;
    --link-highlight: #00bcd4;
    --link-darken: #007f8b;
    
    --button-color: #10786f;
    --button-highlight: #1ccebe;
    --button-depressed: #0c5751;
    
    --field-color: #555;
    --field-color-light: #777;
    --field-highlight: #777;
    --field-highlight-light: #999;
    --field-readonly-color: #333;
    --field-readonly-color-light: #555;
    
    --danger-cancel-color: #a22;
    --danger-cancel-darken-color: #f22;
    
    /* --secondary-button-color: var(--field-color); */
    /* --secondary-button-highlight: var(--field-color-light); */
    /* --secondary-button-depressed: #333; */
    
    /* --secondary-button-color: #6a6a6a; */
    /* --secondary-button-highlight: #b7b7b7; */
    /* --secondary-button-depressed: #4d4d4d; */
    
    --secondary-button-color: #7b6092;
    --secondary-button-highlight: #d2a6fb;
    --secondary-button-depressed: #5a456a;
    
    --global-radius: 8px;
    --global-radius-small: 3px;
}

body, html, nav ul, h1 {
	margin: 0;
	padding: 0;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

main > * {
    margin: 0;
}

main ul > li + li {
    padding-top: 0.6em;
}

nav, nav ul, .input-holder {
	display: flex;
}
.input-holder {
    flex-direction: column;
    /* justify-content: center; */
    /* flex-wrap: wrap; */
    max-width: 500px;
    padding: 5px;
    gap: 5px;
}
.input-holder > * {
    /* display: block; */
}

footer, header {
	text-align: center;
	background-color: var(--overall-background);
	padding: 5px;
}
header {
    padding-top: 15px;
}

footer, header, nav {
	background-color: var(--overall-background);
}

button, body, h1, h2, h3, html, nav a, nav a:hover, nav a:visited {
	color: var(--text-color);
}

a, a:visited {
    color: var(--link-color);
}

code, a:hover {
	color: var(--link-highlight);
}

body, html {
	background-color: var(--dark-background);
}

body, html, input, textarea, button {
    font-family: "Open Sans", Arial, sans-serif;
}

nav {
	justify-content: center;
    /* padding: 16px 0; */
}

nav ul {
	list-style-type: none;
}

nav li {
}

nav a {
    background: var(--overall-background);
    text-align: center;
	padding: 16px;
    display: inline-block;
    width: 80px;
	text-decoration: none;
	font-weight: 700;
}

nav a, .hoverable {
    cursor: pointer;
	transition: background 0.2s ease-in-out, color 0.3s ease-in-out;
}

nav a:hover, .hoverable:hover {
    background: var(--overall-background-light);
}

code, pre, button.symbol, .mono {
    font-family: "Roboto Mono", "Consolas", monospace;
}

.hidden {
    display: none;
}

.container {
	padding: 20px;
	max-width: 1200px;
	margin: 20px auto;
	background-color: var(--content-background);
	border-radius: var(--global-radius);
	box-shadow: 0 0 10px rgba(0, 0, 0, .5);
}
.container.thin {
    max-width: 600px;
}

.secondary {
    --button-color: var(--secondary-button-color);
    --button-highlight: var(--secondary-button-highlight);
    --button-depressed: var(--secondary-button-depressed);
}

.button-row {
    display: flex;
    flex-direction: row;
}
.button-row button, .button-row .label-button {
    flex: 1;
    margin: 0 5px;
}
.button-row.segmented {
    background-color: var(--button-depressed);
    padding: 3px;
    gap: 3px;
    border-radius: var(--global-radius);
}
.button-row.segmented > * {
    border-radius: 0px;
    margin: 0;
}
.button-row.segmented > *:first-child {
    border-top-left-radius: var(--global-radius);
    border-bottom-left-radius: var(--global-radius);
}
.button-row.segmented > *:last-child {
    border-top-right-radius: var(--global-radius);
    border-bottom-right-radius: var(--global-radius);
}

.centerer {
    display: flex;
    justify-content: center;
    position: relative; /* to allow this as a stacking context for the settings button */
    /* flex-direction: column; */
}
.centerer h1, .centerer h2, .centerer h3, .centerer hgroup {
    text-align: center;
}

hgroup :is(h1, h2, h3):has(+ *) {
    margin-bottom: 0;
}
hgroup p {
    margin-top: 0;
    font-style: italic;
}

details {
    margin: 0;
}
details > summary {
    user-select: none;
    cursor: pointer;
}

button, .toast, .label-button {
    text-align: center;
	background-color: var(--button-color);
	padding: 10px 20px;
	border: none;
	border-radius: var(--global-radius);
	cursor: pointer;
}
.toast {
    cursor: auto;
    display: flex;
    align-items: center;
}
.toast.cancellable {
    cursor: pointer;
}
.toast .cancel-button {
    margin-left: 15px;
    margin-right: -5px;
    font-size: 0.8em;
}
.label-button > input[type=radio] {
    appearance: none;
}
.label-button:has(> input[type=radio]:checked) {
    outline: 3px solid var(--button-highlight);
    outline-offset: -3px;
    /* simple alternative */
    /* background-color: var(--button-highlight); */
}

button, .label-button {
	transition: background-color .3s;
}
button.depressed {
	transition: background-color .3s, outline .1s;
    outline-width: 0px;
    outline-style: solid;
    outline-color: var(--button-depressed);
    outline-offset: -5px;
}

button:hover, button.depressed, .toast.cancellable:hover, .label-button:hover {
	background-color: var(--button-highlight);
}
button.depressed {
    outline-width: 5px;
}
button.symbol {
    font-size: 1.2em;
    width: 60px;
}
button.symbol, input[type="color"] {
    height: 45px;
}
.color-input {
    display: flex;
}
.color-input > * {
    margin: 5px;
}

button.danger, .label-button.danger {
    background: var(--danger-cancel-color);
}
button.danger:hover, .label-button.danger:hover {
    background: var(--danger-cancel-darken-color);
}

p {
	line-height: 1.5;
}

code {
	background-color: #444;
	padding: 2px 5px;
	border-radius: var(--global-radius);
}


table {
    /* width: 100%; */
    border-collapse: collapse;
}

tr {
    vertical-align: middle;
}

td {
    padding: 10px;
}
td:first-child {
    text-align: right;
}
td:last-child {
    text-align: left;
}

input, button, textarea, .label-button {
    font-size: 16px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="color"],
textarea,
select {
    background-color: var(--field-color);
    border: 3px solid var(--field-color-light);
    color: var(--text-color);
    padding: 3px;
    border-radius: var(--global-radius);
    /* width: 100%; */
    transition: border-color 0.3s, background-color 0.3s;
}
/* css sucks and this doesn't work */
select option:hover {
    background-color: var(--field-color-light) !important;
}
textarea {
    resize: none;
    width: 100%;
    box-sizing: border-box;
}
textarea.resizeable {
    resize: vertical;
    min-height: 16em;
}
input[type="color"] {
    padding: 6px;
    cursor: pointer;
}
input[type="color"]:hover {
    background-color: var(--field-highlight);
    border-color: var(--field-highlight-light);
}
input.short {
    width: 10ch;
}
input.medium {
    width: 15ch;
}
input.wide {
    width: 20ch;
}
input.fullwidth {
    width: 80%;
}
input.center {
    text-align: center;
}
input[readonly], textarea[readonly] {
    background-color: var(--field-readonly-color);
    border-color: var(--field-readonly-color-light);
}
label {
    user-select: none;
}

/* popup related */
.popup-background {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--content-background);
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--overall-background-light);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.popup-title {
    font-size: 18px;
    font-weight: bold;
}

.popup-content {
    font-size: 16px;
}

.interact-box {
    /* width: calc(100% - 20px); */
    height: 250px;
    border: 1px solid;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5em;
    /* transition: background-color 200ms; */
}
.interact-box.moving {
    background-color: rgba(51, 0, 145, 1.0);
}
.interact-box.stopped {
    background-color: rgba(51, 0, 145, 0.2);
}
.messages {
    max-height: 200px;
    min-height: 100px;
    border: 1px solid;
    overflow-y: auto;
    padding: 5px;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    /* justify-content: center; */
}

.toast {
	transition: background-color .3s, opacity .5s;
    margin: 5px 0;
    opacity: 0;
    user-select: none;
}
.toast.showing {
    opacity: 1;
}

.indicator-holder {
    --indicator-margin-width-default: 5px;
    --base-color: var(--dark-background);
    --off-color: #777777;
    --on-color: #dddddd;
    font-size: var(--indicator-font-size, 1em);
    width: 1em;
    height: 1.6em;
    background-color: var(--base-color);
    display: inline-flex;
    flex-direction: column;
    box-sizing: border-box;
    gap: var(--indicator-margin-width, var(--indicator-margin-width-default));
    padding: var(--indicator-margin-width, var(--indicator-margin-width-default));
}
.indicator-holder.horizontal {
    flex-direction: row-reverse;
    width: 1.6em;
    height: 1em;
}
.indicator-holder.low {
    --base-color: #441111;
    --off-color: #886666;
    --on-color: #ffaaaa;
}
.indicator-holder.medium {
    --base-color: #444411;
    --off-color: #888866;
    --on-color: #ffffaa;
}
.indicator-holder.high {
    --base-color: #114411;
    --off-color: #668866;
    --on-color: #ccffcc;
}
.indicator-level {
    background-color: var(--off-color);
    flex-grow: 1;
}
.indicator-level.status-on, .indicator-level.status-on ~ .indicator-level {
    background-color: var(--on-color);
}

.extra-options {
    position: absolute;
    top: 0;
    right: 0;
}
.settings-icon {
    font-size: 20px;
}
.popout-tray {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
}
.popout-tray-data {
    display: none;
    border: 3px solid var(--dark-background);
    background-color: var(--content-background);
    padding: 5px;
    border-radius: 7px;
}
.popout-tray-data.showing {
    display: block;
}

.probability-indicator {
    --indicator-font-size: 32px;
    --indicator-margin-width: 3px;
}

.onionring {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    font-size: 0.8em;
    margin: 20px auto;
}
.onionring > table, .onionring > div {
    background-color: var(--overall-background);
    border-radius: var(--global-radius);
    padding: 5px;
    display: block;
}

/* mobile-only settings */
@media (max-width:768px) {
	.container {
		padding: 10px;
	}
    .popup {
        left: 0;
        top: 50%;
        transform: translate(0, -50%);
    }
    .extra-options {
        position: fixed;
        top: 10px;
        right: 10px;
    }
    .probability-indicator {
        --indicator-font-size: 26px;
        --indicator-margin-width: 3px;
    }
    td {
        padding: 10px;
        padding: 5px;
    }
    .button-row.control {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--content-background);
    }
}
