Habitat complexity and species diversity in rivers