@import url(https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;600&display=block);
@import url(/timetables/css/icons.css?v=5);

html {
	--white: #fff;
	--light-gray: #eee;
	--gray: #ccc;
	--dark-gray: #555;
	--black: #000;
	--shadow: rgba(100, 100, 100, 0.5);
	-webkit-tap-highlight-color: transparent;
}

html.dark {
	--white: #111;
	--light-gray: #444;
	--gray: #555;
	--dark-gray: #aaa;
	--black: #fff;
	--shadow: #333;
}

body {
	transition: opacity 500ms;
}

html.loading body {
	opacity: 0.25;
	pointer-events: none;
}

html.loading body::after, .loader::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	margin: auto auto;
	border-radius: 100%;
	width: 4em;
	height: 4em;
	border: 1px solid transparent;
	border-top-color: var(--black);
	z-index: 3;
	animation: fade-in 500ms 500ms both, spin 500ms infinite linear;
}

* { font-family: Rubik, sans-serif; }
*[hidden] { display: none !important; }

html, body, section {
	height: 100%;
	width: 100%;
	margin: 0;
	overflow: hidden;
	background-color: var(--white);
	color: var(--black);
}

html.bot body {
	overflow: scroll !important;
	padding: 2em;
}

::selection {
	background-color: var(--light-gray);
	color: var(--dark-gray);
}

::-webkit-scrollbar {
	width: 0.5em;
	height: 0.5em;
}

::-webkit-scrollbar-thumb {
	background: var(--gray);
	border-radius: 0.5em;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--light-gray);
	cursor: pointer;
}

button {
	font-size: 0.85em;
	border: 1px solid var(--gray);
	padding: 0.5em 0.75em;
	border-radius: 1em;
	background-color: var(--white);
	color: var(--black);
}

button, select {
	transition: filter 250ms;
	cursor: pointer;
}

button:hover, select:hover {
	filter: invert(1);
	color: var(--black);
}

input, textarea, select, [contenteditable] {
	font-size: 1em;
	padding: 0.25em 0.5em;
	color: var(--dark-gray);
	border: 1px solid var(--gray);
	border-radius: 0.5em;
	outline: none;
	background-color: var(--white);
	color: var(--dark-gray);
}

input[type=checkbox] {
	margin: 0;
	width: 1.5em;
	height: 1.5em;
}

html.dark input {
	color-scheme: dark;
}

a {
	color: var(--black);
}

hr {
	border: 1px solid var(--light-gray);
}

details h1, details h2 {
	display: inline;
}

summary {
	cursor: pointer;
}

code {
	font-family: monospace;
	border-radius: 0.1em;
	padding: 0 0.25em;
	background-color: var(--light-gray);
}

code::selection {
	color: var(--white);
	background-color: var(--black);
}

dialog {
	height: 80vh;
	max-height: 50em;
	width: 40em;
	border: none;
	border-radius: 1em;
	box-shadow: 0 0 0.5em var(--shadow);
	background-color: var(--white);
	color: var(--black);
	overflow-y: hidden;
	animation: appear 250ms;
}

dialog::backdrop {
	backdrop-filter: blur(1px);
	background-color: rgba(0, 0, 0, 0.5);
	animation: fade-in 250ms;
}

dialog.fade-out::backdrop {
	animation: fade-out 250ms forwards;
}

dialog.fade-out {
	animation: disappear 250ms forwards;
}

dialog .dialog-content {
	width: 100%;
	height: calc(100% - 3em);
	overflow-y: auto;
}

dialog .dialog-content:focus-visible, dialog:focus-visible {
	outline: none;
}

dialog h1, dialog h2 + * {
	margin-top: 0;
}

dialog h2 {
	margin-bottom: 0.25em;
}

dialog p.center-text {
	text-align: center;
	margin-top: 20vh;
}

dialog > button {
	margin-top: 1em;
}

@keyframes fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes fade-out {
	from { opacity: 1; }
	to { opacity: 0; }
}

@keyframes spin {
	from { rotate: 0; }
	to { rotate: 1turn; }
}

@keyframes appear {
	from {
		opacity: 0;
		scale: 0.5;
	}

	to {
		opacity: 1;
		scale: 1;
	}
}

@keyframes disappear {
	from {
		opacity: 1;
		scale: 1;
	}

	to {
		opacity: 0;
		scale: 0.5;
	}
}

@keyframes roll-out {
	from {
		opacity: 0;
		scale: 1 0;
	}

	to {
		opacity: 1;
		scale: 1 1;
	}
}

@keyframes roll-in {
	from {
		opacity: 1;
		scale: 1 1;
	}

	to {
		opacity: 0;
		scale: 1 0;
	}
}

@keyframes slide-in {
	from { transform: translateY(-100%); }
	to { transform: none; }
}

@media (max-width: 50em) {
	dialog {
		width: auto;
		height: auto;
		margin: 1em;
	}
}

@media print {
	@page {
		size: landscape;
	}

	* {
		background: white !important;
		color: black !important;
	}

	header, dialog, i {
		display: none !important;
	}

	#timetable .slot {
		border: 1px solid var(--dark-gray);
	}

	body::before {
		display: block;
		text-align: center;
		font-size: 2em;
		margin-bottom: 0.5em;
		content: attr(id)
	}

	body::after {
		content: "tikolu.net/timetables";
		position: absolute;
		right: 0;
		bottom: 0;
	}
}