@import url("fonts/GoogleSans/GoogleSans.css");
@import url("fonts/GoogleSansCode/GoogleSansCode.css");
@import url("fonts/MaterialSymbols/Outlined/MaterialSymbolsOutlined.css");

:root {
	margin: 0;
	padding: 0;

	font-family:
		"Google Sans",
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Oxygen,
		Ubuntu,
		Cantarell,
		"Open Sans",
		"Helvetica Neue",
		sans-serif;
	font-weight: 400;
	font-size: 16pt;
	line-height: 24pt;

	/* https://github.com/morhetz/gruvbox */
	/* https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl */
	color-scheme: light dark;

	--fg: light-dark(oklch(0.3441 0.0066 48.52), oklch(0.8941 0.0566 89.24));
	--bg: light-dark(oklch(0.9555 0.0555 96.15), oklch(0.2768 0 0));

	--fg0: light-dark(oklch(0.2768 0 0), oklch(0.9555 0.0555 96.15));
	--fg1: light-dark(oklch(0.3441 0.0066 48.52), oklch(0.8941 0.0566 89.24));
	--fg2: light-dark(oklch(0.411 0.0115 51.87), oklch(0.8255 0.0507 85.12));
	--fg3: light-dark(oklch(0.4818 0.0181 61.04), oklch(0.7564 0.041 82.28));
	--fg4: light-dark(oklch(0.5505 0.0234 62.57), oklch(0.6903 0.0346 76.31));

	--bg0_h: light-dark(oklch(0.9655 0.0394 100.86), oklch(0.2408 0.0049 219.67));
	--bg0: light-dark(oklch(0.9555 0.0555 96.15), oklch(0.2768 0 0));
	--bg1: light-dark(oklch(0.8981 0.0583 92.15), oklch(0.3441 0.0066 48.52));
	--bg2: light-dark(oklch(0.8255 0.0507 85.12), oklch(0.411 0.0115 51.87));
	--bg3: light-dark(oklch(0.7564 0.041 82.28), oklch(0.4818 0.0181 61.04));
	--bg4: light-dark(oklch(0.6903 0.0346 76.31), oklch(0.5505 0.0234 62.57));

	--shadow: light-dark(oklch(0.2768 0 0), oklch(0.2768 0 0));

	--green_light: light-dark(
		oklch(0.5463 0.1124 106.46),
		oklch(0.6564 0.1354 109.12)
	);
	--green_dark: light-dark(
		oklch(0.6564 0.1354 109.12),
		oklch(0.6564 0.1354 109.12)
	);
	--red_light: light-dark(
		oklch(0.4374 0.1789 28.26),
		oklch(0.6597 0.2175 30.39)
	);
	--red_dark: light-dark(oklch(0.5458 0.203 28.66), oklch(0.5458 0.203 28.66));
	--blue_light: light-dark(
		oklch(0.4706 0.0816 215.81),
		oklch(0.6927 0.042 169.77)
	);
	--blue_dark: light-dark(
		oklch(0.5756 0.0658 199.49),
		oklch(0.5756 0.0658 199.49)
	);
	--yellow_light: light-dark(
		oklch(0.6176 0.1277 70.67),
		oklch(0.8325 0.1595 82.99)
	);
	--yellow_dark: light-dark(
		oklch(0.7251 0.1429 77.71),
		oklch(0.7251 0.1429 77.71)
	);

	/* https://m3.material.io/styles/motion/overview/specs#e3e4f10b-6314-47b7-9051-988066081fa0 */
	--expressive-fast-spatial: 350ms cubic-bezier(0.42, 1.67, 0.21, 0.9);
	--expressive-default-spatial: 500ms cubic-bezier(0.38, 1.21, 0.22, 1);
	--expressive-slow-spatial: 650ms cubic-bezier(0.39, 1.29, 0.35, 0.98);
	--expressive-fast-effects: 150ms cubic-bezier(0.31, 0.94, 0.34, 1);
	--expressive-default-effects: 200ms cubic-bezier(0.34, 0.8, 0.34, 1);
	--expressive-slow-effects: 300ms cubic-bezier(0.34, 0.88, 0.34, 1);

	--standard-fast-spatial: 350ms cubic-bezier(0.27, 1.06, 0.18, 1);
	--standard-default-spatial: 500ms cubic-bezier(0.27, 1.06, 0.18, 1);
	--standard-slow-spatial: 750ms cubic-bezier(0.27, 1.06, 0.18, 1);
	--standard-fast-effects: 150ms cubic-bezier(0.31, 0.94, 0.34, 1);
	--standard-default-effects: 200ms cubic-bezier(0.34, 0.8, 0.34, 1);
	--standard-slow-effects: 300ms cubic-bezier(0.34, 0.88, 0.34, 1);

	--corner-medium: 12px;
	--corner-medium-variant: 10px;

	scrollbar-color: var(--fg) var(--bg);
}

