/**
 * Task List Block Styles - Light Version with Bootstrap Variables
 */

/* Task List Container */
.docsy-task-list {
    margin: 1.5rem 0;
    padding: 0;
}

/* Individual Task Item */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0;
    transition: all 0.2s ease;
}

.task-item:hover {
    background: var(--bs-gray-50);
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 6px;
}

/* Checkbox Wrapper */
.task-checkbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Hide default checkbox */
.task-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom Checkmark */
.task-checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bs-gray-400);
    border-radius: 4px;
    background: var(--bs-white);
    transition: all 0.2s ease;
    position: relative;
}

.task-checkbox-wrapper:hover .task-checkmark {
    border-color: var(--bs-primary);
    background: var(--bs-gray-50);
}

/* Checkmark icon */
.task-checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--bs-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Show checkmark when checked */
.task-checkbox:checked ~ .task-checkmark {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

.task-checkbox:checked ~ .task-checkmark::after {
    display: block;
}

/* Task Text */
.task-text {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--bs-dark);
    transition: all 0.2s ease;
}

.task-item.checked .task-text {
    color: var(--bs-secondary);
    text-decoration: line-through;
    opacity: 0.7;
}

/* Editor Specific Styles */
.docsy-task-list-editor {
    margin: 1.5rem 0;
}

.task-text-input {
    flex: 1;
}

.task-text-input input {
    border: 1px solid transparent !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.9375rem !important;
    line-height: 1.6 !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
}

.task-text-input input:hover {
    border-color: var(--bs-gray-300) !important;
    background: var(--bs-gray-50) !important;
}

.task-text-input input:focus {
    border-color: var(--bs-primary) !important;
    background: var(--bs-white) !important;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1) !important;
}

.task-remove-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item:hover .task-remove-btn {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .task-item {
        gap: 0.5rem;
    }

    .task-checkmark {
        width: 18px;
        height: 18px;
    }

    .task-checkmark::after {
        left: 5px;
        top: 1px;
        width: 4px;
        height: 9px;
    }

    .task-text {
        font-size: 0.875rem;
    }
}

/* Print Styles */
@media print {
    .task-item {
        page-break-inside: avoid;
    }

    .task-item:hover {
        background: none;
    }

    .task-remove-btn {
        display: none;
    }
}

/* Accessibility */
.task-checkbox:focus ~ .task-checkmark {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.task-checkbox:focus:not(:focus-visible) ~ .task-checkmark {
    outline: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .task-item,
    .task-checkmark,
    .task-text {
        transition: none;
    }
}
