@import 'utilities.css';
@import 'buttons.css';
@import 'forms.css';
@import 'profile.css';
@import 'game.css';

body {
	background-color: #bcc6cf;
	background-image: url('/assets/img/bg.jpg');
	background-attachment: fixed;
	background-position: center top;
	background-repeat: no-repeat;
	max-width: 1640px;
	min-width: 968px;
	margin: 0px auto;
	font-family: var(--main-font);
}

header#main-header {
	height: 76px;
	color: white;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1rem;
	background-image: url('/assets/img/header.jpg');

	h1 {
		margin: 0;
		padding: 0;
	}

	.right {
		display: flex;
		align-items: center;

		p {
			margin-right: 1rem;
		}
	}
}

main {
	padding: 1rem;
	width: 100%;
	display: flex;
	gap: 2rem;

	#center {
		flex: 1;
	}
}

aside {
	min-width: 200px;

	.box {
		background-color: rgba(0, 0, 0, 0.2);
		border-radius: 0.15rem;
		padding: 0.5rem;
	}
}

aside#left nav {
	& > *:not(:last-child) {
		margin-bottom: 0.25rem;
	}

	div.stack {
		background-color: rgba(0, 0, 0, 0.2);
		border-radius: 0.15rem;

		input[type="checkbox"] {
			display: none;

			&:checked ~ div.list {
				display: block;
			}

			&:checked + label {
				background-color: rgba(0, 0, 0, 0.5);
				color: white;
			}
		}

		label {
			display: flex;
			align-items: center;
			padding: 0.5rem 1rem;
			border-radius: 0.15rem;
			text-decoration: none;
			color: black;
			transition: color, background-color 0.2s ease;
			cursor: pointer;

			img {
				height: 18px;
				margin-right: 0.25rem;
			}

			span.text {
				display: block;
				width: 100%;
			}

			&:hover {
				color: white;
				background-color: rgba(0, 0, 0, 0.3);
			}

			span.arrow {
				position: relative;
				top: 5px;
			}
		}

		div.list {
			display: none;

			& > a {
				display: block;
				width: 100%;
				padding: 0.5rem 1rem 0.5rem 1.35rem;
				border-radius: 0.15rem;
				text-decoration: none;
				color: black;
				transition: color, background-color 0.2s ease;

				&:not(:last-child)::before {
					content: '├';
					display: inline-block;
					margin-right: 0.25rem;
				}

				&:last-child::before {
					content: '└';
					display: inline-block;
					position: relative;
					top: 3px;
					margin-right: 0.25rem;
				}

				&:hover {
					background-color: rgba(0, 0, 0, 0.3);
				}

				&.active {
					background-color: #444c55;
					color: #ffffff;
					background-image: linear-gradient(rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.1));
					border: 1px solid;
					border-color: #3D444C #2F353B #2C3137;
					box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset;
				}
			}
		}
	}

	& > a {
		display: block;
		width: 100%;
		padding: 0.5rem 1rem;
		text-decoration: none;
		color: black;
		transition: color, background-color 0.2s ease;
		background-color: rgba(0, 0, 0, 0.2);
		border-radius: 0.15rem;

		&:has(img) {
			display: flex;
			align-items: center;

			img {
				height: 18px;
				margin-right: 0.25rem;
			}
		}

		&:hover, &.active {
			color: white;
		}

		&:hover {
			background-color: rgba(0, 0, 0, 0.3);
		}

		&.active {
			background-color: #444c55;
			color: #ffffff;
			background-image: linear-gradient(rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.1));
			border: 1px solid;
			border-color: #3D444C #2F353B #2C3137;
			box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset;
		}
	}
}

footer {
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 1rem 0;
	padding: 1rem;
	text-align: center;
	color: #666;

	& > p:not(:last-child) {
		margin-right: 2rem;
	}
}

#character {
	& > .name {
		display: flex;
		align-items: center;
	}

	& > div:not(:last-child) {
		margin-bottom: 0.5rem;
	}
}

span.badge {
	font-size: 10px;
	background-color: #f7f8fa;
	color: #111111;
	border-radius: 0.25rem;
	padding: 0.1rem 0.25rem;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) inset;

	&.dark {
		background-color: #444c55;
		color: white;
	}

	&.green {
		background-color: #a6e3a1;
	}
}

