:root {
	/* Config start */
	--fontSize: 16px;
	--fontDefault: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
	
	--lightColorBG-page: #f8f8f8;
	--darkColorBG-page: #222;
	
	--lightColorBG-window: #fff;
	--darkColorBG-window: #444;
	
	--lightColorBG-special: #e5e5e5;
	--darkColorBG-special: #555;
	
	--lightColorBG-specialHover: #ccc;
	--darkColorBG-specialHover: #888;
	
	--lightColorBG-footer: #eee;
	--darkColorBG-footer: #333;
	
	--lightColorText: #000;
	--darkColorText: #eee;
	
	--lightColorFooterText: #767676;
	--darkColorFooterText: #ccc;
	
	--lightColorFooterLinkHover: #000;
	--darkColorFooterLinkHover: #fff;
	
	/* Config end */
	
	
	
	--colorBG-page: var(--lightColorBG-page);
	--colorBG-window: var(--lightColorBG-window);
	--colorBG-special: var(--lightColorBG-special);
	--colorBG-specialHover: var(--lightColorBG-specialHover);
	--colorBG-footer: var(--lightColorBG-footer);
	--colorText: var(--lightColorText);
	--colorFooterText: var(--lightColorFooterText);
	--colorFooterLinkHover: var(--lightColorFooterLinkHover);
	
	color-scheme: light dark;
	interpolate-size: allow-keywords;
}

@media (prefers-color-scheme: dark) {
	:root {
		--colorBG-page: var(--darkColorBG-page);
        --colorBG-window: var(--darkColorBG-window);
        --colorBG-special: var(--darkColorBG-special);
        --colorBG-specialHover: var(--darkColorBG-specialHover);
        --colorBG-footer: var(--darkColorBG-footer);
        --colorText: var(--darkColorText);
        --colorFooterText: var(--darkColorFooterText);
        --colorFooterLinkHover: var(--darkColorFooterLinkHover);
	}
	.bodywrapper.theme_light {
		--colorBG-page: var(--lightColorBG-page);
		--colorBG-window: var(--lightColorBG-window);
		--colorBG-special: var(--lightColorBG-special);
		--colorBG-specialHover: var(--lightColorBG-specialHover);
		--colorBG-footer: var(--lightColorBG-footer);
		--colorText: var(--lightColorText);
		--colorFooterText: var(--lightColorFooterText);
		--colorFooterLinkHover: var(--lightColorFooterLinkHover);
		
		color-scheme: light;
	}
}


.bodywrapper.theme_dark {
	--colorBG-page: var(--darkColorBG-page);
	--colorBG-window: var(--darkColorBG-window);
	--colorBG-special: var(--darkColorBG-special);
	--colorBG-specialHover: var(--darkColorBG-specialHover);
	--colorBG-footer: var(--darkColorBG-footer);
	--colorText: var(--darkColorText);
	--colorFooterText: var(--darkColorFooterText);
	--colorFooterLinkHover: var(--darkColorFooterLinkHover);	
	
	color-scheme: dark;
}

* {
	margin: 0;
	padding: 0;
	border: 0;
	box-sizing: border-box;
}

html, body {
    height: 100%;
	font-family: var(--fontDefault);
	color: var(--colorText);
	line-height: var(--fontSize);
	font-size: var(--fontSize);
}

.bodywrapper {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100%;
}

nav {
    box-shadow: 0px 0px 2px #0008;
    z-index: 4;
	background: var(--colorBG-special);
	display: grid;
	grid-template-areas: "logo modules search info" "lang modules search info";
	grid-template-columns: auto 1fr 1fr auto;
    justify-items: center;
	padding: 1rem 2rem;
	position: relative;
}

nav .logo img,
nav .info img {
	height: 2.5rem;
	display: block;
} 

nav .logo {
	grid-area: logo;
	align-content: center;
}

nav .modules {
	grid-area: modules;
	align-content: center;
}

nav .modules * {
	vertical-align: middle;
}

