/* Basic styling for the BuddyPress Group Search Shortcode */

.bp-group-search-shortcode-wrapper {
    margin: 15px 0;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    max-width: 400px;
}

.bp-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    /* Allow elements to wrap onto a new line if the container is too narrow */
    flex-wrap: wrap;
}

.bp-search-form input[type="text"] {
    flex-grow: 1;
    /* Allow the text input to take up most of the space */
    flex-basis: 70%; 
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.bp-search-form input[type="text"]:focus {
    border-color: #0073aa; /* WordPress primary color */
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.bp-search-form input[type="submit"] {
    padding: 10px 15px;
    background-color: #2c9aff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Prevent the submit button from shrinking */
    flex-shrink: 0;
}

.bp-search-form input[type="submit"]:hover {
    background-color: #1a78cc;
}

.bp-search-form input[type="submit"]:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* Responsive adjustment: force stacking and full width for very narrow layouts (e.g., small sidebars or mobile view) */
@media (max-width: 250px) {
    .bp-search-form input[type="text"],
    .bp-search-form input[type="submit"] {
        width: 100%;
        flex-basis: 100%;
        margin-bottom: 8px; 
    }
    .bp-search-form {
        /* Remove the gap when stacking to prevent extra space */
        gap: 0;
        /* Center the full-width form on the narrow screen */
        justify-content: center;
    }
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
