@use "../../wwwroot/scss/variables" as *;

.checkbox-list {
    --bb-checkbox-item-width: #{$bb-checkbox-item-width};
    min-height: var(--bb-height);
    height: auto;
    display: flex;
    flex-flow: row wrap;
    padding: 0 0.75rem;
    overflow: hidden;
    vertical-align: top;

    &.is-vertical {
        flex-direction: column;
    }

    &.form-control.no-border:not(.is-valid):not(.is-invalid) {
        border-color: transparent;
    }

    &.form-control:not(.is-invalid):focus {
        box-shadow: none;
    }

    &.is-button {
        padding: 0;
    }

    &:not(.is-vertical) .checkbox-item {
        display: inline-flex;
        width: var(--bb-checkbox-item-width);

        .form-check {
            width: var(--bb-checkbox-item-width);
        }
    }

    .form-check-sm .form-check-input {
        margin: 3px 0 2px 0;
    }

    .btn-group {
        display: inline-flex;
        flex: 0 !important;
        flex-wrap: nowrap;
        white-space: nowrap;

        > .btn {
            white-space: nowrap;

            &:not(:first-child) {
                border-left-color: transparent !important;
            }

            &:not(:last-child) {
                border-right-color: transparent !important;
            }
        }

        .active {
            color: #fff;
        }

        &.disabled {
            > span {
                opacity: var(--bs-btn-disabled-opacity);

                &:not(.active) {
                    background-color: var(--bs-secondary-bg);
                }
            }
        }
    }
}

.input-group-checkbox-list {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    flex: 1;

    &:hover {
        border: 1px solid var(--bb-border-hover-color);
    }

    .form-control {
        border-color: transparent;

        &:hover {
            border-color: transparent !important;
        }
    }
}

.input-group > .checkbox-list {
    display: flex;
    --bb-checkbox-item-width: 110px;

    .form-control {
        border-color: transparent;
        padding: 0;

        &:hover {
            border-color: transparent !important;
        }
    }
}
