/* ==========================================================================
   NEW-TODO.CSS — ИЗОЛИРОВАННЫЕ СТИЛИ ДЛЯ МИНИМАЛИСТИЧНОГО TO-DO СПИСКА
   ========================================================================== */

:root {
    --td-bg: rgba(30, 34, 42, 0.85);
    --td-border: rgba(255, 255, 255, 0.08);
    --td-border-active: #4a90e2;
    --td-text: #e2e8f0;
    --td-text-muted: #94a3b8;
    --td-accent: #10b981; /* Зеленый акцент для To-Do */
    --td-danger: #ef4444; /* Красный для удаления */
    --td-radius: 12px;
}

/* Привязка стилей только к ноде со специальным классом */
.node.node-block-type .block.todo-list-node {
    padding: 14px 0 14px 0;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.node-block-type .node-todo-title .todo-title{
    color: #ffffff;
    padding: 0 10px 10px 10px;
    width: 100%;
}

/* Главный контейнер для строк задач */
.node-block-type .node-todo-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 0 14px 0 0;
}

/* Кастомизация скроллбара списка задач */
.node-block-type .node-todo-container::-webkit-scrollbar {
    width: 4px;
}
.node-block-type .node-todo-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}
.node-block-type .node-todo-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   СТРОКА ЗАДАЧИ (TODO ITEM ROW)
   ========================================== */
.node-block-type .todo-item-row {
    position: relative; /* Создаем контекст для выноса точки влево */
    display: flex;
    align-items: center;
    gap: 8px;
    height: 28px; /* Фиксированная высота для точного совпадения с шагом портов */
    box-sizing: border-box;
    padding-left: 20px; /* Оставляем внутренний отступ для компенсации выноса порта */
}

/* Состояние выполненной задачи (зачеркивание и полупрозрачность) */
.node-block-type .todo-item-row.completed {
    opacity: 0.5;
}
.node-block-type .todo-item-row.completed .todo-input {
    text-decoration: line-through;
    color: var(--td-text-muted);
}

/* ВЫРЕЗАНА СТАРАЯ ГРЯЗЬ: Новые чистые стили для встроенного порта */
.node-block-type .todo-item-row .port-entity {
    position: absolute;
    left: -8px; /* Выносим точку влево за пределы границы содержимого */
    transform: translateY(-50%) !important; /* Намертво центрируем напротив чекбокса */
    z-index: 100;
}

/* Стили самого интерактивного кружка порта */
.node-block-type .todo-item-row .port.input {
    position: static; /* Отменяем старые инлайн-смещения библиотеки */
    cursor: crosshair;
}

/* Кастомный чекбокс */
.node-block-type .todo-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: rgba(15, 17, 23, 0.6);
    border: 1px solid var(--td-border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    outline: none;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.node-block-type .todo-checkbox:checked {
    background: var(--td-accent);
    border-color: var(--td-accent);
}

.node-block-type .todo-checkbox:checked::after {
    content: "✓";
    position: absolute;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    left: 3px;
    top: -1px;
}

/* Текстовое поле ввода задачи */
.node-block-type .todo-input {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    color: var(--td-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.node-block-type .todo-input:focus {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(15, 17, 23, 0.4);
}

/* Кнопка удаления отдельной строки (Крестик) */
.node-block-type .todo-btn-del {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    font-size: 11px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.node-block-type .todo-item-row:hover .todo-btn-del {
    color: var(--td-text-muted); /* Показываем крестик при наведении на строку */
}

.node-block-type .todo-btn-del:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--td-danger) !important;
}

/* ==========================================
   КНОПКА ДОБАВЛЕНИЯ НОВОЙ ЗАДАЧИ
   ========================================== */
.node-block-type .todo-btn-add {
    background: rgba(16, 185, 129, 0.06);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    color: #10b981;
    border-radius: 6px;
    padding: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin: 6px auto 0 auto;
    width: 88%;
    transition: background 0.15s ease, border-color 0.15s ease;
    text-align: center;
    box-sizing: border-box;
}

.node-block-type .todo-btn-add:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.6);
}
