Next time just make sre that you are at the airport at least two hours before the flight.

since you  have bought the ticket online - make sure you do a web check in and print your boarding pass also and take it along with you.

 

It is clearly mentioned on the ticket as to what the rules are regarding late arrival.