The formula
$$W = Fx$$
is valid when $F$ is constant and directed along the line of movement. In your example $F$ may be constant on the distance $d$ but it's not constant on $d'$. So the work done by your foot can be expressed as
$$W = Fd$$
After that in your example there is another force (not originating from your foot) that eventually stops the ball that travels on flat horizontal surface. It's the sum of friction and air drag. Assuming this force is constant (simplification) and denoting its absolute value as $F_2$, we have:
$$ W_2 = - F_2 (d' - d )$$
The minus sign is because now the force acts in opposite direction.
So there is some work done during the distance of $10 m$ after the ball leaves your foot. It's not done by your foot but by environment; and it's negative which means the energy flow is from the ball (into the environment in your case).
If the ball was at rest before you kicked it then the net energy change is zero.
$$0 = W + W_2$$
$$W_2 = - W$$
All the work you did over the ball was undone by environment.
In general case work is defined as an integral:
$$W = \int_{a}^{b} \vec{F}(s) \cdot d\vec{s} $$
This means (among other things) that the fragments of trajectory where the force is zero have no impact on the work done by this force.