/* ============================================================
   CHECKLIST STYLES - Стили для чеклиста
   ============================================================ */

/* Обёртка чеклиста */
.checklist-wrapper {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Заголовок чеклиста */
.checklist-header h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Контейнер списка пунктов */
.checklist-items {
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Пустой чеклист */
.checklist-empty {
    padding: 1.5rem;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Пункт чеклиста */
.checklist-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.checklist-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #ccc;
}

/* Выполненный пункт */
.checklist-item.completed {
    background-color: #f0f8f0;
    border-color: #28a745;
    opacity: 0.8;
}

/* Чекбокс */
.checklist-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
}

/* Текст пункта */
.checklist-item-text {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
    word-break: break-word;
    transition: all 0.2s ease;
    cursor: pointer;
}

.checklist-item-text:hover {
    color: #007bff;
}

/* Поле редактирования пункта */
.checklist-edit-input {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #007bff;
    border-radius: 4px;
    font-size: 0.95rem;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Зачёркнутый текст для выполненных */
.checklist-item.completed .checklist-item-text {
    text-decoration: line-through;
    color: #666;
}

/* Кнопка удаления пункта */
.checklist-delete-btn {
    width: 24px;
    height: 24px;
    margin-left: 0.5rem;
    padding: 0;
    border: none;
    background-color: transparent;
    color: #999;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.checklist-delete-btn:hover {
    color: #dc3545;
}

/* Форма добавления нового пункта */
.checklist-add-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.checklist-input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.checklist-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.checklist-add-btn {
    padding: 0.6rem 1.2rem;
    white-space: nowrap;
}

/* Прогресс чеклиста на карточке */
.card-checklist-progress {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    background-color: #e8f4fd;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #0066cc;
    margin-right: 0.5rem;
}

.card-checklist-progress.completed {
    background-color: #d4edda;
    color: #28a745;
}

/* Анимация появления пункта */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checklist-item {
    animation: slideIn 0.2s ease;
}

/* ============================================================
   CHECKLIST НА КАРТОЧКЕ - Компактное отображение на доске
   ============================================================ */

/* Контейнер для чеклиста на карточке (как отдельный блок) */
.card-checklist-progress-container {
    margin-top: 0.75rem;
}

/* Обёртка чеклиста на карточке */
.card-checklist-wrapper {
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Заголовок с прогрессом */
.card-checklist-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e0e0e0;
}

.card-checklist-header.completed {
    color: #28a745;
}

/* Список пунктов на карточке */
.card-checklist-items {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Пункт чеклиста на карточке (компактный) */
.card-checklist-item {
    display: flex;
    align-items: center;
    padding: 0.3rem;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.card-checklist-item:hover {
    border-color: #ccc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Выполненный пункт на карточке */
.card-checklist-item.completed {
    background-color: #e8f5e9;
    border-color: #81c784;
}

/* Чекбокс на карточке */
.card-checklist-item .checklist-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

/* Текст пункта на карточке */
.card-checklist-item .checklist-item-text {
    flex: 1;
    font-size: 0.85rem;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Зачёркнутый текст для выполненных на карточке */
.card-checklist-item.completed .checklist-item-text {
    text-decoration: line-through !important;
    color: #666 !important;
    opacity: 0.7;
}

/* Индикатор "еще пунктов" */
.card-checklist-more {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #999;
    text-align: center;
    font-style: italic;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .checklist-wrapper {
        padding: 0.75rem;
    }

    .checklist-add-form {
        flex-direction: column;
    }

    .checklist-add-btn {
        width: 100%;
    }

    .checklist-items {
        max-height: 200px;
    }

    .card-checklist-wrapper {
        padding: 0.4rem;
    }

    .card-checklist-item .checklist-item-text {
        font-size: 0.8rem;
    }
}
