Surface-attached, cross-linked hydrogel films based on thermoresponsive N-isopropylacrylamide with a dry thickness > 1 mu m were studied with surface plasmon resonance/optical waveguide mode spectroscopy (SPR/OWS) to monitor temperature-dependent and salt-induced changes of their swelling state. In combination with the reversed Wentzel-Kramers-Brillouin and Bruggeman effective medium approximation and by modeling the hydrogel film as a composite of sublayers with individual complex refractive indices, refractive index/volume fraction gradient profiles perpendicular to the surface are accessible simultaneously with information about local inhomogeneities. Specifically, the imaginary refractive index kappa of each sublayer can be interpreted as a measure for static and dynamic inhomogeneities, which were found to be highest at the volume transition collapse temperature in the layer center. These results indicate that the hydrogel collapse originates rather from the film center than from its boundaries. Upon addition of NaCl to a swollen hydrogel below its transition temperature, comparable optical loss characteristics as for the thermal gel collapse arc observed with respect to inhomogeneities. Interestingly, in contrast to the thermally induced layer shrinkage and collapse, swelling increases at intermediate salt concentrations.