/* --- Shared Library & SocialFeed styles --- */
.unqbd-controls-row-outer {
    display: flex;
    justify-content: center;
    width: 100%;
    padding-top: 1rem;
}

.unqbd-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    margin-bottom: 1rem;
}

.unqbd-search-bar {
    background: var(--background-light);
    border-radius: 2rem;
    box-shadow: none !important;
    padding: 0.25rem 1.2rem;
    border: 1.5px solid var(--divider-color);
    width: 100%;
    max-width: 420px;
    min-height: 2.7rem;
    display: flex;
    align-items: center;
    outline: none !important;
}

.unqbd-search-icon {
    font-size: 1.25rem;
    margin-right: 0.7rem;
}

    .unqbd-search-bar:focus-within {
        box-shadow: none !important;
        border-color: var(--primary-color);
        outline: none !important;
    }

.unqbd-search-input {
    background: transparent;
    font-size: 1.15rem;
    font-weight: 600;
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
    width: 100%;
    color: var(--background-dark);
    min-height: 2.7rem;
    line-height: 2.7rem;
}

    .unqbd-search-input:focus {
        outline: none !important;
        box-shadow: none !important;
        border: none !important;
    }

.unqbd-dropdown .rz-dropdown {
    font-weight: 700 !important;
    font-size: 1.08rem !important;
    border-radius: 1.5rem !important;
    border: 1.5px solid var(--divider-color) !important;
    background: var(--background-light) !important;
    box-shadow: none !important;
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
    min-width: 160px;
    min-height: 2.7rem;
    height: 2.7rem;
    display: flex;
    align-items: center;
    outline: none !important;
}

    .unqbd-dropdown .rz-dropdown:focus,
    .unqbd-dropdown .rz-dropdown:active {
        outline: none !important;
        border-color: var(--primary-color) !important;
        box-shadow: none !important;
    }

.unqbd-dropdown .rz-dropdown-label {
    font-weight: 700 !important;
    color: var(--primary-color) !important;
}

/* Library page switch label and compact switch  */
.unqbd-switch-label {
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 0.5rem;
    font-size: 1.08rem;
}

.unqbd-compact-switch {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    white-space: nowrap;
}

/* Compact view toggle button styles */
.unqbd-compact-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.unqbd-compact-toggle-btn {
    background: var(--background-light);
    border: 1.5px solid var(--divider-color);
    border-radius: 50%;
    width: 2.7rem;
    height: 2.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--primary-color);
    padding: 0;
    outline: none;
}

.unqbd-compact-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.unqbd-compact-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Dropdown container to wrap multiple dropdowns */
.dropdown-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Ensure dropdowns have appropriate width */
.unqbd-dropdown {
    min-width: 150px;
}

/* Mobile optimizations for Library page filters */
@media (max-width: 768px) {
    .unqbd-controls-row-outer {
        padding-top: 0.3rem;
    }

    .unqbd-controls-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 0.6rem 0.8rem;
        margin-bottom: 0.6rem;
        align-items: center;
    }

    /* Updated mobile layout for dropdown container */
    .dropdown-container {
        grid-column: 1 / -1;
        grid-row: 1;
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    /* Position compact toggle button */
    .unqbd-controls-row > .unqbd-compact-toggle {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
    }

    /* Compact toggle button mobile styles */
    .unqbd-compact-toggle-btn {
        width: 2.2rem;
        height: 2.2rem;
    }

    /* Search bar spans full width in third row */
    .unqbd-controls-row > .unqbd-search-container {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    /* Style the dropdown for mobile */
    .unqbd-dropdown .unqbd-dropdown-component,
    .unqbd-dropdown .rz-dropdown {
        min-width: 110px;
        width: 100% !important;
        font-size: 0.9rem;
        min-height: 2.2rem;
        height: 2.2rem;
        padding-left: 0.7rem;
        padding-right: 0.7rem;
        line-height: 2.2rem;
        display: flex;
        align-items: center;
    }

    /* Handle z-index for dropdowns to prevent overlap */
    .unqbd-dropdown {
        width: 100% !important;
        z-index: 10;
    }

    .dropdown-container .unqbd-dropdown:nth-child(2) {
        z-index: 9;
    }

    .unqbd-dropdown .rz-dropdown-label {
        line-height: 1.2;
        display: flex;
        align-items: center;
    }

    .unqbd-compact-switch {
        min-width: 0;
        padding: 0;
        justify-content: flex-start;
    }

    .unqbd-switch-label {
        font-size: 0.9rem;
        margin-right: 0.25rem;
    }

    /* Compact the search bar on mobile */
    .unqbd-search-bar {
        min-height: 2rem;
        padding: 0.15rem 0.8rem;
        border-radius: 1.2rem;
    }

    .unqbd-search-input {
        font-size: 0.95rem;
        min-height: 2rem;
        line-height: 2rem;
    }

    /* Reduce tab toggle spacing on mobile */
    .unqbd-tab-toggle {
        gap: 1.2rem;
        margin-bottom: 0.4rem;
    }

    .unqbd-tab-toggle-btn {
        font-size: 1.05rem;
        padding: 0 0 0.3rem 0;
    }

    /* Reduce search icon size on mobile */
    .unqbd-search-icon {
        font-size: 1rem;
        margin-right: 0.5rem;
    }
}

/* Desktop layout */
@media (min-width: 769px) {
    .unqbd-controls-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 2.2rem;
        margin-bottom: 1rem;
    }

    .dropdown-container {
        display: flex;
        flex-direction: row;
        gap: 1rem;
    }

    .unqbd-dropdown .unqbd-dropdown-component,
    .unqbd-dropdown .rz-dropdown {
        width: 180px;
    }

    .unqbd-search-container {
        flex: 2;
        display: flex;
        justify-content: center;
        min-width: 320px;
        max-width: 480px;
    }
}

/* Add search container styles */
.unqbd-search-container {
    display: flex;
    justify-content: center;
}

@media (max-width: 480px) {
    .unqbd-controls-row {
        gap: 0.5rem 0.6rem;
        margin-bottom: 0.5rem;
    }

    .unqbd-controls-row-outer {
        padding-top: 0.2rem;
    }

    .unqbd-tab-toggle {
        gap: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .unqbd-tab-toggle-btn {
        font-size: 1rem;
    }

    .unqbd-dropdown .unqbd-dropdown-component,
    .unqbd-dropdown .rz-dropdown {
        min-width: 90px;
        width: 100% !important;
        font-size: 0.85rem;
        min-height: 2rem;
        height: 2rem;
        line-height: 2rem;
        display: flex;
        align-items: center;
    }

    .unqbd-dropdown .rz-dropdown-label {
        line-height: 1.2;
        display: flex;
        align-items: center;
    }

    .unqbd-switch-label {
        font-size: 0.85rem;
    }

    .unqbd-search-input {
        font-size: 0.9rem;
    }

    /* Compact toggle button small mobile styles */
    .unqbd-compact-toggle-btn {
        width: 2rem;
        height: 2rem;
    }
}
/* --- End Shared Library & SocialFeed styles --- */