/* ============================================
   Library Filter Bar Styles
   ============================================ */

.tfp-filter-bar {
    margin-bottom: 8px;
    padding: 8px 16px;
    /* Compact padding */
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #ddd;
}

.filter-container {
    display: flex;
    flex-direction: row;
    /* Force single row */
    align-items: center;
    gap: 12px;
}

/* Items */
.filter-item {
    flex: 1;
    /* Distribute space evenly initially */
    min-width: 0;
    /* Prevent overflow */
}

/* Search Box slightly larger priority */
.filter-item.search-box {
    flex: 2;
}

/* Reset Button compact */
.filter-item.reset-col {
    flex: 0 0 auto;
}

/* Checkbox compact */
.filter-item.checkbox-filter {
    flex: 0 0 auto;
}

/* Filters Grid wrapper removal (visual only, we ignore grid layout in favor of parent flex) */
.filters-grid {
    display: contents;
    /* Flattens children into the parent flex container */
}

/* MD3 Component Styling - Compact */
md-outlined-select,
md-outlined-text-field {
    width: 100%;
    --md-sys-color-primary: #3b74e0;
    --md-outlined-text-field-container-shape: 12px;
    --md-outlined-select-container-shape: 12px;

    /* Compact heights */
    --md-outlined-field-top-space: 8px;
    --md-outlined-field-bottom-space: 8px;
}

/* Responsive: Wrap on small screens */
@media (max-width: 1024px) {
    .filter-container {
        flex-wrap: wrap;
    }

    .filter-item {
        flex: 1 1 200px;
        /* Allow wrapping with min-width */
    }

    .filter-item.search-box {
        flex: 1 1 100%;
        /* Search full width on wrap */
        order: -1;
    }
}

/* Mobile: Show ONLY Search */
@media (max-width: 768px) {
    .filter-item {
        display: none;
    }

    .filter-item.search-box {
        display: block;
        flex: 1 1 100%;
        width: 100%;
        margin-bottom: 0;
    }

    .tfp-filter-bar {
        padding: 8px;
        /* Even more compact */
    }
}