:root {
  --font-pretendard: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --color-accent: #4f46e5;
  --color-accent-hover: #4338ca;
  --color-done: #10b981;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-pretendard);
}

/* ── 필터 탭 ── */
.filter-tab {
  color: #64748b;
}
.filter-tab[aria-selected="true"] {
  background-color: #ffffff;
  color: #4f46e5;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.08), 0 1px 2px -1px rgba(0,0,0,0.04);
}
.filter-tab:hover:not([aria-selected="true"]) {
  color: #334155;
  background-color: rgba(255,255,255,0.6);
}
.filter-tab:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── 투두 아이템 ── */
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;
  animation: slideIn 0.2s ease;
}
.todo-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-color: #cbd5e1;
}
.todo-item.done {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.todo-item.done .todo-text {
  text-decoration: line-through;
  color: #94a3b8;
}

/* ── 커스텀 체크박스 ── */
.todo-check {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.todo-check:hover {
  border-color: var(--color-accent);
}
.todo-check:checked {
  background-color: var(--color-done);
  border-color: var(--color-done);
}
.todo-check:checked::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 9px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-0.5px, -1px);
}
.todo-check:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── 텍스트 ── */
.todo-text {
  flex: 1;
  font-size: 0.9375rem;
  color: #1e293b;
  line-height: 1.5;
  word-break: break-all;
  transition: color 0.15s ease;
}

/* ── 삭제 버튼 ── */
.delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  color: #cbd5e1;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.delete-btn:hover {
  color: #ef4444;
  background-color: #fef2f2;
}
.delete-btn:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* ── 토스트 ── */
.toast {
  background: #1e293b;
  color: #f1f5f9;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.16);
  pointer-events: auto;
  animation: toastIn 0.2s ease;
  max-width: 280px;
}
.toast.success {
  background: #065f46;
  color: #d1fae5;
}
.toast.error {
  background: #7f1d1d;
  color: #fee2e2;
}

/* ── 애니메이션 ── */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateY(0);
    max-height: 80px;
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
    max-height: 0;
    padding: 0;
    margin: 0;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── 모션 감소 ── */
@media (prefers-reduced-motion: reduce) {
  .todo-item,
  .toast,
  .todo-check,
  .todo-text,
  .delete-btn {
    animation: none;
    transition: none;
  }
}

/* ── 모바일 ── */
@media (max-width: 639px) {
  .todo-text {
    font-size: 0.875rem;
  }
}
