Association of socioeconomic and lifestyle-related risk factors with mental health conditions: a cross-sectional study