nav .modules select {
    border: 1px solid #888;
    padding: 0.25rem 2rem 0.25rem 0.5rem;
    background: #fff;
    border-radius: 1rem;
    appearance: none;
	font-size: 0.8rem;
	background-image:
		linear-gradient(45deg, transparent 50%, gray 50%),
		linear-gradient(135deg, gray 50%, transparent 50%),
		linear-gradient(to right, #888, #888);
	background-position:
		calc(100% - 0.75rem) calc(0.5rem + 2px),
		calc(100% - 0.5rem) calc(0.5rem + 2px),
		calc(100% - 1.5rem) 0px;
	background-size:
		0.25rem 0.25rem,
		0.25rem 0.25rem,
		1px 1.5rem;
	background-repeat: no-repeat;
}

nav .modules select:focus {
	background-image:
		linear-gradient(135deg, transparent 50%, gray 50%),
		linear-gradient(45deg, gray 50%, transparent 50%),
		linear-gradient(to right, #888, #888);
}

nav .modules img {
	cursor: pointer;
	filter: grayscale(1);
	transition: 100ms filter;
	height: 1.25rem;
    margin-left: 0.5rem;
	width: fit-content;
}

nav .modules img:hover {
	filter: grayscale(0);
}

nav .search {
	grid-area: search;
	align-content: center;
}

nav .searchBar label {
    margin-right: 0.5rem;
	font-size: 0.8rem;
	color: #767676;
}

nav .searchBar {
    position: relative;
    width: max-content;
    white-space: nowrap;
}

nav .searchBar input {
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    border-radius: 1rem;
    border: 1px solid #888;
	font-size: 0.8rem;
}

nav .searchBar button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
	font-size: 0.8rem;
}

nav .info {
	grid-area: info;
	align-content: center;
}

nav .lang {
	grid-area: lang;
	text-align: center;
	padding: 0.5rem;
}

nav .lang img {
	width: 1.5rem;
	height: 1rem;
}

nav .lang a {
	transition: 150ms opacity;
	margin-inline: 0.25rem;
}

nav .lang:has(a:hover) a:not(:hover) {
	opacity: 0.5;
}


nav .allegrocms_top_links {
	display: flex;
	gap: 1rem;
	padding-top: 0.5rem;
}

nav a.allegrocms_top_link,
nav .allegrocms_top_links a,
nav .allegrocms_top_links span {
	color: #767676;
    font-size: 0.8rem;
	text-decoration: none;
	cursor: pointer;
	position: relative;
}

nav a.allegrocms_top_link {
	font-style: italic;
}

nav a.allegrocms_top_link:hover,
nav .allegrocms_top_links a:hover,
nav .allegrocms_top_links span:hover {
	color: #000;
}

nav .allegrocms_top_links a::before,
nav .allegrocms_top_links span::before {
	position: absolute;
	content: "";
	width: 1px;
	height: 100%;
	background: #aaa;
	left: -0.5rem;
}

nav .allegrocms_top_links :first-child::before {
	content: unset;
}

nav .allegro_state_label {
    position: absolute;
    left: 0px;
    top: 0px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    translate: -2rem -2rem;
	pointer-events: none;
}

nav .allegro_state_label_content {
    rotate: -45deg;
    transform-origin: center;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 0.8rem;
    padding-block: 0.25rem;
    height: fit-content;
    box-shadow: 0px 2px 4px #0004;
}

nav .allegro_state_label_content.public {
    background: yellow;
    padding-inline: 1.5rem;
}

nav .allegro_state_label_content.private {
    background: yellowgreen;
    padding-inline: 1.5rem;
}

nav .allegro_state_label_content.offline {
    background: red;
    padding-inline: 2.5rem;
}



main {
    background: var(--colorBG-page);
	overflow: auto;
	display: grid;
    height: 100%;
    grid-template-columns: var(--asidesize, 0px) 0px 1fr;
}

.aside {
    box-shadow: 0px 0px 3px #0008;
    z-index: 2;
}

.asidedrag {
    width: 6px;
    left: -3px;
    position: relative;
    cursor: ew-resize;
	z-index: 3;
}

.mainwindow {
	width: 100%;
	height: 100%;
}

footer {
	display: grid;
	background: var(--colorBG-footer);
    text-align: center;
    box-shadow: 0px 0px 2px #0008;
    z-index: 3;
	color: var(--colorFooterText);
	grid-template-areas: "sizeselection about themeselection";
	grid-template-columns: 1fr auto 1fr;
}

footer .about {
	grid-area: about;
    font-size: 0.75rem;
    padding: 0.25rem;
}

footer .sizeselection {
	grid-area: sizeselection;
	text-align: left;
}

footer .sizeselection span {
	cursor: pointer;
	padding: 0.25rem;
	display: inline-block;
}

footer .themeselection {
	grid-area: themeselection;
	text-align: right;
}

footer .themeselection span {
	cursor: pointer;
	padding: 0.25rem;
	display: inline-block;
}

.bodywrapper.theme_light footer .themeselection span:nth-child(1),
.bodywrapper.theme_dark footer .themeselection span:nth-child(2),
.bodywrapper:not(.theme_light,.theme_dark) footer .themeselection span:nth-child(3) {
	background: var(--colorBG-specialHover);
}

footer a {
    text-decoration: none;
	color: var(--colorFooterText);
}

footer a:hover,
footer .sizeselection span:hover,
footer .themeselection span:hover {
	color: var(--colorFooterLinkHover);
}

.center {
    margin: 0 auto;
}

.contentcenter {
	text-align: center;
}

.window {
    background: var(--colorBG-window);
    width: fit-content;
	margin-top: 5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0px 2px 3px #0008);
    border-radius: 0.5rem;
    grid-column: 3 / 4;
    height: fit-content;
}

.window_title {
    background: var(--colorBG-special);
    border-radius: 0.5rem 0.5rem 0px 0px;
    padding: 0.5rem;
    font-weight: 500;
    border-bottom: 1px solid #8888;
	padding-inline: 1rem;
	color: var(--colorText);
}

.window_content {
	padding: 1rem;
}

.input_label {
    position: relative;
	margin-block: 2rem;
}

.input_label:first-child {
	margin-block: 1.5rem 2rem;
}

.input_label:last-child {
	margin-block: 2rem 0px;
}

.input_label label {
    position: absolute;
    font-size: 0.75rem;
	top: -1.25rem;
    left: 0.5rem;
	color: var(--colorText);
}

.input_label input {
    display: block;
    appearance: none;
    font-size: 1rem;
    line-height: 1.2rem;
    border: 1px solid #8888;
    border-radius: 0.25rem;
    padding: 0.5rem;
    margin-block: 1rem;
    background: var(--colorBG-special);
    color: var(--colorText);
}

.window_content input[type=submit] {
    width: 100%;
    cursor: pointer;
}

.window_content input[type=submit]:hover {
	background: var(--colorBG-specialHover);
}

input.digits {
    text-indent: 0.5rem;
    letter-spacing: 0.5rem;
    font-family: monospace;
    font-weight: bold;
}

input.link {
    appearance: none;
    background: transparent;
    font-size: 0.75rem;
    text-decoration: underline;
    font-weight: 600;
    color: #888;
    cursor: pointer;
}

input.link:hover {
    color: #000;
    text-decoration: none;
}

.loader {
	display: none;
	z-index: 10;
    position: absolute;
	background: #0a0;
    width: 200px;
    height: 5px;
    top: 0px;
    transition: all 1s ease-in-out;
    animation: loaderanimatie 1s infinite linear;
}

@keyframes loaderanimatie {
	0% {
		left: 0px;
		width: 0px;
	}
	25% {
		width: 200px;
	}
	75% {
		width: 200px;
	}
	100% {
		left: 100%;
		width: 0px;
	}
}


.toast {
	position: fixed;
    z-index: 100;
    top: -5rem;
    left: 50%;
    width: fit-content;
    max-width: calc(100% - 6rem);
    transform: translateX(-50%);
    background: #fff;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    padding: 0.5rem 2rem;
    filter: drop-shadow(0px 0px 2px #000);
    transition: 500ms top ease-in-out;
}
.toastcontent {
	position: relative;
    color: #444;
    font-size: 1rem;
    text-align: center;
    font-weight: 400;
    z-index: 101;
}

.toast:has(.toastok) {
    background: #0a0;
}

.toast:has(.toasterror) {
    background: #c00;
}

.toast:has(.toastok) .toastcontent,
.toast:has(.toasterror) .toastcontent {
    color: #fff;
}

.toastcontent i {
    padding-right: 0.5rem;
}
