@mixin unselectable {
	user-select: none;
	-ms-user-select: none;
	-moz-user-select: none;
	-webkit-user-select: none;
}

.viewManager {
	width: 100%;
}

.windowManager {
	position: absolute;
	left: 0px;
	right: 0px;
	top: 0px;
	bottom: 0px;

	display: grid;
	grid-template-rows: auto 1fr;

	.windowSpace {
		position: relative;
	}

	.fixedAreas {
		position: absolute;
		top: 0px;
		bottom: 0px;
		left: 0px;
		right: 0px;
		display: flex;

		.sidebar {
			// position: absolute;
			// top: 0px;
			// bottom: 0px;
			min-width: 80px;
			// height: 100%;
			// overflow-x: hidden;
			overflow-y: auto;

			background-color: rgba(0, 0, 0, 0.5);
			border-color: rgb(18, 27, 38);
			border-width: 1px;

			&.side-left {
				left: 0px;
				border-right-style: solid;
			}

			&.side-right {
				right: 0px;
				border-left-style: solid;
				margin-left: auto;
			}

			&.highlight {
				background-color: rgba(9, 14, 54, 0.5);
				border-color: rgb(13, 76, 153);
			}

			.window {
				position: static;
				/* FIXME: Below 19px should become 9px, once there's a way to account for the scrollbar that may be visible. */
				margin: 0px 19px 12px 9px;
			}
		}
	}
}

.window {
	position: fixed;
	left: 0px;
	top: 0px;

	display: grid;
	grid-template-rows: auto 1fr;

	box-shadow: 5px 5px 10px #1a1a1a;
	opacity: 0.95;

	&, .titleBar {
		border-top-left-radius: 10px;
		border-top-right-radius: 10px;
	}

	.titleBar {
		display: grid;
		grid-template-columns: 1fr auto;

		@include unselectable;
		cursor: default;

		border: 1px solid #959595;
		border-bottom: none;

		padding: 4px;
		padding-left: 7px;

		background: linear-gradient(
			to bottom,
			rgb(82,82,82) 0%,
			rgb(145,172,190) 100%
		);

		.title {
			padding-top: 1px;

			color: white;
			font-size: 14px;
			font-weight: bold;

			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}

		.buttons {
			display: flex;

			margin-left: 8px;

			.button {
				padding: 2px;

				border: 1px solid rgb(82, 99, 113);
				border-radius: 5px;

				color: white;
				font-weight: bold;

				&:hover {
					background-color: rgb(85, 95, 104);
					border: 1px solid rgb(173, 168, 168);
				}

				&.close {
					font-size: 12px;
					line-height: 1;
					// ...
				}
			}
		}
	}

	.body {
		position: relative;

		background-color: #F7F7F0;

		border: 1px solid gray;
		border-top: none;

		.content {
			overflow-x: auto;
			overflow-y: auto;

			padding: 7px; /* FIXME: Is this needed here? */

			font-size: 13px;

			.viewManager {
				// ...
			}
		}

		.resizer {
			@include unselectable;

			position: absolute;

			/* FIXME: Make the below values configurable? */
			bottom: -8px;
			right: -8px;

			width: 16px;
			height: 16px;

			cursor: se-resize;

			&:hover {
				.arrow {
					position: relative;
					left: -4px;
					top: -4px;
					width: 0px;
					height: 0px;
					border-style: solid;
					border-width: 0px 0px 12px 12px;
					border-color: transparent transparent rgba(0, 109, 201, 0.8) transparent;
				}

				// background-color: silver;
			}
		}
	}

	&.active {
		.titleBar {
			.buttons .button {
				border: 1px solid #014D8C;

				&:hover {
					background-color: rgb(14, 92, 156);
					border: 1px solid rgb(122, 176, 230);
				}
			}

			background: linear-gradient(
				to bottom,
				rgb(0,87,179) 0%,
				rgb(0,153,255) 100%
			);

			border-color: #6262FF;
		}
	}
}

#notificationArea {
	position: absolute;
	right: 0px;
	bottom: 32px;
	z-index: 2147483640;
	display: flex;
	flex-direction: column;
}

.notification {
	display: inline-block;
	border-radius: 6px;
	margin-right: 19px;
	margin-top: 10px;
	padding: 9px 14px;
	color: white;
	font-size: 15px;
	filter: alpha(opacity=85);
	opacity: 0.85;
	width: auto;
	min-width: 220px;

	.closeButton {
		float: right;
		margin-top: -4px;
		margin-right: -6px;
		margin-left: 6px;
		margin-bottom: 4px;
		padding: 4px 6px;
		opacity: 0.6;
		border-radius: 3px;
		cursor: default;

		&:hover {
			opacity: 1;
			background-color: rgba(30, 30, 30, 0.6);
		}
	}

	.header {
		margin-right: 6px;
		font-weight: bold;
		margin-bottom: 6px;
	}

	.contents {
		ul {
			margin: 4px 0px;
			padding-left: 48px;
		}
	}

	&.type-info {
		background-color: #2D2D2D;
	}

	&.type-error {
		background-color: #371B1B;
	}
}
