I didn't have an idea.
I did not have any idea.
I am much more familiar with the second one. The first one sounds a bit odd to me, but sounds fine if I say:
I did not have even an idea.
But, the first one is also one of the widely used sentences by natives. What is the difference between the two?