/* VARIABLES */
:root {
	/* Colors */
	--color-white: #fff;
	--color-text: #fbf7f7;
	--color-placeholder: #dcdada;
	--color-input-bg: hsla(351, 100%, 87%, 0.302);
	--color-border: rgba(255, 255, 255, 0.18);
	--color-shadow: rgba(0, 0, 0, 0.5);
	--color-soft-pink: rgb(196, 116, 129);
	--color-editing: #f29900;

	/* Effects */
	--blur-strength: 6px;

	/* Typography */
	--font-family: "Baloo 2", serif;
	--font-size-base: clamp(1rem, 0.85rem + 0.25vw, 1.5rem);
	--font-size-h1: clamp(1.5rem, 1.4rem + 0.5vw, 2rem);
	--font-size-h2: clamp(1.2rem, 1.15rem + 0.5vw, 1.7rem);
	--font-size-input: clamp(1rem, 0.95rem + 0.25vw, 1.5rem);
	--font-size-btn: clamp(0.75rem, 0.7rem + 0.25vw, 1.2rem);

	/* Layout */
	--border-radius: 20px;
	--border-radius-input: 22px;
	--container-padding: 2rem;
	--gap: 1.125rem;
}

/* GLOBAL STYLES */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

button, input {
	-webkit-tap-highlight-color: transparent;
}

body {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	min-height: 100svh;
	font-family: var(--font-family);
	font-weight: 500;
	color: var(--color-white);
}

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

.container {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	padding: var(--container-padding);
}

/* TODO APP */
.todo-app {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--gap);
	width: 100%;
	max-width: 400px;
	max-height: 90vh;
	padding: 1.5rem 2rem;
	border: 3px solid var(--color-border);
	border-radius: var(--border-radius);
	box-shadow: 0 0 10px var(--color-shadow);
	backdrop-filter: blur(var(--blur-strength));
}

header {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	position: relative;
}

h1 {
	font-size: var(--font-size-h1);
}
#toggle-theme {
	border: none;
	cursor: pointer;
	background-color: transparent;
	position: absolute;
	right: 0;
	font-size: 1.4rem;
}

/* STATS SECTION */
.stat-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	width: 100%;
	padding: 15px 20px;
	margin-bottom: 16px;
	border: 2px solid var(--color-border);
	border-radius: 10px;
}

.details > h2 {
	font-size: var(--font-size-h2);
	color: var(--color-white);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
}

#progress-bar {
	width: 100%;
	height: 7px;
	background: var(--color-input-bg);
	border-radius: 20px;
	margin-top: 15px;
}

#progress {
	width: 0%;
	height: 100%;
	border-radius: 20px;
	background: var(--color-soft-pink);
	transition: width 0.3s ease;
}

#numbers {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background-color: var(--color-soft-pink);
	border: 2px solid var(--color-input-bg);
	color: var(--color-white);
	font-weight: bold;
	font-size: var(--font-size-base);
}

/* INPUT AREA */
.input-area {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	position: relative;
}

.warning-msg {
	position: absolute;
	top: -35px;
	left: calc(50% - 55px);
	width: 110px;
	text-align: center;
	padding: 2px;
	background: var(--color-soft-pink);
	color: var(--color-white);
	font-weight: bold;
	font-size: 1rem;
	border-radius: 6px;
	white-space: nowrap;
	pointer-events: none;
	animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.input-area input {
	flex: 1;
	padding: 8px 16px;
	font-size: var(--font-size-input);
	font-family: var(--font-family);
	border: none;
	outline: none;
	border-radius: var(--border-radius-input);
	background-color: var(--color-input-bg);
	color: var(--color-text);
	caret-color: var(--color-text);
}

.input-area input::placeholder {
	color: var(--color-placeholder);
}

.input-area input:focus {
	background-color: rgba(255, 194, 209, 0.45);
	transition: background-color 0.2s ease;
}

/* Override browser autofill */
input:-webkit-autofill,
input:-webkit-autofill:focus,
input:-webkit-autofill:hover {
	-webkit-box-shadow: 0 0 0 30px var(--color-input-bg) inset !important;
	-webkit-text-fill-color: var(--color-text) !important;
	caret-color: var(--color-text);
	transition: background-color 9999s ease-in-out 0s;
}

.input-area button {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-left: 10px;
	padding: 8px;
	border-radius: 50%;
	cursor: pointer;
	color: var(--color-white);
	font-size: var(--font-size-btn);
	background-color: var(--color-input-bg);
	border: 2px solid var(--color-border);
	transition: all 0.2s ease;
}

.input-area button:hover {
	transform: scale(1.1);
	background: var(--color-soft-pink);
}

/* TASK LIST */
#tasks-list {
	width: 98%;
	list-style: none;
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: none;
}

#tasks-list li {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	padding: 8px 10px;
	margin-bottom: 14px;
	border-radius: 8px;
	background: var(--color-input-bg);
	font-size: var(--font-size-base);
	transition: box-shadow 0.2s ease;
	margin-right: 0.8rem;
}

#tasks-list li:hover {
	box-shadow:  inset 0px 0px 4px var(--color-shadow);
}

#tasks-list li span {
	flex: 1;
	margin-left: 10px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#tasks-list li button {
	width: 30px;
	height: 30px;
	margin: 0 10px;
	border: none;
	border-radius: 50%;
	font-size: var(--font-size-btn);
	background: var(--color-input-bg);
	color: var(--color-white);
	cursor: pointer;
	transition: all 0.2s ease;
}

#tasks-list li button:hover {
	transform: scale(1.1);
}

#tasks-list li .edit-btn:hover {
	background: var(--color-editing);
}

#tasks-list li .delete-btn:hover {
	background: var(--color-soft-pink);
}

.task-check {
	appearance: none;
	min-width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	background: transparent;
	border-radius: 50%;
	cursor: pointer;
	transition: all 0.2s ease;
}

.task-check:checked {
	background: var(--color-soft-pink);
	transform: scale(1.1);
}

.completed {
	text-decoration: 2px line-through;
	opacity: 0.7;
}

/* EDIT */
.edit-area {
	margin-left: 3px;
	padding: 4px 8px;
	width: 50%;
	font-size: 1rem;
	font-family: var(--font-family);
	border: none;
	outline: none;
	border-radius: var(--border-radius-input);
	background-color: var(--color-input-bg);
	color: var(--color-white);
	caret-color: var(--color-text);
}

/* FREE DAY IMAGE */
.img-container {
	display: flex;
	justify-content: center;
	align-items: center;
}

.empty-img {
	width: 70%;
	height: auto;
	margin: 0 auto;
	display: none;
}

/* MEDIA QUERIES */
@media (max-width: 600px) {
	.todo-app {
		backdrop-filter: none;
		background-color: rgba(0, 0, 0, 0.4);
	}
}
@media (max-width: 400px) {
	.stat-container {
		flex-direction: column;
	}
	.input-area input {
		width: 50vw;
	}
	#tasks-list li button,
	.input-area button {
		width: 24px;
		height: 24px;
		margin: 0 6px;
	}
}