/*
 * AliguaOS - Web version
 * (C) Copyright 2016 - Théophile WALTER
 *
 * Made by Théophile WALTER - https://walter.tw
 * Based on design by Augustin WALTER
 *
 * Style of the system and of the applications.
 */

:root {
	/* These values are replaced by the user configuration */
	--desktop-color: #008000;
	--title-color: #C0C0C0;
	--bar-color: #C0C0C0;
	--border-color: #0000FF;
	--accent-color: #8080FF;
	--dialog-color: #000080;
	--font-family: "Trebuchet MS", "Lucida Grande", "DejaVu Sans", Verdana, sans-serif;
	--font-size: 13px;
}

html, body {
	margin: 0;
	padding: 0;
	height: 100%;
}

body {
	overflow: hidden;
	font-family: var(--font-family);
	font-size: var(--font-size);
	color: #000000;
	background-color: #FFFFFF;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	cursor: url(media/cursors/default.png) 0 0, default;
}

img {
	-webkit-user-drag: none;
	image-rendering: pixelated;
}

hr {
	border: none;
	border-top: 1px solid currentColor;
	margin: 6px 0;
}

/* ---------- Boot ---------- */

body.system {
	position: fixed;
	left: 0;
	top: 0;
	width: 100vw;
	height: 100vh;
}

body.console {
	color: #DDDDDD;
	background-color: #000000;
	font-family: "Courier New", Courier, monospace;
	font-size: 16px;
	font-weight: bold;
	cursor: none;
}

body.graphic {
	background-color: var(--desktop-color);
}

#boot-logo {
	position: fixed;
	left: 50%;
	top: 50%;
	margin-left: -32px;
	margin-top: -23px;
}

#shutdown-text {
	position: fixed;
	left: 0;
	top: 45%;
	width: 100%;
	text-align: center;
	color: #FF8000;
}

#fatal-error {
	padding: 30px;
	color: #AA0000;
}

/* ---------- Controls ---------- */

input, select, textarea, button {
	font-family: var(--font-family);
	font-size: var(--font-size);
	color: #000000;
	border-radius: 0;
	outline: none;
	margin: 0;
}

input[type="text"], input[type="password"], select, textarea {
	box-sizing: border-box;
	height: 21px;
	padding: 0 4px;
	background-color: #FFFFFF;
	border: 1px solid #000000;
	box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #C0C0FF;
	cursor: url(media/cursors/text.png) 3 8, text;
}

input[type="text"], input[type="password"] {
	width: 120px;
}

input[type="text"]:disabled, select:disabled {
	color: #808080;
	background-color: #C0C0C0;
	border-color: #808080;
}

select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 18px;
	background-image: url(media/ui/dropdown.png);
	background-repeat: no-repeat;
	background-position: right 1px center;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

input[type="submit"], input[type="button"], button {
	box-sizing: border-box;
	height: 26px;
	min-width: 62px;
	padding: 0 10px;
	font-weight: bold;
	background-color: #C0C0C0;
	border: 1px solid #808080;
	box-shadow: inset 1px 1px 0 #FFFFFF;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

input[type="submit"]:active, input[type="button"]:active, button:active {
	box-shadow: inset 1px 1px 0 #808080;
	padding: 1px 9px 0 11px;
}

input[type="submit"]:disabled, input[type="button"]:disabled, button:disabled {
	color: #808080;
}

input[type="checkbox"], input[type="radio"] {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: 15px;
	height: 15px;
	margin: 0 5px 0 0;
	padding: 0;
	vertical-align: middle;
	background: #FFFFFF center no-repeat;
	border: 1px solid #000000;
	box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #C0C0FF;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

input[type="radio"] {
	border-radius: 50%;
}

input[type="checkbox"]:checked {
	background-image: url(media/ui/check.png);
}

input[type="radio"]:checked {
	background-image: radial-gradient(#000000 0, #000000 3px, transparent 4px);
}

input[type="checkbox"]:disabled, input[type="radio"]:disabled {
	background-color: #C0C0C0;
	border-color: #808080;
}

label {
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

/* Kept for the old programs */
.arround-submit {
	display: inline-block;
}

/* ---------- Scrollbars ---------- */

::-webkit-scrollbar {
	width: 16px;
	height: 16px;
	background-color: #FFFFFF;
}

::-webkit-scrollbar-track {
	background-color: #FFFFFF;
	box-shadow: inset 2px 2px 0 #808080, inset -1px -1px 0 #C0C0C0;
}

::-webkit-scrollbar-thumb {
	background: #C0C0C0 url(media/ui/scroll-grip.png) center no-repeat;
	border: 1px solid;
	border-color: #FFFFFF #808080 #808080 #FFFFFF;
}

::-webkit-scrollbar-button {
	display: none;
}

::-webkit-scrollbar-button:vertical:start:decrement {
	display: block;
	height: 32px;
	background: #C0C0C0 url(media/ui/scroll-up.png) no-repeat;
}

::-webkit-scrollbar-button:vertical:end:increment {
	display: block;
	height: 32px;
	background: #C0C0C0 url(media/ui/scroll-down.png) no-repeat;
}

::-webkit-scrollbar-corner {
	background-color: #C0C0C0;
}

/* ---------- Taskbar ---------- */

#taskbar {
	z-index: 1;
	position: fixed;
	left: 0;
	top: 0;
	width: calc(100% - 4px);
	height: 38px;
	background-color: var(--bar-color);
	border-top: 2px solid #FFFFFF;
	border-left: 2px solid #FFFFFF;
	border-bottom: 2px solid #808080;
	border-right: 2px solid #808080;
}

#arround-taskbar {
	z-index: 1;
	position: fixed;
	left: 0;
	top: 42px;
	width: 100%;
	height: 1px;
	background-color: #000000;
}

#taskbar-right-separator {
	z-index: 1;
	position: fixed;
	right: 96px;
	top: 3px;
}

#taskbar-right-poweroff {
	z-index: 1;
	position: fixed;
	right: 62px;
	top: 5px;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

#taskbar-right-hour {
	z-index: 1;
	position: fixed;
	right: 4px;
	top: 3px;
}