::selection {
	background: var(--fg0);
	color: var(--bg0_h);
	text-shadow: none;
}

body {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: linear-gradient(
		var(--bg0_h),
		var(--bg) 6rem,
		var(--bg) 87.5%,
		var(--bg0_h)
	);
	color: var(--fg);
	padding: 16px;
}

main {
	margin: 0 32px;
	min-width: 700px;
	min-height: 70vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

b {
	font-weight: 700;
}

/* https://m3.material.io/styles/typography/type-scale-tokens */
h1 {
	display: none;
	width: 0;
	color: transparent;

	font-weight: 400;
	font-size: 32pt;
	line-height: 40pt;

	font-variation-settings: "OPSZ" 32;
	display: flex;
	vertical-align: middle;
	align-items: center;
	gap: 0.5rem;
}

h1::selection {
	background-color: transparent;
	color: transparent;
}

h2 {
	font-weight: 400;
	font-size: 28pt;
	line-height: 36pt;

	font-variation-settings: "OPSZ" 28;
	display: flex;
	vertical-align: middle;
	align-items: center;
	gap: 0.5rem;
}

h3 {
	font-weight: 500;
	font-size: 24pt;
	line-height: 32pt;

	font-variation-settings: "OPSZ" 24;
	display: flex;
	vertical-align: middle;
	align-items: center;
	gap: 0.5rem;
}

.mono {
	font-family: "Google Sans Code", monospace;
}

a {
	color: var(--blue_light);
	text-decoration: unset;
	transition: color var(--expressive-default-effects);
}

a:hover {
	color: var(--fg0);
}

/* https://stackoverflow.com/a/29683421 */
table td,
table th {
	padding: 0.5rem;
	text-align: left;
	vertical-align: middle;
}

table {
	overflow-x: scroll;
	background-color: var(--bg1);
	border: 1px solid var(--fg);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: var(--corner-medium);
}

table tr:first-child td:first-child,
table tr:first-child th:first-child {
	border-top-left-radius: var(--corner-medium-variant);
}

table tr:first-child td:last-child,
table tr:first-child th:last-child {
	border-top-right-radius: var(--corner-medium-variant);
}

table tr:last-child td:first-child,
table tr:last-child th:first-child {
	border-bottom-left-radius: var(--corner-medium);
}

table tr:last-child td:last-child,
table tr:last-child th:last-child {
	border-top-right-radius: var(--corner-medium);
}

table tr:first-child {
	background-color: var(--fg);
	color: var(--bg1);
}

input {
	font-family: unset;
	background-color: var(--bg1);
	border: 2px solid var(--bg2);
	border-radius: 4px;
	color: var(--fg);
	height: 32px;

	transition:
		border var(--expressive-default-effects),
		background-color var(--expressive-default-effects);
}
input:focus,
input:focus-visible {
	outline: none;
	background-color: var(--bg2);
	border: 2px solid var(--fg);
}

::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-year-field {
	transition:
		color var(--expressive-default-effects),
		background-color var(--expressive-default-effects);
}

::-webkit-datetime-edit-month-field:focus,
::-webkit-datetime-edit-day-field:focus,
::-webkit-datetime-edit-year-field:focus {
	background-color: var(--fg0);
	color: var(--bg0);
}
::-webkit-calendar-picker-indicator {
	background-repeat: no-repeat;
	background-image: none;
	background-color: var(--fg);
	mask-image: url(calendar_today_16dp_E3E3E3_FILL0_wght400_GRAD0_opsz20.svg);
	mask-size: contain;
}
::-webkit-calendar-picker-indicator:focus {
	background-color: var(--fg0);
	mask-image: url(calendar_today_16dp_E3E3E3_FILL1_wght400_GRAD0_opsz20.svg);
}

/* https://stackoverflow.com/a/14205976 CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
	-webkit-background-clip: text;
	-webkit-text-fill-color: var(--fg0);
	transition: background-color 5000s ease-in-out 0s;
	box-shadow: inset 0 0 20px 20px var(--yellow_dark);
}

input[type="submit"] {
	font-family: unset;
	border: 0;
	background-color: var(--bg1);
	color: var(--fg);

	height: 32px;
	font-weight: 500;
	font-size: 14pt;
	line-height: 20pt;
	border-radius: 32px;
	padding: 0 12px;

	transition:
		border-radius var(--expressive-default-spatial),
		outline-width var(--expressive-default-spatial),
		border var(--expressive-default-spatial),
		color var(--expressive-default-effects),
		background-color var(--expressive-default-effects);
}

input[type="submit"]:hover {
	color: unset;
	background-color: var(--bg2);
}

input[type="submit"]:focus {
	outline: 3px solid var(--fg);
	outline-offset: 2px;
	z-index: 10;
}

input[type="submit"]:active,
input[type="submit"]:focus {
	background-color: var(--fg);
	color: var(--bg);
	border-radius: 12px;
}

nav {
	display: flex;
	gap: 2px;
	vertical-align: middle;
	text-align: center;
}
nav a {
	color: unset;
	text-decoration: unset;

	font-weight: 500;
	font-size: 16pt;
	font-variation-settings: "OPSZ" 16;
	line-height: 24pt;
	background-color: var(--bg1);
	user-select: none;

	border: 0;
	border-radius: 4px;
	height: 56px;
	padding: 0 24px;
	width: auto;

	display: flex;
	gap: 8px;
	align-items: center;
	text-align: center;
	vertical-align: middle;

	transition:
		border-radius var(--expressive-fast-spatial),
		outline-width var(--expressive-fast-spatial),
		border var(--expressive-fast-spatial),
		color var(--expressive-fast-effects),
		background-color var(--expressive-fast-effects);
}

nav a:first-child {
	border-radius: 56px 4px 4px 56px;
}

nav a:last-child {
	border-radius: 4px 56px 56px 4px;
}

nav a:hover {
	color: unset;
	background-color: var(--bg2);
}

nav a:focus {
	outline: 3px solid var(--fg);
	outline-offset: 2px;
	z-index: 10;
}

nav a.enabled,
nav a:active,
nav a:focus {
	background-color: var(--fg);
	color: var(--bg);
	border-radius: 56px;
}

nav a span.material-symbols-outlined {
	transition: font-variation-settings var(--expressive-fast-effects);
}

nav a.enabled span.material-symbols-outlined,
nav a:active span.material-symbols-outlined,
nav a:focus span.material-symbols-outlined {
	font-variation-settings: "FILL" 1;
}

ul li {
	font-weight: 500;
	font-size: 12pt;
	line-height: 16pt;
}

hr {
	height: 1px;
	color: var(--bg1);
	background-color: var(--bg1);
	border-width: 0;
}

header {
	display: flex;
	text-align: center;
	vertical-align: middle;
	align-items: center;
	gap: 16px;
}

footer {
	margin-top: 4rem;
	width: 100%;
	text-align: center;

	font-weight: 500;
	font-size: 11pt;
	line-height: 16pt;
}

footer span.material-symbols-outlined {
	user-select: unset;
}

main#add {
	display: flex;
	flex-wrap: wrap;
	flex-direction: row;
	justify-content: center;
	align-content: baseline;
	gap: 16pt;
}

main#add section,
main#edit section form {
	width: 14rem;
}

main#edit section {
	display: flex;
	flex-direction: column;
	align-items: center;
}

section {
	border-radius: 12px;
	padding-left: 16px;
	padding-right: 16px;
	background-color: var(--bg1);
	box-shadow: oklch(from var(--shadow) l c h / 0.1) 0 2px 4px;
}

div.verticalLine {
	background-color: var(--bg1);
	width: 1px;
	height: auto;
}

.buttongroup {
	display: flex;
	vertical-align: middle;
	text-align: center;
	justify-content: center;
	gap: 0.25rem;
}

.buttongroup a {
	font-size: 20px;
	font-variation-settings: "OPSZ" 20;
	height: 20px;
	border-radius: 20px;
	padding: 4px;
	background-color: var(--blue_light);
	color: var(--bg0);
	user-select: none;

	transition:
		font-variation-settings var(--expressive-default-effects),
		border-radius var(--expressive-default-spatial),
		outline-width var(--expressive-default-spatial),
		border var(--expressive-default-spatial),
		color var(--expressive-default-effects),
		opacity var(--expressive-default-effects),
		background-color var(--expressive-default-effects);
}

.buttongroup a:focus,
.buttongroup a:hover {
	opacity: 90%;
}

.buttongroup a:focus {
	outline: 3px solid var(--blue_light);
	outline-offset: 2px;
	z-index: 10;
}

.buttongroup a:active {
	background-color: var(--bg0);
	color: var(--blue_light);
	border-radius: 4px;
}

.buttongroup a.delete {
	background-color: var(--red_light);
}
.buttongroup a.delete:focus {
	outline: 3px solid var(--red_light);
}
.buttongroup a.delete:active {
	background-color: var(--bg0);
	color: var(--red_light);
}

.buttongroup a.material-symbols-outlined:active,
.buttongroup a.material-symbols-outlined:focus {
	font-variation-settings: "FILL" 1;
}

.red {
	color: var(--red_light);
}
.yellow {
	color: var(--yellow_light);
}

div.buttongroup {
	margin: 1rem;
}

div.buttongroup button {
	font-size: 14pt;
	font-variation-settings: "OPSZ" 14;
	font-weight: 500;
	font-family: inherit;
	height: 32px;
	border-radius: 20px;
	border: 0;
	padding: 4px 12px;
	background-color: var(--blue_light);
	color: var(--bg0);
	user-select: none;

	display: flex;
	vertical-align: middle;
	gap: 4px;

	transition:
		font-variation-settings var(--expressive-default-effects),
		border-radius var(--expressive-default-spatial),
		outline-width var(--expressive-default-spatial),
		border var(--expressive-default-spatial),
		color var(--expressive-default-effects),
		opacity var(--expressive-default-effects),
		background-color var(--expressive-default-effects);
}

div.buttongroup button:focus,
div.buttongroup button:hover {
	opacity: 90%;
}

div.buttongroup button:focus {
	outline: 3px solid var(--blue_light);
	outline-offset: 2px;
	z-index: 10;
}

div.buttongroup button:active {
	background-color: var(--bg0);
	color: var(--blue_light);
	border-radius: 4px;
}

div.buttongroup button.delete {
	background-color: var(--red_light);
}
div.buttongroup button.delete:focus {
	outline: 3px solid var(--red_light);
}
div.buttongroup button.delete:active {
	background-color: var(--bg0);
	color: var(--red_light);
}

form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	justify-content: end;
	margin-top: 0;
	margin-bottom: 0;
}

form input,
form textarea,
form select,
form button {
	width: 8rem;
}

div.buttongroup button:active span.material-symbols-outlined,
div.buttongroup button:focus span.material-symbols-outlined {
	font-variation-settings: "FILL" 1;
}

@view-transition {
	navigation: auto;
}