/* Base & Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard Variable", Pretendard, "Malgun Gothic", "맑은 고딕", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: #FBF9F8;
  color: #262626;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
}

@media (min-width: 640px) {
  .app-container {
    padding: 48px 16px;
  }
}

.main-content {
  width: 100%;
  max-width: 512px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Cards */
.card {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(229, 231, 235, 0.9);
}

@media (min-width: 640px) {
  .card {
    padding: 24px;
    border-radius: 20px;
  }
}

/* Header Card */
.header-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.date-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #737373;
}

.date-badge .icon {
  color: #FF5732;
  width: 16px;
  height: 16px;
}

.badge-pending {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  background-color: rgba(255, 87, 50, 0.1);
  color: #FF5732;
}

.header-title-wrap {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-size: 24px;
  font-weight: 800;
  color: #171717;
  letter-spacing: -0.025em;
}

@media (min-width: 640px) {
  .header-title {
    font-size: 28px;
  }
}

.header-subtitle {
  font-size: 14px;
  color: #737373;
  margin-top: 4px;
}

/* Progress Bar */
.progress-bar-wrap {
  width: 100%;
  background-color: #F5F5F5;
  height: 8px;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-fill {
  background-color: #FF5732;
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Input Section */
.input-card {
  padding: 16px 20px;
}

.todo-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#todo-input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  background-color: rgba(250, 250, 250, 0.5);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
  color: #171717;
}

#todo-input:focus {
  background-color: #ffffff;
  border-color: #FF5732;
  box-shadow: 0 0 0 3px rgba(255, 87, 50, 0.15);
}

#todo-input.input-error {
  border-color: #F87171;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

#todo-input::placeholder {
  color: #A3A3A3;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px;
  border-radius: 12px;
  background-color: #FF5732;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-primary:hover {
  background-color: #E84A27;
}

.btn-primary:active {
  transform: scale(0.98);
}

.error-message {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #EF4444;
  padding: 0 4px;
}

.error-message.hidden {
  display: none;
}

/* List Card */
.list-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F3F4F6;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #F3F4F6;
  padding: 4px;
  border-radius: 12px;
}

.filter-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #737373;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  color: #262626;
}

.filter-btn.active {
  background-color: #ffffff;
  color: #171717;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-btn.active[data-filter="active"] {
  color: #FF5732;
}

.btn-clear-completed {
  font-size: 12px;
  font-weight: 500;
  color: #A3A3A3;
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.btn-clear-completed:hover {
  color: #EF4444;
}

.btn-clear-completed.hidden {
  display: none;
}

/* Todo Items */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  background-color: #ffffff;
  transition: all 0.15s ease;
}

.todo-item:hover {
  border-color: #D4D4D4;
}

.todo-item.completed {
  background-color: rgba(250, 250, 250, 0.8);
  border-color: rgba(229, 231, 235, 0.6);
}

.todo-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.checkbox-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #D4D4D4;
  background-color: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.checkbox-btn:hover {
  border-color: #FF5732;
}

.todo-item.completed .checkbox-btn {
  background-color: #FF5732;
  border-color: #FF5732;
  color: #ffffff;
}

.checkbox-btn .icon-check {
  display: none;
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.todo-item.completed .checkbox-btn .icon-check {
  display: block;
}

.todo-text {
  font-size: 15px;
  color: #262626;
  font-weight: 500;
  word-break: break-all;
  line-height: 1.4;
  transition: all 0.15s ease;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: #A3A3A3;
}

.todo-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-toggle-status {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background-color: rgba(255, 87, 50, 0.1);
  color: #FF5732;
  transition: all 0.15s ease;
}

.btn-toggle-status:hover {
  background-color: #FF5732;
  color: #ffffff;
}

.todo-item.completed .btn-toggle-status {
  background-color: rgba(229, 231, 235, 0.7);
  color: #525252;
}

.todo-item.completed .btn-toggle-status:hover {
  background-color: #E5E7EB;
}

.btn-delete {
  padding: 6px;
  color: #A3A3A3;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-delete:hover {
  color: #EF4444;
  background-color: #FEE2E2;
}

.btn-delete .icon {
  width: 16px;
  height: 16px;
}

/* Empty State */
.empty-state {
  padding: 48px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background-color: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: rgba(255, 87, 50, 0.7);
}

.empty-icon-wrap .icon {
  width: 24px;
  height: 24px;
}

.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: #525252;
}

.empty-desc {
  font-size: 12px;
  color: #A3A3A3;
  margin-top: 4px;
}

/* Footer Stats */
.list-footer {
  padding-top: 12px;
  border-top: 1px solid #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #737373;
}

.list-footer strong {
  font-weight: 600;
  color: #171717;
}

.list-footer #footer-completed-count {
  color: #FF5732;
}

/* Icons */
.icon {
  display: inline-block;
  vertical-align: middle;
}
