@import '../../shared-styles/index';

:host {
    display: block;
    width: 100%;
    height: 100%;
}

.panel {
    width: 100%;
    border-radius: 4px;
    box-shadow: v(shadow-small);
    border-radius: nx-border-radius(s);
    background: v(ui-01);

    .filter {
        --formfield-label-height: 6px;
        --formfield-bottom-padding: 4px;
    }

    &.is-outline {
        .filter {
            --formfield-label-height: 8px;
            --formfield-bottom-padding: 3px;
        }

        .items {
            padding-bottom: 8px;
            max-height: 200px;
        }
    }

    &:focus {
        outline: none;
    }
}

.value {
    display: grid;
    align-items: center;
    width: 100%;
    height: 100%;
    max-width: 100%;
    grid-template-columns: auto min-content min-content;
    cursor: pointer;
    &:focus {
        outline: none;
    }

    &::-moz-focus-inner {
        border: 0;
    }
}

:host-context(.nx-formfield.is-disabled) {
    .value {
        cursor: not-allowed;
    }
}

:host(.is-readonly) {
    .indicator {
        color: v(formfield-disabled-text-color);
        @media screen and (forced-colors: active) {
            color: GrayText !important;
        }
    }
    .value {
        cursor: not-allowed;
    }
}

.value-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-right: 8px;
}

.panel-header {
    @include type-style(formfield-label);
    color: v(dropdown-panel-header-text-color);
    background-color: v(dropdown-panel-header-background-color);
    padding: 8px 32px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.label span:nth-child(2) {
    font-weight: 600;
    margin-left: auto;
    padding-right: 12px;
    flex: 0 0 auto;
}

.indicator {
    transform: rotateZ(0deg);

    :host(.is-open) & {
        transform: rotateZ(180deg);
    }
}

.items {
    list-style: none;
    max-height: 272px;
    overflow-y: auto;
    position: relative;
    padding: 12px 32px;
}

.filter-wrapper {
    padding: 8px 32px 0 32px;
}

.filter {
    width: 100%;
}

.border {
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid lightgrey;
}

.toggle {
    width: 100%;
    display: block;
}

.actions {
    display: flex;
    justify-content: space-between;
    white-space: nowrap;
    padding: 16px 32px;
}
.select-all {
    border-bottom: 1px solid v(dropdown-item-divider);
}

.hidden {
    display: none;
}
