@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Space+Grotesk:wght@300..700&display=swap");

* {
  font-family: "Space Grotesk", sans-serif;
  color: white;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #444;
  background-size: cover;
  background-position: center;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

.todos {
  background: #30303070;
  border-radius: 16px;
  box-shadow: inset 2px 4px 16px 0 hsla(0, 0%, 97%, 0.06),
    0 4px 8px 0 hsla(0, 0%, 0%, 0.2), 0 8px 16px 0 hsla(0, 0%, 0%, 0.15),
    0 12px 24px 0 hsla(0, 0%, 0%, 0.1);
  backdrop-filter: blur(50px);
  width: 100%;
  max-width: 400px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.todos-title {
  font-size: 1.5rem;
  margin: 0;
}

.todos-header {
  display: flex;
  align-items: center;
}

.add-todo {
  margin-left: auto;
  background: hsla(0, 0%, 12%, 0.7);
  width: 44px;
  height: 44px;
  border-radius: 100%;
  border: none;
  box-shadow: inset 2px 4px 16px 0 hsla(0, 0%, 97%, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-todo:hover {
  background: hsla(0, 0%, 12%, 0.7);
}

.todos-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo {
  display: flex;
  align-items: center;
  gap: 6px;
  background: hsla(0, 0%, 97%, 0.05);
  border-radius: 8px;
  padding: 8px;

  font-size: 1rem;
}

.todo-text {
  color: hsla(0, 0%, 80%, 0.9);
  font-weight: 500;
  font-size: 1rem;
  width: 100%;
}

.todo.checked .todo-text {
  color: hsla(0, 0%, 80%, 0.5);
  text-decoration: line-through;
}

.todo input[type="text"] {
  background: none;
  padding: 0;
  margin: 0;
  border: 0;
  outline: none;
  outline-offset: 2px;
  border-radius: 4px;
}

.todo:focus-within {
  outline: 2px solid hsla(0, 0%, 46%, 0.8);
}

.todo-checkbox {
  --size: 20px;
  width: var(--size);
  height: var(--size);
  border-radius: 100%;
  border: 3px solid hsla(0, 0%, 70%, 0.8);
  transition: border-color 0.2s ease-in-out;
  display: flex;
  align-items: center;
  position: relative;
  justify-content: center;
  flex-shrink: 0;
}

.todo-checkbox:hover {
  border-color: hsla(0, 0%, 80%, 0.8);
}

.todo-checkbox-circle {
  --size: 12px;
  opacity: 0;
  transition: opacity 100ms ease-in-out;
  width: var(--size);
  height: var(--size);
  border-radius: 100%;
  background: linear-gradient(
    180deg,
    hsla(0, 0%, 97%, 0.8),
    hsla(0, 0%, 97%, 0.5)
  );
}

.todo.checked .todo-checkbox-circle {
  opacity: 1;
}

.todo-checkbox input {
  opacity: 0;
  position: absolute;
  inset: 0;
  z-index: 10;
  width: var(--size);
  height: var(--size);
  margin: 0;
}

.todo-delete {
  opacity: 0;
  transition: opacity 100ms ease-in-out;
}

.todo:hover .todo-delete {
  opacity: 1;
}

.todo-delete {
  width: 24px;
  height: 24px;
  border-radius: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.todo-delete:hover {
  background: hsla(0, 0%, 46%, 0.1);
}

.todo-delete svg {
  color: hsla(0, 0%, 46%, 1);
}

/* Background selector */

.background-selector {
  position: fixed;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 8px;
}

.background-selector-item {
  width: 40px;
  height: 40px;
  border-radius: 100%;
  background: red;
  background-size: cover;
  background-position: center;
  border: 0;
}

.todos-list:empty::after {
  content: "No todos yet";
  color: hsla(0, 0%, 80%, 0.5);
  font-size: 1rem;
  font-weight: 500;
}
