Women and visible minorities make election gains