#taskbar-right-hour-content {
	z-index: 1;
	position: fixed;
	right: 4px;
	top: 3px;
	width: 55px;
	height: 36px;
	line-height: 36px;
	text-align: center;
	font-size: 16px;
}

#taskbar-windows-list {
	z-index: 1;
	position: fixed;
	left: 10px;
	right: 106px;
	top: 5px;
	height: 32px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	display: flex;
}

.taskbar-windows-list-element {
	flex: 0 1 auto;
	box-sizing: border-box;
	height: 32px;
	min-width: 34px;
	margin-right: 7px;
	padding: 0 8px 0 3px;
	display: flex;
	align-items: center;
	overflow: hidden;
	white-space: nowrap;
	font-size: 13px;
	background-color: var(--bar-color);
	border: 1px solid;
	border-color: #FFFFFF #000000 #000000 #FFFFFF;
	box-shadow: inset -1px -1px 0 #808080;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

.taskbar-windows-list-element img {
	flex: none;
	max-width: 26px;
	max-height: 26px;
	margin-right: 5px;
}

.taskbar-windows-list-element span {
	overflow: hidden;
	text-overflow: ellipsis;
}

.taskbar-windows-list-element:active {
	padding: 1px 7px 0 4px;
}

.taskbar-windows-list-element.minimized {
	background-image: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15));
}

#taskbar-right-quit {
	display: none;
	z-index: 1;
	position: fixed;
	right: 66px;
	top: 10px;
	height: 20px;
	line-height: 19px;
	padding: 0 6px;
	font-size: 15px;
	font-weight: bold;
	background-color: #FF0000;
	border: 1px solid #000000;
	box-shadow: inset 1px 1px 0 #FFFFFF, inset -1px -1px 0 #800000;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

.taskbar-shortcut {
	flex: none;
	font-weight: bold;
	line-height: 13px;
	text-align: center;
	background-color: var(--accent-color);
	border-color: #000080 #000000 #000000 #000080;
	box-shadow: inset 1px 1px 0 #FFFFFF, inset -1px -1px 0 #000080;
}

.taskbar-shortcut span {
	white-space: normal;
	max-width: 80px;
	overflow: visible;
	font-size: 12px;
}

#left-separator {
	flex: none;
	height: 32px;
	margin-right: 7px;
}

#quick-launch {
	position: fixed;
	min-width: 190px;
	max-height: 70vh;
	overflow-y: auto;
	padding: 2px;
	background-color: #C0C0FF;
	border: 1px solid #000000;
	box-shadow: 2px 2px 0 #204040;
}

.quick-launch-element {
	display: flex;
	align-items: center;
	height: 30px;
	padding: 0 10px 0 4px;
	white-space: nowrap;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

.quick-launch-element img {
	max-width: 26px;
	max-height: 26px;
	margin-right: 8px;
}

.quick-launch-element .quick-launch-icon {
	width: 30px;
	text-align: center;
}

.quick-launch-element:hover {
	background-color: #000000;
	color: #FFFFFF;
}

.quick-launch-separator {
	height: 1px;
	margin: 2px 0;
	background-color: #000000;
}

/* ---------- Desktop ---------- */

#desktop {
	position: fixed;
	left: 0;
	top: 43px;
	width: 100%;
	height: calc(100% - 43px);
	margin: 0;
	padding: 0;
	overflow: hidden;
	image-rendering: pixelated;
}

