Calculate values based on tilt of container, for volume and rate of change of angle of tilt. Found this problem in a text based on exercises on calculus. 
The problem statement is stated below: 

In certain industrial processes it is necessary to control the rate at which a liquid is poured out of a container. For this problem, suppose the container is a rectangular box with no top, with square cross-section -- say 4 meters long, 2 meters wide and 2 meters top. We are going to pour some liquid out of it by leaving one long edge of the container on the floor and raising the other long edge, so that after awhile the side view of the container and the liquid in it looks as follows:
(a) Derive a formula for the liquid in the box (assuming that the liquid is initially full when theta= Pi/2 ($\theta=\frac{\pi}{2}$) as a function of theta ($\theta$). There will be two different formulas, depending on whether the left edge is against the left edge of the box, or against the bottom of the box.
(b) Calculate the derivative of the volume of the box wrt to theta ($\theta$).
(c) How fast should the theta  ($\theta$) change if the liquid is to be poured out of the box at a constant rate of 0.5 cubic meters per second (it is ok to leave the answer in terms of theta)?

My solution attempt is stated below:
(a) $\theta$ would be continuously changing from $\frac{\pi}{2}$ to $0$. The volume initially is $16\,m^3$, with $\theta=\frac{\pi}{2}$. When the $\theta$ changes to $0$, the volume becomes nil.
The dimension of the liquid affected by change in $\theta$. There are two changes induced by change in $\theta$ :
(i) height against the left edge of the box ($h_l$), that changes from $2$ meters to $0$ meters.
The below image states the angle $\theta_b = 45^0$.

(ii) once $h_l=0$, the height of liquid against the base ($h_b=2\sin(90^0-\theta_b)$ meters) starts decreasing from $4\cos(\theta_b)$ meters to $0$ meters. The start value of $\theta_b = 45^0$, i.e. $h_b$ decreases from $2\sqrt{2}$m to $0$m.
The below image states the angle $\theta_b = 45^0$.

Unable to pursue further.



Edit - 
Based on the answer by @Andrei, have submitted diagram as below for the first part of the tilt (i.e., til the bottom edge point B is reached):

Also, as per the answer, my second diagram is wrong as shown below by necessary equality between base length ($L_1$) and height (h):

 A: Let's name several of the points in the figure:


*

*$A$ is the corner of the container above the liquid

*$B$ is the corner on the left

*$C$ is the corner touching the ground

*$D$ is on the right

*$E$ is the point where the liquid touches $AB$
We define some lengths 


*

*$h=AB=CD$

*$L_1=BC=AD$

*$L_2$ the length of the container perpendicular to the figure plane


You will have two cases, where $L_1=4$ and $L_2=2$, or $L_1=2$ and $L_2=4$.
Now let's discuss what happens: you start tilting the container. Then point $E$ moves from $A$ to $B$. Note that $DE$ is always horizontal. That means that $\angle CDE=\theta$ and therefore $\angle DEA=\theta$. The area of $\triangle AED$ is then $\frac 12 AE\cdot AD=\frac 12 AD^2\cot\theta=\frac 12 L_1^2\cot\theta$. Then the volume of liquid that left the container is $\frac 12 L_1^2L_2\cot\theta$, so the volume left in the container is $$V=L_1L_2h-\frac 12 L_1^2L_2\cot\theta$$
This formula is only valid until the water level reaches $B$. Then, in $\triangle BCD$ we have $\angle CBD=\theta_0$. We can write $$\tan\theta_0=\frac{L_1}{h}$$
That means that your second figure is wrong. You get $\theta_0=45^\circ$ only if you have the case $L_1=h=2$.
If you increase the tilt, $E$ will move from $B$ to $C$, and, in a similar fashion as before, you can write $$V=\frac 12 L_2h^2\tan\theta$$
You can see from bot formulas that at $\theta=\theta_0$ you have $V=\frac 12 L_1L_2h$.
Hope this is enough to get you unstuck.
