.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.catalog-header .md-button {
    display: inline-flex;
    min-width: max-content;
    align-items: center;
}

/* Ensure icon and text stay together */
.catalog-header .md-button .twemoji {
    margin-right: 0.5rem;
}

.filter-menu {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.filter-menu.show {
    display: block;
}

.filter-item {
    padding: 8px 12px;
    cursor: pointer;
}

.filter-item:hover {
    background: #f5f5f5;
}

/* Filter Styles */
.column-filter {
    display: none;
    position: relative;
    margin-top: 5px;
}

.filters-enabled .column-filter {
    display: block;
}

.filter-dropdown {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.dropdown-select {
    border: 1px solid #e0e0e0;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f0f0f0;
    /* Default light gray */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.dropdown-select.has-filters {
    background-color: var(--md-accent-fg-color);
    color: white;
}

.dropdown-select.has-filters svg {
    color: white;
}

.dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
    min-width: 200px;
    width: max-content;
    max-width: 300px;
}

.dropdown-list.show {
    display: block;
}

.dropdown-item {
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-dropdown {
    position: relative;
}

.dropdown-list.show {
    position: absolute;
    right: 0;
    z-index: 1000;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item input[type="checkbox"] {
    margin: 0;
}

.dropdown-item,
.dropdown-item span {
    font-weight: normal;
}

.dropdown-divider {
    height: 1px;
    background-color: #ddd;
    margin: 4px 0;
}

.select-all {
    font-weight: 500;
    border-bottom: 1px solid #ddd;
}

/* Toggle Button Styles */
.toggle-filters {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.toggle-filters.active {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

/* Search and Filter Container */
.search-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    /* Add spacing above */
    margin-bottom: 1rem;
    gap: 1rem;
    max-width: 100%;
}

.search-wrapper {
    display: flex;
    align-items: center;
    flex: 0 1 800px;
    border-radius: 4px;
    height: 35px;
    /* Match switch height */
    min-width: 200px;
}

#searchInput {
    flex-grow: 1;
    border: 1px solid #0a9396;
    outline: none;
    background: transparent;
    margin-left: 0.5rem;
    width: 100%;
    height: 35px;
    /* Match switch height */
    padding: 0 0.5rem;
}

#searchInput:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

#toggleFilters {
    position: relative;
    width: 70px;
    height: 35px;
    background-color: #e0e0e0;
    border-radius: 20px;
    cursor: grab;
    user-select: none;
    touch-action: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    border: none;
    overflow: hidden;
}

#toggleFilters:active {
    cursor: grabbing;
}

#toggleFilters::before {
    content: '';
    position: absolute;
    width: 29px;
    height: 29px;
    background-color: white;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    left: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

#toggleFilters.md-button--active {
    background-color: var(--md-accent-fg-color);
}

#toggleFilters.md-button--active::before {
    transform: translateX(35px);
}

.filter-icon,
.check-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: opacity 0.3s ease;
}

.filter-icon {
    left: 8px;
    opacity: 1;
    color: #666;
}

.check-icon {
    right: 8px;
    opacity: 0;
    color: white;
}

#toggleFilters.md-button--active .filter-icon {
    opacity: 0;
}

#toggleFilters.md-button--active .check-icon {
    opacity: 1;
}