/* 1. Box sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Improve text rendering */
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 4. Media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 5. Inherit fonts */
input,
button,
textarea,
select {
  font: inherit;
}

/* 6. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* --------------------------------------------------------- */
body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background: #f5f6fa;
  display: flex;
  justify-content: center;
}

main {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  width: 512px;
  margin-top: 24px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

h1 {
  text-align: center;
  margin-bottom: 10px;
}

section p {
  text-align: center;
  color: #666;
}

form {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 15px 0;
}

input[type="text"] {
  flex: 1;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

button {
  padding: 8px 12px;
  border-color: #007bff;
  border: none;
  background: #007bff;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

ul {
  list-style: none;
  padding: 0;
}

li {
  display: flex;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 8px;
  justify-content: space-between;
  align-items: center;
  background: #f1f2f6;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.todo-text {
  flex: 1;
  padding: 10px;
  transition: all 0.2s ease;
}

.checkbox {
  cursor: pointer;
  width: 18px;
}

.completed-task .todo-text {
  text-decoration: line-through;
  color: #999;
  opacity: 0.7;
}

/* Handle button */
.btn-edit {
  background: #2ecc71;
  color: white;
}

.btn-edit:hover {
  background: #1fa858;
  color: white;
}

.btn-delete {
  background: #e74c3c;
  color: white;
}

.btn-delete:hover {
  background: #c23b2c;
  color: white;
}

.todo-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
}

#check-all {
  font-size: 16px;
  border-radius: 6px;
  background: #2d7ef7;
  color: white;
  border: none;
  cursor: pointer;
  width: 18px;
}

/* FILTER */
.filter-tabs {
  gap: 16px;
  display: flex;
}

.filter-btn {
  cursor: pointer;
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: none;
  color: #cccccc;
}

/* This is the class we will add to the active tab */
.filter-btn.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* RESPONSIVE MEDIA */
@media (max-width: 500px) {
  main {
    margin: 0;
  }

  /* form jadi vertikal */
  .form {
    flex-direction: column;
  }

  #btn-add {
    width: 100%;
  }

  /* todo item jadi stack */
  .todo-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .todo-actions {
    width: 20%;
    justify-content: flex-end;
  }

  .todo-actions button {
    flex: 1;
  }
}