/* Windows can't catch the mouse while another one is moved */
#desktop.busy iframe {
	pointer-events: none;
}

.desktop-icon {
	position: absolute;
	right: 26px;
	bottom: 16px;
	padding: 4px;
	text-align: center;
	font-size: 16px;
	font-weight: bold;
	border-radius: 6px;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

.desktop-icon img {
	display: block;
	margin: 0 auto 4px auto;
}

/* The names stay readable on a wallpaper */
.desktop-icon span {
	padding: 0 3px;
	background-color: var(--desktop-color);
}

/* Icons put by the user */
.desktop-shortcut {
	right: auto;
	bottom: auto;
	width: 84px;
	padding: 2px 0;
	font-size: 13px;
	line-height: 14px;
	word-wrap: break-word;
	touch-action: none;
}

.desktop-shortcut img {
	max-width: 62px;
	max-height: 62px;
	pointer-events: none;
}

.desktop-shortcut img.desktop-program {
	width: 52px;
	height: 52px;
	object-fit: contain;
}

/* ---------- Windows ---------- */

.window {
	position: absolute;
	display: flex;
	flex-direction: column;
	box-sizing: content-box;
	overflow: hidden;
	border: 1px solid var(--border-color);
	background-color: var(--title-color);
	box-shadow: 2px 2px 0 #204040;
}

.window-topbar {
	flex: none;
	position: relative;
	height: 20px;
	line-height: 20px;
	padding: 0 66px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	text-align: center;
	color: #000000;
	font-size: 15px;
	font-weight: bold;
	cursor: url(media/cursors/move.png) 11 11, move;
}

.window-topbar-buttons {
	position: absolute;
	left: 1px;
	top: 1px;
	height: 18px;
	display: flex;
}

.window-topbar-button {
	display: block;
	margin-right: 2px;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

.window-content {
	flex: 1 1 auto;
	position: relative;
	overflow: hidden;
	min-height: 0;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--border-color);
	background-color: #FFFFFF;
	cursor: url(media/cursors/default.png) 0 0, default;
}

.window-content iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: none;
}

.window-resize {
	position: absolute;
	right: 0;
	bottom: 0;
	cursor: nwse-resize;
}

.window.maximized {
	left: 0 !important;
	top: 0 !important;
	width: 100% !important;
	height: 100% !important;
	border: none;
	box-shadow: none;
}

.window.maximized .window-resize {
	display: none;
}

/* Dialog boxes */
.window.dialog {
	border-color: #FFFFFF;
	background-color: var(--dialog-color);
	box-shadow: 2px 2px 0 #80FF80;
}

.window.dialog .window-topbar {
	color: #FFFFFF;
	font-size: 14px;
	letter-spacing: 1px;
	padding: 0 24px;
}

.window.dialog .window-content {
	border-top-color: #FFFFFF;
	background-color: #000000;
	color: #FFFFFF;
}

body.dialog {
	background-color: #000000;
	color: #FFFFFF;
}

