/* Ensure styles are scoped to the Trading page */
#trading-info-form .filter-container {
    display: flex;
    justify-content: space-between; /* Spread elements evenly */
    align-items: center;
    flex-wrap: nowrap; /* Prevent wrapping to a new line */
    gap: 15px; /* Space between elements */
    margin-bottom: 20px;
    width: 100%;
    max-width: 1200px; /* Optional: limit max width */
    margin-left: auto;
    margin-right: auto; /* Center the container */
    overflow-x: auto; /* Enable horizontal scrolling if needed */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

/* Labels */
#trading-info-form .filter-container label {
    font-size: 1em;
    margin: 0;
    white-space: nowrap; /* Prevent text wrapping */
}

/* Increase width of "Trading Code:" label */
#trading-info-form .filter-container label[for="trading-code-trading"] {
    width: 150px; /* Adjust width to ensure the text fits in one line */
}

/* Inputs and Buttons */
#trading-info-form .filter-container select,
#trading-info-form .filter-container input,
#trading-info-form .filter-container button {
    flex-grow: 1; /* Allow inputs to expand to fill space */
    padding: 8px 12px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 120px; /* Prevent inputs from shrinking too small */
}

/* Buttons */
#trading-info-form .filter-container button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    width: 120px; /* Fixed width for buttons */
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

#trading-info-form .filter-container button:hover {
    background-color: #0056b3;
}

/* Processing Message */
#trading-info-form .processing-message {
    text-align: center;
    color: red;
    font-size: 1.1em;
    margin-top: 10px;
    display: none;
}

/* Dynamic Labels */
#trading-info-form .label-container {
    display: flex;
    justify-content: space-between; /* Place one label on each side */
    align-items: center;
    margin-top: 10px;
    width: 100%;
}

#trading-info-form .left-align-label,
#trading-info-form .right-align-label {
    font-size: 1.1em;
    color: #333;
    font-weight: bold;
}

/* Add scrollable behavior for small screens */
@media (max-width: 768px) {
    #trading-info-form .filter-container {
        overflow-x: auto; /* Enable horizontal scrolling */
        gap: 10px; /* Adjust gap for smaller screens */
    }

    /* Ensure buttons and inputs do not overlap */
    #trading-info-form .filter-container select,
    #trading-info-form .filter-container input,
    #trading-info-form .filter-container button {
        flex-grow: 0; /* Prevent excessive stretching */
        flex-shrink: 0; /* Prevent shrinking too small */
        min-width: 100px; /* Minimum width for usability */
    }

    /* Labels */
    #trading-info-form .filter-container label {
        font-size: 0.9em; /* Slightly smaller labels for mobile */
    }
}

/* Ensure entire container scrolls if content overflows */
#trading-info-form {
    overflow-x: auto; /* Allow horizontal scrolling of the entire form */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for touch devices */
    padding: 0 10px; /* Add some padding for better spacing on mobile */
}
