Sidebar background color and displaying both uploading button and select bottons

I would like to change the background color of my sidebar and also ensure that my upload button and sidebar buttons display at once and not after the file has been uploaded

Steps to reproduce

Code snippet:

def main():
        .sidebar .sidebar-content {
        background-color: blue; /* Set your desired background color */
    # creating an empty list for the sidebar
    # Upload data from user's local machine
    uploaded_file = st.sidebar.file_uploader("", type=["csv", "xlsx"], accept_multiple_files=True, label_visibility="visible")

    if uploaded_file is not None:
        for files in uploaded_file:
            # Process the uploaded file here
                d = pd.read_csv(files)
            # Continue processing the DataFrame
            except UnicodeDecodeError:
                d = pd.read_csv(files, encoding='ISO-8859-1')  # or encoding='cp1252'  
            st.write("File uploaded successfully!")
            columns = data.columns.tolist()
            y_options = data.columns.tolist()
            z_options = data.columns.tolist()
            st.sidebar.header("Plot Settings")
            x_col = st.sidebar.selectbox("Select X Column",[''] + columns)
            y_col = st.sidebar.selectbox("Select Y Column",[''] + columns)
            z_col=st.sidebar.selectbox("Select z Column",[''] + columns)
            plot_title = st.text_input("Enter Plot Title")
            if x_col and y_col and z_col:
                st.sidebar.success('all required columns selected')
                st.sidebar.warning('please select all the required columns before proceeding')
            #default filtering option

The code above is displaying the sidebar select buttons after file has been uploaded. If I try to put the select button above the upload files, it is complaining about assignment before refernce

For changing background color

        [data-testid=stSidebar] {
            background-color: #ff000050;
    """, unsafe_allow_html=True)


Do you have an idea on the second question

I want to ensure that both the upload button and selectbox botton is availabe by default and not just after the file has been uploaded

Please is there anyone who can help with this?