One of the common mistakes of people when they approach to these tasks are looking at things as "straightforward", But this is not the case on many scenarios (like this one).
The right way to figure out the time complexity (also in memory complexity) is trying to "follow" the steps of calculation the program will execute and how much time each step will take.
I would recommend writing down what will happen at the first 5+- iterations and try to see what is the pattern.
So, in this case, the first loop is gonna start from N until 0 while the index is reduced by half each iteration. You were right that it implies for O(log(N)), but lets write the index down for some of the first iterations:
i=N
i=N/2
i=N/4
i=N/8
i=N/16
...
Now, the real thing happens in the second for which inside the first loop.
First, you can see that the second index j has a dependency with i which should immediately raise a red flag and we should pay special attention to it.
The second loop goes from 0 to i of the current iteration with increment of one. At first, you would probably say it is O(n) because the change is an increment of one and it goes from 0 to a specific known integer. But since that integer is dynamically change, you can't really say that, and you must know what i is gonna be.
So lets write the first iterations of the inner loop for each of the iterations above:
i=N -> | j=0 | j=1 | j=2 | ... | j=N |
i=N/2 -> | j=0 | j=1 | j=2 | ... | j=N/2 |
i=N/4 -> | j=0 | j=1 | j=2 | ... | j=N/4 |
i=N/8 -> | j=0 | j=1 | j=2 | ... | j=N/8 |
i=N/16 -> | j=0 | j=1 | j=2 | ... | j=N/16 |
...
Now, each "box" (| |) I wrote above is a step the program executes. As I said before, we need to know also how much time each step is gonna take. In this case, each step (each iteration) includes one operation of variable (count) increment, which we consider as O(1) (a constant).
The last thing we should do is to sum up all the steps we mentioned above with their costs:
First row will run N times (0,1,2,..,N) - each time the step will cost O(1). -> So it's going to be N*1 = N
Second row will run N/2 times (0,1,2,..,N/2) - each time the step will cost O(1). -> So it's going to be (N/2)*1 = N/2
Third row will run N/4 times (0,1,2,..,N/4) - each time the step will cost O(1). -> So it's going to be (N/4)*1 = N/4
And so on..
When we sum it up, the program cost will be: N+(N/2)+(N/4)+(N/8)+...+~(N/N) = N * ( 1 + (1/2) + (1/4) + (1/8) +... )
( 1 + (1/2) + (1/4) + (1/8) +... ) is a simple known math series. (You can get help from some websites or little google search to learn the results of those or more complicated series).
This one Equals to 2-(2/N) at most.
So the final cost will be: N * ( 2 - (2/N) ) = 2N - 2 which is O(N) overall.
This answer is pretty long and well detailed for this question but I was trying to show a "way of thinking" more than just solving the problem. I hope it helped you (and others) to think different on questions like these, Trying to take each loop and each step and check carefully how many steps are going to happen here and more importantly (and mostly forgotten) what is the cost of each step.