/* MultiFilter — shared multi-select filter component (see js/multi-filter.js) */

.mf-wrap {
    position: relative;
}

.mf-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    min-height: calc(1.5em + 0.75rem + 2px);
    height: auto;
    cursor: pointer;
}

.mf-placeholder {
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-badge {
    background-color: #1e3775;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
    max-width: 100%;
    /* Long labels wrap instead of overflowing the field */
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
}

.mf-badge-x {
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
    opacity: 0.75;
}

.mf-badge-x:hover {
    opacity: 1;
}

.mf-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    margin-top: 2px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.25rem 0;
    /* Grow with the content so long labels are fully readable (capped so
       the panel never becomes huge; leftovers wrap, see .mf-item span) */
    min-width: 100%;
    width: max-content;
    max-width: min(360px, 90vw);
}

.mf-menu.mf-open {
    display: block;
}

.mf-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    margin: 0;
    cursor: pointer;
    user-select: none;
    font-weight: 400;
    width: 100%;
}

.mf-item:hover {
    background-color: #f8f9fa;
}

.mf-item .form-check-input {
    margin: 0;
    flex-shrink: 0;
}

.mf-item span {
    /* Show option labels in full: wrap instead of truncating */
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
}

/* Tree mode (hierarchical locations) */
.mf-node {
    gap: 0.35rem;
}

.mf-caret {
    cursor: pointer;
    width: 1.1rem;
    flex-shrink: 0;
    text-align: center;
    color: #6c757d;
    user-select: none;
}

.mf-caret:hover {
    color: #1e3775;
}

.mf-caret.mf-leaf {
    cursor: default;
    color: #ced4da;
}

.mf-caret.mf-loading {
    opacity: 0.4;
    pointer-events: none;
}

.mf-node-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
    font-weight: 400;
    flex: 1;
    min-width: 0;
}

/* Faceting: options with zero results given the other filters */
.mf-item.mf-unavailable,
.mf-node.mf-unavailable .mf-node-label {
    color: #adb5bd;
    cursor: default;
}

.mf-item.mf-unavailable .form-check-input,
.mf-node.mf-unavailable .form-check-input {
    opacity: 0.4;
    cursor: default;
}
