* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: Verdana !important;
}

:root {
	/* theme colors */
	--primary: #0070ff;
	--secondary: #6b7280;
	--danger: #f11b1b;
	--white: #fff;
	--black: #000;

	/* accent colors */

	--success: #4cbb17;
	--danger: #ce2029;
	--info: #0095ff;
	--warning: #ffbf00;

	--low-priority: #4cbb17;
	--medium-priority: #ffbf00;
	--high-priority: #ce2029;

	/* grays */
	--gray-100: #f5f5f5;
	--gray-200: #e5e5e5;
	--gray-300: #d4d4d4;
	--gray-400: #a3a3a3;
	--gray-500: #737373;
	--gray-600: #525252;
	--gray-700: #404040;
	--gray-800: #262626;
	--gray-900: #171717;

	/* generic size */
	--size: 8px;
	--line-height-btn: 1.5;

	--bg-body: var(--gray-900);
	--color-body: var(--gray-100);
	--border-color: #4e4e4ea3;
	--border-radius: 8px;

	--modal-overlay-bg: #171717c7;

	--box-shadow: 0 0.25rem 0.25rem rgb(from var(--black) r g b / 0.075);
	color-scheme: dark;
}

[data-theme="light"] {
	--primary: #0070ff;
	--secondary: #6b7280;
	--danger: #f11b1b;
	--white: #fff;
	--black: #000;

	--low-priority: #03c03c;
	--medium-priority: #b8860b;
	--high-priority: #dc143c;
	/* grays */
	--gray-900: #f5f5f5;
	--gray-800: #e5e5e5;
	--gray-700: #d4d4d4;
	--gray-600: #a3a3a3;
	--gray-500: #737373;
	--gray-400: #525252;
	--gray-300: #404040;
	--gray-200: #262626;
	--gray-100: #171717;

	/* generic size */
	--size: 8px;
	--line-height-btn: 1.5;

	--bg-body: var(--gray-900);
	--color-body: var(--gray-100);
	--border-color: #515151a3;
	--border-radius: 8px;

	--modal-overlay-bg: #171717c7;
	color-scheme: light;
}
body {
	background-color: var(--bg-body);
	color: var(--color-body);

	display: grid;
	grid-template-rows: 0.1fr 2fr;
	grid-template-areas:
		"header"
		"main";
	width: 100%;
	height: 100svh;
	position: relative;
}

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

header {
	justify-content: space-between !important;
	grid-area: header;
	gap: 5px;

	padding: var(--size);
	background-color: var(--gray-800);
	border-bottom: 1px solid var(--border-color);
	box-shadow: var(--box-shadow);

	h2 {
		font-size: clamp(1em, 18px, 2rem);
	}
}

main {
	grid-area: main;

	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	padding: calc(var(--size) * 3);
	gap: calc(var(--size) * 3);

	overflow: hidden;

	section {
		overflow-y: hidden;
		height: 100%;
		background-color: var(--gray-800);
		border-radius: var(--border-radius);
		border: 1px solid var(--border-color);
	}
}

.card-container {
	height: 95%;
	overflow-y: auto;
}

.title {
	text-align: center;
	position: relative;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	padding: var(--size);
	background-color: oklch(from var(--gray-900) calc(l + 0.1) c h);
	border-top-left-radius: var(--border-radius);
	border-top-right-radius: var(--border-radius);
	font-size: calc(var(--size) * 3);
	border-bottom: 1px solid var(--border-color);
}

.todo-count {
	position: absolute;
	top: 2px;
	right: 2px;
	background-color: var(--gray-900);
	padding: 4px 10px;
	border-radius: 50%;
	border: 1px solid var(--border-color);
}

.action-wrapper {
	background-color: var(--bg-body);
	z-index: 500;
}

.todo-card,
.placeholder {
	margin: calc(var(--size) * 2);
	padding: calc(var(--size) * 2);
	gap: calc(var(--size));

	align-items: start;
	flex-direction: column;

	background-color: var(--gray-900);
	box-shadow: var(--box-shadow);
	touch-action: none;

	border-radius: 0;
	border-top-right-radius: var(--border-radius);
	border-bottom-right-radius: var(--border-radius);
}

.todo-card[draggable="true"] {
	user-select: none;
}

.priority-low {
	border-left: 5px solid var(--low-priority);
}

.priority-medium {
	border-left: 5px solid var(--medium-priority);
}

.priority-high {
	border-left: 5px solid var(--high-priority);
}

