/* src/client/features/tasks/styles/TaskItem.css */
/* Styles for TaskItem component - individual task item with drag-and-drop support */

.task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  transition: padding 0.2s ease, background-color 0.2s ease, margin-left 0.2s ease, border-left-color 0.2s ease;
  position: relative;
}

.task-item:active {
  cursor: default;
}

.task-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.task-item--dragging {
  opacity: 0.5;
  background-color: rgba(59, 130, 246, 0.1);
  z-index: 1000;
  position: relative;
}

.task-item--drag-over {
  background-color: rgba(59, 130, 246, 0.1);
}

/* Подсветка зоны вылета (outdent zone) - оранжевая подсветка левого края */
.task-item--outdent-zone {
  border-left: 3px solid #f97316;
  background-color: rgba(249, 115, 22, 0.05);
}

.task-item--outdent-zone.task-item--nested {
  border-left-color: #f97316;
}

.task-item--completed .task-item__text {
  text-decoration: line-through;
  color: #9ca3af;
}

.task-item--nested {
  margin-left: 32px !important;
  border-left: 2px solid #d1d5db;
  padding-left: 8px;
  position: relative;
}

.task-item__drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #9ca3af;
  cursor: grab;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.task-item__drag-handle:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #6b7280;
}

.task-item__drag-handle:active {
  cursor: grabbing;
}

.task-item__checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3b82f6;
}

.task-item__text {
  flex: 1;
  min-width: 0;
  cursor: text;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item__input {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.task-item__input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.task-item__delete {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.task-item__delete:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

/* Undo deletion state */
.task-item--deleting {
  background-color: #f3f4f6;
  padding: 6px 8px;
  height: 36px;
}

.task-item__deleting-text {
  flex: 1;
  color: #6b7280;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item__deleting-text svg {
  vertical-align: middle;
  flex-shrink: 0;
}

.task-item__undo-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: none;
  background-color: #3b82f6;
  color: white;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  height: 24px;
  flex-shrink: 0;
}

.task-item__undo-btn:hover {
  background-color: #2563eb;
}

.task-item__undo-btn:active {
  background-color: #1d4ed8;
}

.task-item__undo-btn svg {
  flex-shrink: 0;
}
