@charset "UTF-8";

/* =========================================================
   04 Todo List Modern Theme & High-Contrast Form Styles
   ========================================================= */

/* 기본 폰트 및 부드러운 스크롤 */
:root {
  color-scheme: light dark;
}

html {
  scroll-behavior: smooth;
}

/* 라이트 모드 기본 배경 및 텍스트 */
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* =========================================================
   폼 입력요소 & 셀렉트 박스 고대비 가독성 보장 (Crucial UX)
   ========================================================= */

/* 인풋 및 텍스트에어리어 공통 */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="search"],
textarea {
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

/* 라이트 모드 인풋 */
html:not(.dark) input[type="text"],
html:not(.dark) input[type="password"],
html:not(.dark) input[type="date"],
html:not(.dark) input[type="time"],
html:not(.dark) input[type="search"],
html:not(.dark) textarea,
html:not(.dark) select {
  background-color: #ffffff !important;
  color: #0f172a !important; /* slate-900 */
  border-color: #cbd5e1 !important; /* slate-300 */
}

html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
  color: #94a3b8 !important; /* slate-400 */
}

/* 다크 모드 인풋 & 셀렉트 박스 고대비 설정 */
html.dark input[type="text"],
html.dark input[type="password"],
html.dark input[type="date"],
html.dark input[type="time"],
html.dark input[type="search"],
html.dark textarea,
html.dark select {
  background-color: #1e293b !important; /* slate-800 */
  color: #f8fafc !important; /* slate-50 */
  border-color: #334155 !important; /* slate-700 */
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important; /* slate-500 */
}

/* 셀렉트 옵션 드롭다운 내부 가독성 */
select option {
  background-color: #ffffff;
  color: #0f172a;
  padding: 8px 12px;
}

html.dark select option {
  background-color: #1e293b !important;
  color: #f8fafc !important;
}

/* 포커스 링 */
input:focus,
textarea:focus,
select:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

html.dark input:focus,
html.dark textarea:focus,
html.dark select:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3) !important;
}

/* 달력 / 시간 피커 아이콘 다크모드 반전 */
html.dark input[type="date"]::-webkit-calendar-picker-indicator,
html.dark input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* =========================================================
   커스텀 체크박스 인터랙션
   ========================================================= */
.todo-checkbox {
  position: relative;
  appearance: none;
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid #94a3b8;
  border-radius: 0.375rem;
  background-color: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.todo-checkbox:hover {
  border-color: #3b82f6;
  transform: scale(1.05);
}

.todo-checkbox:checked {
  background-color: #10b981; /* emerald-500 */
  border-color: #10b981;
}

.todo-checkbox:checked::after {
  content: '';
  display: block;
  width: 0.35rem;
  height: 0.65rem;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* =========================================================
   완료 항목 취소선 및 페이드 효과
   ========================================================= */
.todo-completed-title {
  text-decoration: line-through;
  opacity: 0.6;
}

.todo-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease, border-color 0.15s ease;
}

.todo-card:hover {
  transform: translateY(-1px);
}

/* =========================================================
   모달 애니메이션
   ========================================================= */
.modal-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background-color: rgba(15, 23, 42, 0.6);
}

.modal-content {
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* =========================================================
   스크롤바 스타일링
   ========================================================= */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* =========================================================
   프로그레스 바 부드러운 애니메이션
   ========================================================= */
.progress-fill {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================
   토스트 알림 스타일링
   ========================================================= */
.toast-slide {
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
