@import "./fonts.css";
@import "./color-schemes.css";
@import "./loading.css";

:root {
	--highlight-gradient: linear-gradient(90deg, #ffffff10, #ffffff20);
}

* {
	box-sizing: border-box;
}

body {
	background-color: var(--background);
	color: var(--text);
	margin: 0;
	padding: 0;
}

body,
input,
button,
select {
	font-family:
		"Outfit Variable",
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Roboto,
		Oxygen,
		Ubuntu,
		Cantarell,
		"Open Sans",
		"Helvetica Neue",
		sans-serif;
}

a {
	color: var(--blue);
	text-decoration: underline;
}

.secret {
	opacity: 0;
	transition: opacity 0.5s;
}

.secret:hover {
	opacity: 1;
}

main {
	display: flex;
	flex-direction: column;
	max-height: 100vh;
}

.checkbox {
	display: flex;
	align-items: center;
	justify-content: center;
}

.checkbox input {
	appearance: none;
	background-color: var(--secondary-1);
	margin: 0.025em;

	font: inherit;
	color: currentColor;
	width: 0.95em;
	height: 0.95em;

	display: grid;
	place-content: center;
}

.checkbox input:not(.noBorder) {
    border: 0.08em solid var(--surface-2);
	border-radius: 0.12em;
}

.checkbox input.default {
    transition:
    background-color 0.2s,
    border-color 0.2s;
}

.checkbox input::before {
	content: "";
	display: block;
	width: 0.7em;
	height: 0.7em;
	clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
	background-color: var(--secondary-2);
}

.checkbox input:checked {
	background-color: var(--active);
	border-color: var(--active);
}

.checkbox input::before.default {
    transition: transform 0.2s;
}

.checkbox input::before {
    transform: scale(0);
}

.checkbox input:checked::before {
	transform: scale(1);
}

.checkbox input.noTick:checked::before {
    display: none;
}

.checkbox input.noTick:not(:checked)::before {
    display: none;
}

.checkbox input:hover.default {
	background-color: var(--surface-1);
}

.checkbox input:checked:hover.default {
	background-color: var(--active);
	border-color: var(--text);
}

.checkbox input:focus.default {
	outline: none;
	box-shadow: 0 0 0 2px var(--subtext-0);
}

.checkbox input.highlighted.default {
	animation: highlight 5s ease-out;
}

.checkbox span {
	font-family: monospace;
	font-weight: bolder;
	font-size: 0.7rem;
	position: absolute;
	pointer-events: none;
	text-shadow:
		-1px -1px 0 #000,
		1px -1px 0 #000,
		-1px 1px 0 #000,
		1px 1px 0 #000;
}

@keyframes highlight {
	0% {
		box-shadow: 0 0 5px 5px var(--active);
	}
	100% {
		box-shadow: 0 0 1px 5px transparent;
	}
}

.btn,
.select {
	background-color: var(--surface-1);
	color: var(--text);
	border: 1px solid #ffffff30;

	font-size: 0.9rem;
	font-weight: 500;
	border-radius: 8px;
	padding: 0.25rem 1.5rem;
	cursor: pointer;
	transition:
		background-color 0.2s,
		opacity 0.2s;
}

.btn-primary {
	background-color: var(--active);
	color: var(--background);
}

.btn:hover,
.btn:focus,
.btn:active .select:hover,
.select:focus,
.select:active {
	background-image: var(--highlight-gradient);
}

/* customized <select> */
.select {
	--select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	appearance: none;
	padding: 0.25rem 1rem;
	padding-right: 2.5rem;
	position: relative;

	background-image: var(--select-arrow);
	background-repeat: no-repeat;
	background-position: right 0 center;

	transition:
		background-image 0.2s,
		background-color 0.2s,
		opacity 0.2s;
}

.select:hover,
.select:focus,
.select:active {
	background-image: var(--select-arrow), var(--highlight-gradient);
}

.input {
	background-color: var(--surface-1);
	color: var(--text);
	border: 1px solid var(--surface-2);

	font-size: 0.9rem;
	font-weight: 400;
	border-radius: 8px;
	padding: 0.25rem 0.5rem;
	min-width: 0;
}

.fused-input {
	display: flex;
	flex-wrap: nowrap;
}

.fused-input .input,
.fused-input .btn {
	border-radius: 0;
}

.fused-input > :first-child {
	border-radius: 8px;
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.fused-input > :last-child {
	border-radius: 8px;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

/** Spinner input element [-][  0  ][+] */
.spinner {
	display: flex;
	width: 8rem;
	background-color: var(--surface-0);
	border-radius: 8px;
}

.spinner button {
	display: flex;
	flex: 0 0 auto;

	width: 2rem;
	height: 2rem;
	padding: 0;
	font-size: 1.5rem;
	border: none;
	cursor: pointer;
	align-items: center;
	justify-content: center;

	transition:
		background-color 0.2s,
		opacity 0.2s;
}

.spinner input {
	display: flex;
	flex: 1 1 auto;

	min-width: 0;
	height: 2rem;
	background-color: transparent;
	color: var(--text);
	font-size: 1rem;
	border: none;
	text-align: center;
	appearance: textfield;
}

.spinner input::-webkit-inner-spin-button,
.spinner input::-webkit-outer-spin-button {
	appearance: none;
	margin: 0;
}

.checkbox-grid {
	width: 100%;
	max-width: 1800px;
	flex: 1 1;
	max-height: 100vh;
	margin-inline: auto;
	overflow-y: overlay;
	scrollbar-color: var(--surface-2) var(--background);
}

.header {
	display: flex;
	justify-content: center;

	padding-inline: 2rem;
	padding-bottom: 1rem;

	background-color: var(--secondary-1);
}

.header-inner {
	width: 100%;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
}

.header .title {
	line-height: 1;
	font-size: 2rem;
	font-weight: 800;
	position: relative;
	text-wrap: nowrap;
	/* overflow: hidden; */
}

.header-page {
	display: flex;
	align-items: center;
	flex-direction: column;
	width: 18rem;
}

.header-menu {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-direction: column;
	gap: 0.5rem;
	margin-block: 2rem;
	margin-inline: 4rem;
}

.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
}

.overlay-content {
	background-color: var(--secondary-1);
	border-radius: 12px;
	padding: 2rem 2.5rem;
	max-width: 30rem;
}

.overlay-content h1 {
	margin: 0;
}

.loading-overlay {
	position: absolute;

	top: 6rem;
	left: 0;
	right: 0;
	bottom: 0;

	background-color: rgba(0, 0, 0, 0.2);
	font-weight: 500;
	font-size: 1.2rem;

	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 0.5rem;

	animation: loadingFadeIn 1s;
}

@keyframes loadingFadeIn {
	0% {
		opacity: 0;
		pointer-events: none;
	}
	50% {
		opacity: 0;
		pointer-events: none;
	}
	100% {
		pointer-events: initial;
		opacity: 1;
	}
}

.close-button {
	background-color: var(--text);
	border: none;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='24' y1='0' x2='0' y2='24'%3E%3C/line%3E%3Cline x1='0' y1='0' x2='24' y2='24'%3E%3C/line%3E%3C/svg%3E");
	background-size: 1rem;
	background-repeat: no-repeat;
	width: 1rem;
	height: 1rem;
	cursor: pointer;

	transition: background-color 0.2s;
}

.close-button:hover {
	background-color: var(--red);
}

.alert-error {
	background-color: var(--red);
	color: var(--background);
	padding: 0.5rem 1rem;
	border-radius: 8px;
}

.flex {
	display: flex;
}

.flex-grow {
	flex-grow: 1;
}

.flex-shrink {
	flex-shrink: 1;
}

.flex-column {
	flex-direction: column;
}

.ai-center {
	align-items: center;
}

.jc-between {
	justify-content: space-between;
}

.w-100 {
	width: 100%;
}

.gap-1 {
	gap: 0.5rem;
}

.gap-2 {
	gap: 1rem;
}

.mb-1 {
	margin-bottom: 0.5rem;
}

.mb-2 {
	margin-bottom: 1rem;
}

.small {
	font-size: 0.8rem;
}

@media (max-width: 768px) {
	.header {
		padding-inline: 1rem;
	}

	.header-inner {
		text-align: center;
		padding: 0.75rem 1rem;
		justify-content: space-around;
	}

	.header .title {
		font-size: 1.4rem;
		text-align: center;
		margin-bottom: 1rem;
		width: 100%;
	}

	.header .title .t1e3 {
		display: none;
	}

	.header .title .t1b {
		position: initial;
	}

	.header-menu {
		margin-block: 0.5rem;
		margin-inline: 0;
		order: 1;
	}

	.header-page {
		max-width: 8rem;
	}

	.loading-overlay {
		top: 9rem;
	}

	.desktop-only {
		display: none;
	}
}

@media (min-width: 768px) {
	.header .title .t1b,
	.header .title .t1e3 {
		transition: transform 0.5s;
	}

	.header .title .t1b {
		position: absolute;
		left: 0;
		top: 0;
		right: 0;

		transform: rotateX(0deg) translateZ(-0.5em);
	}

	.header .title .t1e3 {
		transform: rotateX(90deg) translateZ(0.5em);
	}

	.header .title:hover .t1b {
		transform: rotateX(90deg) translateZ(-0.5em);
	}

	.header .title:hover .t1e3 {
		transform: rotateX(0deg) translateZ(0.5em);
	}
}
