* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  color: #f0f0f0;
  min-height: 100vh;
}
.wrapper {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 80px;
}
.app-card {
  width: 100%;
  max-width: 640px;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  animation: cardIn 0.5s ease both;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-header {
  padding: 32px 28px 24px;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -2px;
  line-height: 1;
}

.task-counter {
  font-size: 11px;
  color: #666;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 6px 14px;
}
.task-counter b {
  color: #fff;
}

.app-body {
  padding: 24px 28px;
}

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.search-wrap {
  position: relative;
  flex: 1;
}
.search-wrap .si {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  font-size: 12px;
  pointer-events: none;
}

#searchField {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 11px 14px 11px 38px;
  font-size: 13px;
  color: #f0f0f0;
  outline: none;
  transition: border-color 0.2s;
}
#searchField::placeholder {
  color: #444;
}
#searchField:focus {
  border-color: #3a3a3a;
  background: #111;
}

#searchBtn {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}
#searchBtn:hover {
  background: #161616;
  border-color: #3a3a3a;
  color: #fff;
}
#searchBtn.active {
  background: #fff;
  border-color: #fff;
  color: #000;
}

.divider {
  height: 1px;
  background: #1e1e1e;
  margin-bottom: 16px;
}

.add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

#todoInput {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  color: #f0f0f0;
  outline: none;
  transition: border-color 0.2s;
}
#todoInput::placeholder {
  color: #444;
}
#todoInput:focus {
  border-color: #3a3a3a;
  background: #111;
}

#addBtn {
  background: #fff;
  border: 1px solid #fff;
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 11px;
  font-weight: 700;
  color: #000;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: all 0.2s;
}
#addBtn:hover {
  background: #ddd;
  border-color: #ddd;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
}
#addBtn.update {
  background: #f5c518;
  border-color: #f5c518;
  color: #000;
}
#addBtn.update:hover {
  background: #e0b015;
  border-color: #e0b015;
}

.section-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: #444;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #1e1e1e;
}

#todoList {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#todoList li {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 3px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.2s;
  animation: itemIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  position: relative;
  overflow: hidden;
}

#todoList li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.25s;
}
#todoList li:hover {
  border-color: #2a2a2a;
  background: #141414;
  transform: translateX(3px);
}
#todoList li:hover::before {
  transform: scaleY(1);
}
#todoList li.done {
  background: #0c130c;
  border-color: #1a2e1a;
}
#todoList li.done::before {
  background: #00f56e;
  transform: scaleY(1);
}
#todoList li.done .todo-text {
  text-decoration: line-through;
  color: #4a4a4a;
}

@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes itemOut {
  from {
    opacity: 1;
    transform: translateX(0);
    max-height: 70px;
  }
  to {
    opacity: 0;
    transform: translateX(50px);
    max-height: 0;
    padding: 0;
    border-width: 0;
  }
}
#todoList li.removing {
  animation: itemOut 0.3s ease forwards;
  pointer-events: none;
}
#todoList li .todo-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  word-break: break-word;
  transition:
    color 0.3s,
    text-decoration 0.3s;
}
#todoList li .actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ibtn {
  width: 30px;
  height: 30px;
  border-radius: 2px;
  border: 1px solid #2a2a2a;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: #555;
  transition: all 0.18s;
}
.ibtn.done-btn {
  border-color: #2a2a2a;
  color: #555;
  position: relative;
}
.ibtn.done-btn:hover {
  color: #3ddc84;
  border-color: rgba(61, 220, 132, 0.4);
  background: rgba(61, 220, 132, 0.08);
  transform: scale(1.1);
}
li.done .ibtn.done-btn {
  color: #3ddc84;
  border-color: rgba(61, 220, 132, 0.5);
  background: rgba(61, 220, 132, 0.1);
}@keyframes checkPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35) rotate(-10deg);
  }
  70% {
    transform: scale(0.9) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}
.ibtn.done-btn.popping {
  animation: checkPop 0.45s cubic-bezier(0.34, 1.6, 0.64, 1) both;
}
.ibtn.edit:hover {
  color: #f5c518;
  border-color: rgba(245, 197, 24, 0.4);
  background: rgba(245, 197, 24, 0.08);
}
.ibtn.del:hover {
  color: #ff3b3b;
  border-color: rgba(255, 59, 59, 0.4);
  background: rgba(255, 59, 59, 0.08);
}
#emptyState {
  text-align: center;
  padding: 48px 0;
  display: none;
}
#emptyState.show {
  display: block;
}
#emptyState .et {
  font-size: 10px;
  letter-spacing: 3px;
  color: #333;
  text-transform: uppercase;
}
.hidden {
  display: none !important;
}
.app-footer {
  padding: 14px 28px;
  border-top: 1px solid #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hint {
  font-size: 9px;
  color: #444;
  letter-spacing: 1px;
}
#clearBtn {
  font-size: 9px;
  color: #444;
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.2s;
  padding: 0;
}
#clearBtn:hover {
  color: #ff3b3b;
}