.todo-header {
	font-size: calc(var(--size) * 3);
	width: 100%;
	justify-content: space-between !important;
	overflow: hidden;
}

.todo-title {
	width: 60%;
	text-wrap-mode: nowrap;
}

.auto-scroll {
	display: inline-block;
	animation: scroll 12s linear infinite 2s;
}

.placeholder {
	height: 120px;

	.todo-header {
		height: 30%;
		width: 70%;
		border-radius: var(--size);
		background-color: var(--gray-800);
		padding: calc(var(--size) * 2);
	}

	.todo-description {
		height: 30%;
		width: 80%;
		border-radius: var(--size);
		background-color: var(--gray-800);
		padding: calc(var(--size) * 3);
		margin-top: var(--size);
	}
}
@keyframes scroll {
	0% {
		transform: translate(0, 0);
	}
	100% {
		transform: translate(-100%, 0);
	}
}

.drag-btn {
	position: relative;
}

.drag-btn::before {
	content: "";
	position: absolute;
	top: -10px;
	right: -10px;
	bottom: -10px;
	left: -8px;
	pointer-events: none;
	/* background: red; */
	/* -- uncomment to visualize the hitbox while testing */
}

.drag-btn .icon {
	cursor: grab;
}

.btn-edit .icon {
	fill: var(--primary);
}

.btn-delete .icon {
	fill: var(--danger) !important;
}

.btn-delete,
.btn-edit,
.drag-btn {
	background: none;
	border: none;
}

.icon {
	border-radius: var(--border-radius);
	padding: 4px;
	height: 30px;
	width: 30px;
	fill: currentColor;
	cursor: pointer;
}

.icon:hover {
	background-color: var(--gray-700);
}

.btn {
	all: unset;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	display: inline-block;
	background-color: var(--primary);
	color: var(--white);
	text-align: center;
	font-size: calc(var(--size) * 2);
	border-radius: var(--border-radius);
	margin: var(--size);
	padding: var(--size);
	line-height: var(--line-height-btn);
	outline-color: rgb(from var(--btn-bg-color) r g b / 0.5);

	cursor: pointer;
	transition: all 0.2s;
}

.btn-primary {
	--btn-bg-color: var(--primary) !important;
	background-color: var(--primary);
}

.btn-danger {
	--btn-bg-color: var(--danger) !important;
	background-color: var(--danger);
}

.btn-secondary {
	--btn-bg-color: var(--secondary) !important;
	background-color: var(--secondary);
}

.btn:focus-visible {
	outline: 5px solid rgb(from var(--btn-bg-color) r g b / 0.5); /*Create a outline with lesser opacity of original color*/
	background-color: color-mix(in oklab, var(--btn-bg-color), black 10%); /*This will add 10% darkness */
}

.btn:hover {
	background-color: color-mix(in oklab, var(--btn-bg-color), black 10%); /*This will add 10% darkness */
}

.hide {
	display: none !important;
}

.modal {
	align-items: center;
	justify-content: center;
	position: absolute;
	height: 100%;
	width: 100%;
	background-color: var(--modal-overlay-bg);
	z-index: 999;
}

.modal-body {
	width: 40%;
	height: auto;
	background-color: var(--gray-800);
	border-radius: var(--border-radius);
	border: 1px solid var(--border-color);
	padding: calc(var(--size) * 2);

	display: flex;
	justify-content: space-evenly;
	flex-direction: column;
}

.modal-title {
	justify-content: space-between !important;
	margin-bottom: var(--size);
}

.modal-actions {
	margin-top: var(--size);
	justify-content: end !important;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	border-color: rgb(from var(--primary) r g b / 0.5) !important;
	outline: 5px solid rgb(from var(--primary) r g b / 0.1) !important;
}

input[type="text"],
input[type="date"],
textarea,
select {
	all: unset;
	font-size: 14px;
	width: 70%;
	margin-top: var(--size);
	background-color: var(--bg-body);
	color: var(--color-body);
	padding: var(--size);
	border-radius: var(--border-radius);
	border: 1px solid var(--border-color);
}

.input-group {
	width: 100%;
	align-items: start !important;
	justify-content: space-between;
	flex-grow: 1;
	label,
	p {
		margin-top: var(--size);
	}
}

.false {
	outline: 2px solid var(--danger) !important;
	animation: vibrateAnimation 0.5s ease-out !important;
}

