/* ================================================================
   TechTools — 待办清单 (Todo List) Styles
   Indigo accent: --cat-study (#6366F1)
   ================================================================ */

/* ------------------------------------------------------------
   1. Add Task Row
   ------------------------------------------------------------ */
.todo-add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.todo-input {
  flex: 1 1 260px;
  min-width: 200px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.todo-input::placeholder {
  color: var(--text-muted);
}
.todo-input:focus {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15), 0 0 40px rgba(99, 102, 241, 0.06);
}

.todo-cat-select {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  min-width: 90px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.todo-cat-select:focus {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15), 0 0 40px rgba(99, 102, 241, 0.06);
}
.todo-cat-select option {
  background: #1a1040;
  color: var(--text-primary);
}

#btnAdd {
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   2. Filter Tabs
   ------------------------------------------------------------ */
.todo-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.todo-filter-tab {
  padding: 7px 18px;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.todo-filter-tab:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
}
.todo-filter-tab.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--cat-study);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2), 0 0 40px rgba(99, 102, 241, 0.08);
}

/* ------------------------------------------------------------
   3. Statistics Bar & Progress
   ------------------------------------------------------------ */
.todo-stats-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.todo-stats-text {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.todo-progress-track {
  flex: 1 1 160px;
  min-width: 120px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.todo-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cat-study), rgba(129, 140, 248, 0.8));
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* ------------------------------------------------------------
   4. Task List
   ------------------------------------------------------------ */
.todo-list {
  margin-bottom: 20px;
}

/* Task Item */
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  animation: todoFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.todo-item:hover {
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.04);
}
.todo-item.completed {
  opacity: 0.55;
}
.todo-item.completed:hover {
  opacity: 0.7;
}

@keyframes todoFadeIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Custom Checkbox */
.todo-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 6px;
  border: 2px solid rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
}
.todo-checkbox:hover {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}
.todo-checkbox:checked {
  background: var(--cat-study);
  border-color: var(--cat-study);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.4);
}
.todo-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Task Text */
.todo-text {
  flex: 1;
  font-size: 15px;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.5;
  transition: all 0.3s ease;
}
.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Category Tag */
.todo-tag {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid;
}
.todo-tag.tag-work   { color: var(--accent-cyan);    border-color: rgba(46,  167, 255, 0.3); background: rgba(46,  167, 255, 0.08); }
.todo-tag.tag-study  { color: var(--cat-study);      border-color: rgba(99,  102, 241, 0.3); background: rgba(99,  102, 241, 0.08); }
.todo-tag.tag-life   { color: var(--accent-teal);    border-color: rgba(19,  221, 196, 0.3); background: rgba(19,  221, 196, 0.08); }
.todo-tag.tag-other  { color: var(--text-muted);     border-color: rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.04); }

/* Delete Button */
.todo-delete {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  line-height: 1;
}
.todo-delete:hover {
  background: rgba(255, 77, 109, 0.12);
  border-color: rgba(255, 77, 109, 0.3);
  color: var(--accent-rose);
}

/* ------------------------------------------------------------
   5. Action Buttons
   ------------------------------------------------------------ */
.todo-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
   6. Responsive
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .todo-add-row {
    flex-direction: column;
  }
  .todo-input {
    min-width: 0;
  }
  .todo-cat-select {
    width: 100%;
  }
  #btnAdd {
    width: 100%;
  }
  .todo-item {
    flex-wrap: wrap;
    gap: 8px;
  }
  .todo-tag {
    order: 3;
    margin-left: 32px;
  }
  .todo-delete {
    order: 4;
  }
}

@media (max-width: 480px) {
  .todo-filter-tabs {
    gap: 6px;
  }
  .todo-filter-tab {
    padding: 6px 14px;
    font-size: 12px;
  }
  .todo-stats-bar {
    gap: 8px;
  }
}