.message-box {
	box-sizing: border-box;
	height: 100%;
	padding: 14px 14px 46px 14px;
	overflow: auto;
	text-align: center;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.message-box input[type="text"] {
	width: 90%;
	margin-top: 10px;
}

.message-box-buttons {
	position: absolute;
	right: 10px;
	bottom: 10px;
}

.message-box-buttons input {
	margin-left: 6px;
}

/* ---------- Applications ---------- */

/* Grey bar with the menus, as in AExplore */
.toolbar {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	min-height: 30px;
	padding: 0 0 0 4px;
	background-color: var(--bar-color);
	border-bottom: 1px solid var(--border-color);
}

.toolbar img {
	display: block;
}

.toolbar-button {
	flex: none;
	margin-right: 2px;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

.toolbar-button.disabled {
	opacity: 0.4;
}

.toolbar-separator {
	flex: none;
	width: 1px;
	height: 24px;
	margin: 0 4px;
	background-color: #808080;
	border-right: 1px solid #FFFFFF;
}

.toolbar-logo {
	flex: none;
	align-self: stretch;
	margin-left: 4px;
	background: #000000 url(media/ui/logo-small.png) center no-repeat;
	width: 37px;
}

.menu-bar {
	flex: 1 1 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	line-height: 14px;
}

.menu-title {
	padding: 0 5px;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

.menu-title.open {
	background-color: #000000;
	color: #FFFFFF;
}

.menu {
	position: fixed;
	z-index: 100;
	min-width: 130px;
	padding: 2px;
	background-color: #C0C0C0;
	border: 1px solid #000000;
	box-shadow: 2px 2px 0 #204040;
}

.menu-element {
	padding: 2px 12px;
	white-space: nowrap;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

.menu-element:hover {
	background-color: #000000;
	color: #FFFFFF;
}

.menu-element.disabled {
	color: #808080;
	pointer-events: none;
}

.menu-separator {
	height: 1px;
	margin: 2px 0;
	background-color: #808080;
}

.statusbar {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	height: 19px;
	padding: 0 20px 0 2px;
	overflow: hidden;
	background-color: var(--bar-color);
	border-top: 1px solid var(--border-color);
	font-size: 12px;
	white-space: nowrap;
}

.statusbar-field {
	height: 15px;
	line-height: 14px;
	margin-right: 4px;
	padding: 0 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	border: 1px solid;
	border-color: #808080 #FFFFFF #FFFFFF #808080;
}

/* Icons, as in AExplore */
.icon-list {
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	padding: 2px 4px;
}

.icon-element {
	box-sizing: border-box;
	width: 72px;
	margin: 1px;
	padding: 3px 1px 2px 1px;
	text-align: center;
	font-size: 12px;
	line-height: 13px;
	word-wrap: break-word;
	background-color: #FFFFFF;
	border-radius: 6px;
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

.icon-element .icon-picture {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	height: 70px;
	margin-bottom: 3px;
}

.icon-element img {
	max-width: 62px;
	max-height: 70px;
}

/* A selected element has its colors inverted */
.selected {
	-webkit-filter: invert(1);
	filter: invert(1);
}

/* ---------- Cursors ---------- */

.cursor-default {
	cursor: url(media/cursors/default.png) 0 0, default;
}

.cursor-pointer {
	cursor: url(media/cursors/pointer.png) 0 0, pointer;
}

.cursor-move {
	cursor: url(media/cursors/move.png) 11 11, move;
}

.cursor-text {
	cursor: url(media/cursors/text.png) 3 8, text;
}

/* The user prefers the cursors of his own computer */
html.system-cursors, html.system-cursors * {
	cursor: auto !important;
}

/* ---------- Looks of the old versions ---------- */

/* Aligua 3.0: colored buttons on the windows, no picture in the menu of the taskbar */
html.theme-3 .window-topbar-buttons, html.theme-2 .window-topbar-buttons {
	left: 0;
	top: 0;
	height: 20px;
}

html.theme-3 .window-topbar-button, html.theme-2 .window-topbar-button {
	height: 20px;
	margin-right: 1px;
}

html.theme-3 .taskbar-shortcut img, html.theme-2 .taskbar-shortcut img {
	display: none;
}

html.theme-3 .taskbar-shortcut, html.theme-2 .taskbar-shortcut {
	padding: 0 10px;
}

html.theme-3 .taskbar-shortcut span, html.theme-2 .taskbar-shortcut span {
	max-width: 96px;
	font-size: 14px;
}

/* Aligua 2.0: grey everywhere, white dialog boxes, "Quit" button */
html.theme-2 .taskbar-shortcut {
	background-color: var(--bar-color);
	border-color: #FFFFFF #000000 #000000 #FFFFFF;
	box-shadow: inset -1px -1px 0 #808080;
}

html.theme-2 #taskbar-right-poweroff, html.theme-2 #taskbar-right-separator {
	display: none;
}

html.theme-2 #taskbar-right-quit {
	display: block;
}

html.theme-2 #taskbar-windows-list {
	right: 150px;
}

html.theme-2 .window {
	border-color: #C0C0C0;
	box-shadow: 1px 1px 0 #808080, -1px -1px 0 #FFFFFF;
}

html.theme-2 .window-topbar {
	color: #FFFFFF;
}

html.theme-2 .window.dialog .window-topbar {
	font-size: 15px;
	letter-spacing: 0;
}

html.theme-2 .window.dialog .window-content {
	border-top-color: #808080;
	background-color: #FFFFFF;
	color: #000000;
}

html.theme-2 body.dialog {
	background-color: #FFFFFF;
	color: #000000;
}

/* Pictures drawn point by point (icons of the programs of the users): no smoothing when they are enlarged */
img[src^="data:image/png"] {
	image-rendering: pixelated;
}
