
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background: #f5f6f8;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding-top: 40px;
}

.container {
  width: 100%;
  max-width: 400px;
}

.main {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 15px;
  background: #ffffff;
  padding: 28px 22px;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

.main h2 {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: #333;
}
.main>p{
    text-align:center;
}
.box1 {
  display: flex;
  gap: 10px;
}

#task {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d9d9d9;
  font-size: 15px;
  transition: border-color .2s ease;
}

#task:focus {
  border-color: #4a8bfe;
  outline: none;
}

#sub {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #4a8bfe;
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
}

#sub:hover {
  background: #2f6ff0;
  transform: scale(1.05);
}

.display {
  width: 155px;
  height: 155px;
  margin: 0 auto;
  background: #0a6f14;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.display p {
  position: absolute;
  color: #fff;
  font-size: 40px;
  font-weight: 600;
}

#taskDone { top: 20px; left: 50%; transform: translateX(-50%) }
#totalTasks { bottom: 20px; left: 50%; transform: translateX(-50%) }

.display span {
  width: 80px;
  height: 4px;
  background: white;
  border-radius: 8px;
  transform: rotate(-22deg);
}

.clearTasks {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 220px;
  margin:0 auto;
}

#clearAll,#clearCompleted {
  padding: 12px 16px;
  width:50%;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s ease;
  background: #f1f1f1;
  color: #111;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

#clearAll:hover {
  background: rgba(255, 80, 80, .18);
  color: #b90000;
}

#clearCompleted:hover {
  background: rgba(80, 150, 255, .18);
  color: #0054d1;
}

.progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress p {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.progressbar {
  width: 100%;
  height: 12px;
  border-radius: 8px;
  background: #e5f2e7;
  overflow: hidden;
}

.done {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2ca02c, #0a6f14);
  border-radius: 8px;
  transition: width 0.3s ease;
}

.task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e3e3e3;
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}

.task:hover {
  transform: translateY(-2px);
}

.task p {
  flex: 1;
  margin-left: 8px;
  font-size: 15px;
  color: #333;
}

.task button {
  border: none;
  padding: 6px 10px;
  margin-left: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s ease;
}

.task .remove-btn {
  background: #e63c3c;
}

.task .remove-btn:hover {
  background: #d62828;
}

.task .update-btn {
  background: #4a8bfe;
}

.task .update-btn:hover {
  background: #2f6ff0;
}