input[type="radio"] {
	all: unset;
	position: absolute;
	top: 1px;
	width: 0;
	height: 0;
}

input[type="radio"]:focus-visible {
	outline: 0 !important;
	border: 0 !important;
}

.todo-priority:focus-within {
	border-color: rgb(from var(--primary) r g b / 0.5) !important;
	outline: 5px solid rgb(from var(--primary) r g b / 0.1) !important;
}

.todo-priority {
	justify-content: space-between;
	border: 1px solid var(--border-color);
	background-color: var(--gray-700);
	position: relative;
	z-index: 0;

	margin-top: var(--size);
	width: 73.2%;
	border-radius: var(--border-radius);

	.vehicle {
		position: absolute;
		z-index: -1;
		left: 0;
		animation: moveAni 5s linear infinite;
	}

	label {
		--size: 6px;
		background-color: var(--bg-body);
		cursor: pointer;
		border-radius: var(--border-radius);
		outline-color: var(--primary);
		border: 1px solid var(--border-color);

		margin-top: 0;
		letter-spacing: 0.9px;
		font-size: 0.8rem;
		padding: var(--size) calc(var(--size) * 2);

		display: flex;
		align-items: center;
		justify-content: center;
		gap: 5px;

		transition: all 250ms ease-in;

		span {
			all: unset;
			font-size: 0;
			padding: 4px;
			border-radius: 50%;
			border: 0.5px solid var(--white);
		}

		svg {
			display: none;
		}
	}
}

input[type="radio"]:checked + label {
	padding: var(--size) calc(var(--size) * 1.5);
	outline: 3px solid rgb(from var(--primary) r g b / 0.5);
	border-radius: var(--border-radius);
	svg {
		display: inline-block;
	}
}
#todoDescription {
	overflow-wrap: break-word;
}

.date-overdue {
	color: var(--danger);
}

.theme-toggle {
	cursor: pointer;
	background-color: transparent;
	border: none;
	outline: none;
}

.empty-todo {
	flex-direction: column;
	gap: calc(var(--size) * 2);
}

.empty-todo p {
	color: var(--gray-500);
}

.delete-region {
	position: absolute;
	background-color: rgb(from var(--black) r g b / 0.5);
	bottom: 0;
	right: 0;
	z-index: 2000;
	height: 10em;
	width: 10em;
	border-top-left-radius: 100%;

	transition: all 200ms ease-out;
	svg {
		stroke: var(--white);
		height: 50%;
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-30%, -30%);

		transition: all;
	}
}

.delete-region-active {
	background-color: rgb(from var(--danger) r g b / 0.5);
	height: 16em;
	z-index: 2000;
	width: 16em;
	.trash-cap {
		transform: rotate(29deg) translateX(4px) translateY(-12px);
	}

	.trash-bin {
		transform: rotate(347deg) translateX(0) translateY(8px);
	}
}

::view-transition-old(root) {
	animation-delay: 0.3s;
}
::view-transition-new(root) {
	animation: themeChangeAni 0.3s;
}

@keyframes moveAni {
	0% {
		left: 0%;
		stroke: var(--low-priority);
	}
	50% {
		stroke: var(--medium-priority);
	}
	100% {
		left: calc(100% - var(--vehicle-width, 24px));
		stroke: var(--high-priority);
	}
}

@keyframes vibrateAnimation {
	0% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(5px);
	}
	50% {
		transform: translateX(-5px);
	}
	75% {
		transform: translateX(5px);
	}
	100% {
		transform: translateX(0);
	}
}

@keyframes themeChangeAni {
	from {
		clip-path: circle(0% at 93% 3%);
	}
	to {
		clip-path: circle(100% at 50% 50%);
	}
}

@media (max-width: 768px) {
	main {
		grid-template-columns: 1fr;
	}
	header h2 {
		visibility: hidden;
		content: "";
		font-size: 0;
	}
	header h2::after {
		font-size: 28px;
		visibility: visible;
		content: "Task App";
	}
	.modal-body {
		width: 90%;

		.input-group {
			flex-direction: column;
			margin-top: var(--size);
			input,
			textarea,
			select {
				width: 95%;
			}
		}

		.modal-actions {
			margin-top: calc(var(--size) * 1.5);
		}
	}

	.todo-priority {
		width: 100%;
	}

	@keyframes circle-timepass {
		from {
			clip-path: circle(0% at 69% 3%);
		}
		to {
			clip-path: circle(100% at 50% 50%);
		}
	}
}
