.todo-list-wrapper {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    display: flex;
    flex-direction: column;
    touch-action: pan-y; /* Allow only vertical scrolling in this area */
    overscroll-behavior: contain; /* Prevent scroll chaining */
}

.todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.todo-item {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    transition: all 0.2s ease;
    cursor: grab;
    user-select: none;
    overflow: hidden;
    display: block;
}

.todo-item:hover {
    background: hsl(var(--muted) / 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.todo-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: rotate(2deg);
}

.todo-item.completed {
    opacity: 0.6;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: hsl(var(--muted-foreground));
}

.drag-handle {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: grab;
    padding: 0.25rem;
    margin: -0.25rem;
    border-radius: calc(var(--radius) * 0.5);
    transition: background 0.2s;
}

.drag-handle:hover {
    background: hsl(var(--muted) / 0.5);
}

.drag-handle span {
    width: 16px;
    height: 2px;
    background: hsl(var(--muted-foreground));
    border-radius: 1px;
    transition: background 0.2s;
}

.drag-handle:hover span {
    background: hsl(var(--foreground));
}

.todo-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid hsl(var(--border));
    border-radius: calc(var(--radius) * 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.todo-checkbox:hover {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.1);
}

.todo-checkbox.checked {
    background: hsl(var(--primary));
    border-color: hsl(var(--primary));
}

.todo-checkbox svg {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 3;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s;
}

.todo-checkbox.checked svg {
    opacity: 1;
    transform: scale(1);
}

.todo-text {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.5;
    color: hsl(var(--foreground));
    word-break: break-word;
}

.delete-btn {
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    border-radius: calc(var(--radius) * 0.5);
    opacity: 0;
    transition: all 0.2s;
}

.todo-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: hsl(var(--muted-foreground));
    gap: 1rem;
}

.empty-state svg {
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.875rem;
}

.todo-item.drag-over {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.05);
}

@media (max-width: 640px) {
    .todo-list-wrapper {
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
    
    .todo-item {
        padding: 0.75rem;
    }
    
    .delete-btn {
        opacity: 1;
    }
}