.char-meter {
	background-color: black;
	height: 16px;
	min-width: 100px;
	border-radius: 0.1rem;
	position: relative;

	& > div {
		height: 100%;
		border-radius: 0.1rem;
		overflow: hidden;

		&.hp {
			background-color: #e57373;
			background-image: linear-gradient(rgba(255, 255, 255, 0.15), rgba(139, 0, 0, 0.1));
			box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset;
			border: 1px solid;
			border-color: #d32f2f #c62828 #b71c1c;
		}

		&.mp {
			background-color: #5a9bd4;
			background-image: linear-gradient(rgba(255, 255, 255, 0.15), rgba(60, 100, 150, 0.1));
			box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset;
			border: 1px solid;
			border-color: #4a8ab0 #3a7a9c #2a6a88;
		}

		&.tp {
			background-color: #f4cc67;
			background-image: linear-gradient(rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.1));
			box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset;
			border: 1px solid;
			border-color: #C59F43 #AA8326 #957321;
		}
	}
}

.tooltip {
	position: absolute;
	background-color: black;
	color: white;
	border: 1px solid #666;
	font-size: 14px;
	padding: 0.5rem;
	box-shadow: 0 0 0.5rem 0.1rem rgba(0, 0, 0, 0.2);
	border-radius: 0.1rem;
	text-align: center;
}

.tooltip-trigger {
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
}

.debug-query-log {
	padding: 1rem;
	font-size: 14px;
	color: #666;
	font-family: monospace;

	&:last-child {
		padding-top: 0;
	}
}

#center > section {
	&:not(:last-child) {
		padding-bottom: 1rem;
		border-bottom: 1px solid rgba(0, 0, 0, 0.1);
		margin-bottom: 1rem;
	}
}

h1:has(.badge), h2:has(.badge), h3:has(.badge), h4:has(.badge), h5:has(.badge), h6:has(.badge) {
	display: flex;
	align-items: center;

	& > .badge {
		margin-left: 0.5rem;
	}
}

.alert {
	position: relative;
    min-height: 1rem;
    margin: 1rem 0;
    background: #f8f8f9;
    padding: 0.5rem 1rem;
    line-height: 1.4285rem;
    color: rgba(0, 0, 0, .87);
    transition: opacity .1s ease, color .1s ease, background .1s ease, box-shadow .1s ease;
    border-radius: .28571429rem;
    box-shadow: 0 0 0 1px rgba(34, 36, 38, .22) inset, 0 0 0 0 transparent;
	display: flex;
	align-items: center;
	justify-content: space-between;

	&.success {
		background-color: #f0f9eb;
		color: #2c662d;
		border-color: #b3dc9d;
	}

	&.danger {
		background-color: #f9e9eb;
		color: #9f3a38;
		border-color: #e0b4b4;
	}

	&.warning {
		background-color: #fff8e1;
		color: #573a08;
		border-color: #f9e79f;
	}

	&.info {
		background-color: #f0f9fb;
		color: #2c7fba;
		border-color: #b3d7f9;
	}

	&.dark {
		background-color: #f0f0f0;
		color: #2c2c2c;
		border-color: #b3b3b3;
	}

	a[alert-close] {
		text-decoration: none;
		cursor: pointer;
		font-size: 2rem;
		color: inherit;
	}
}

a {
	color: #4C0515;
	text-decoration: none;
	transition: color 0.2s ease;

	&:hover {
		color: #6C0515;
		text-decoration: underline;
	}
}

body::-webkit-scrollbar {
	width: 0.5rem;
}

body::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.1);
}

body::-webkit-scrollbar-thumb {
	background-color: #444c55;
	background-image: linear-gradient(rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.1));
	border: 1px solid;
	border-color: #3D444C #2F353B #2C3137;
	box-shadow: 0px 1px 0px 0px rgba(255, 255, 255, 0.2) inset;
}

#canvas-container {
	& > canvas {
		display: block;
		width: 100%;
		height: 440px;
		image-rendering: pixelated;
		image-rendering: crisp-edges;
		image-rendering: -webkit-optimize-contrast;
	}
}

.char-icon {
	width: 32px;
	height: 32px;
	background-image: url('/assets/img/world/rogues.png');

	&.index-0 {
		background-position: 0 0;
	}

	&.index-1 {
		background-position: -32px 0;
	}

	&.index-2 {
		background-position: -64px 0;
	}

	&.index-3 {
		background-position: -96px 0;
	}

	&.index-4 {
		background-position: -128px 0;
	}
}
