Molecular interaction of organic dyes in bulk and confined media.