There literally can be hundreds of reasons why the top of your foot hurts. Could you have banged it and not noticed? Did you bend it wrong or keep it in one position for too long? There is no way of knowing what is causing it without knowing more about the situation. If the pain persists or becomes severe see a doctor.