Updated to use flex and inline-flex CSS3 attributes where needed