:root {
  --bg: #FAFFCA;
  --card-bg: #B9D4AA;
  --text: #5A827E;
  --accent: #84AE92;
  --input-bg: #FAFFCA;
  --delete-bg: #B9D4AA;
}

body.dark {
  --bg: #2A2A2A;
  --card-bg: #3C3C3C;
  --text: #FAFFCA;
  --accent: #84AE92;
  --input-bg: #555555;
  --delete-bg: #4A4A4A;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding: 1rem;
  margin: 1rem;
  display: flex;
  flex-direction: column;
  /* justify-content: center; */
  min-height: 100vh;
  align-items: center;
  transition: background 0.3s;
}

.todo-container {
  background: var(--card-bg);
  padding: 1.5rem;
  width: 100%;
  max-width: 450px;
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(90, 130, 126, 0.2);
  transition: background 0.3s;
}

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

h1 {
  text-align: center;
  color: var(--text);
  margin-bottom: 1.2rem;
  display: inline-block;
}

.input-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

input[type="text"] {
  flex: 1;
  padding: 0.7rem;
  border: 2px solid var(--accent);
  border-radius: 0.5rem;
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--text);
}

input[type="text"]:focus {
  border-color: var(--text);
  outline: none;
}

.add-btn {
  padding: 0.7rem 1.2rem;
  background: var(--text);
  border: none;
  color: var(--bg);
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.3s;
}

.add-btn:hover {
  opacity: 0.8;
}

/* Theme Toggle Button */
.theme-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 100%;
  background: var(--text);
  border: none;
  cursor: pointer;
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

.theme-btn:hover {
  opacity: 0.8;
}

.theme-btn .theme-icon {
  font-size: 1.2rem;
  color: #000; /* Always black icon */
  pointer-events: none;
}

ul {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

li {
  background: var(--input-bg);
  padding: 0.7rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 4px rgba(90, 130, 126, 0.1);
}

li.completed span {
  text-decoration: line-through;
  opacity: 0.6;
}

.delete-btn {
  margin-left: auto;
  background: var(--delete-bg);
  border: none;
  color: var(--text);
  padding: 0.4rem 0.7rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.3s;
}

.delete-btn:hover {
  opacity: 0.7;
}

@media (max-width: 480px) {
  .input-row {
    flex-direction: column;
  }

  .add-btn,
  .theme-btn {
    padding: 0.8rem;
    font-size: 1rem;
  }
}

/* progress bar */

.progress-container {
  width: 80%;
  max-width: 500px;
  background: #e0e0e0;
  border-radius: 30px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  position: relative;
  height: 30px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: calc(var(--progress) * 1%);
  background: linear-gradient(90deg, #5a827e, #84ae92, #b9d4aa);
  border-radius: 30px 0 0 30px;
  transition: width 0.6s ease-in-out;
}

.progress-label {
  position: absolute;
  right: .7rem;
  font-size: .8rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: bold;
  color: #333;
}

.achivement{
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}