Complex modes and near-zero permittivity in 3D arrays of plasmonic nanoshells: loss compensation using gain