Let c be an edge-coloring of the complete n-vertex graph Kn. The problem of finding properly colored and rainbow Hamilton cycles in c was initiated in 1976 by Bollobás and Erdős and has been extensively studied since then. Recently it was extended to the hypergraph setting by Dudek et al. (2012). We generalize these results, giving sufficient local (resp. global) restrictions on the colorings which guarantee a properly colored (resp. rainbow) copy of a given hypergraph G. We also study multipartite analogues of these questions. We give (up to a constant factor) optimal sufficient conditions for a coloring c of the complete balanced m-partite graph to contain a properly colored or rainbow copy of a given graph G with maximum degree Δ. Our bounds exhibit a surprising transition in the rate of growth, showing that the problem is fundamentally different in the regimes Δ≫m and Δ≪m. Our main tool is the framework of Lu and Székely for the space of random bijections, which we extend to product spaces.