@use "sass:list";
@use "sass:map";
// Do not `@use "../../styles/scss/button"` here: no member of it is referenced, and the only
// consumer of this file (styles/scss/main.scss) loads button.scss long before it, so the load
// added nothing to the output. It did, however, put button.scss in a second module context, and
// dart-sass (1.80-1.104) then mis-reports button.scss's own `@extend %btn` as unsatisfied for any
// consumer that compiles main.scss from source with a downstream `@extend .gd-button-link` - which
// is exactly what the modeler dev server does (see gdc-ldm-modeler/src/styles/app.scss).
@use "../../styles/scss/mixins";
@use "../../styles/scss/typo-mixins";
@use "../../styles/scss/variables" as variables;

.gd-filter-group-item {
    @include typo-mixins.gd-font-base;
    padding: 10px;
    transition:
        background-color 0.2s ease,
        padding-left 0.2s ease;
    position: relative;
    display: flex;
    border-radius: 0;

    &:not(.error, .gd-is-disabled) {
        cursor: pointer;
    }

    .gd-filter-group-item-chevron {
        padding-right: 4px;
        color: variables.$gd-color-state-blank;
    }

    &:not(.error, .gd-is-disabled):hover,
    &.gd-is-active {
        background-color: variables.$is-focused-background;
    }

    &.gd-is-active:not(.gd-is-disabled):hover {
        background-color: variables.$gd-palette-primary-dimmed;
    }

    &::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 4px;
        height: 100%;
        background-color: variables.$gd-palette-primary-base;
        opacity: 0;
    }

    &.gd-is-active::before {
        opacity: 1;
    }

    &:not(.error, .gd-is-active, .gd-is-disabled):hover::before {
        background-color: var(--gd-palette-complementary-5-t40, rgba(176, 190, 202, 0.6));
        opacity: 1;
    }

    &.error:not(.gd-is-active) {
        background-color: variables.$gd-palette-error-dimmed;

        .gd-filter-group-item-icon {
            color: variables.$gd-palette-error-base;
        }

        &:not(.gd-is-disabled):hover::before {
            background-color: var(--gd-palette-error-base-t85, rgba(229, 77, 66, 0.15));
            opacity: 1;
        }
    }

    &.error.gd-is-active .gd-filter-group-item-icon {
        color: variables.$default-gd-color-state-blank;
    }

    .gd-filter-group-item-icon {
        margin-right: 4px;
    }
}

.gd-filter-group-item-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-grow: 1;
    gap: 5px;
    overflow: hidden;
}

.gd-filter-group-item-title,
.gd-filter-group-item-subtitle {
    max-width: 100%;
    white-space: nowrap;
    font-size: 12px;
    color: variables.$gd-color-label;
    line-height: 16px;
    overflow: hidden;
    gap: 5px;
}

.gd-filter-group-item-title {
    .gd-bubble-trigger,
    .shortened {
        display: inline-flex;
    }

    .shortened {
        max-width: 100%;
    }
}

.gd-filter-group-item-subtitle {
    display: inline-flex;
    overflow: hidden;
    font-weight: bold;
    text-overflow: ellipsis;
    color: variables.$gd-color-text;
}

.gd-filter-group-item-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.gd-filter-group-item-title-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-height: 16px;
    gap: 5px;
    overflow: hidden;
}

.gd-filter-group-item-selected-items {
    overflow: hidden;
    text-overflow: ellipsis;
}

.gd-filter-group-item-title-extension {
    display: flex;
}
