@use '../../mat-selectors.scss' as ms;

/* stylelint-disable no-descending-specificity */
$content-node-selector-thumbnail-width: 35px !default;
$content-node-selector-thumbnail-max-width: 40px !default;

h2.adf-search-results-label {
    flex: 1;
    font-weight: 600;
    font-size: var(--theme-body-1-font-size);
    font-style: normal;
    font-stretch: normal;
    line-height: 1.43;
    letter-spacing: -0.2px;
    color: var(--adf-theme-foreground-text-color-087);
}

#{ms.$mdc-dialog} {
    #{ms.$mat-dialog-surface}:is(div) {
        padding-bottom: 0;
    }
}

.adf-content-node-selector-panel {
    .adf-toolbar .adf-toolbar-container.adf-toolbar-container-row {
        max-height: 48px;
        border-bottom-width: 0;
        font-size: var(--theme-body-1-font-size);
        height: auto;
    }
}

.adf-content-node-selector {
    &-search-panel-container {
        display: flex;
    }

    &-document-list-container {
        width: 100%;
    }

    &-content {
        padding-top: 10px;

        &-input {
            width: 100%;
            margin-bottom: 15px;

            .adf-content-node-selector-content-input-icon {
                color: var(--adf-theme-foreground-icon-color-054);
            }

            .adf-content-node-selector-search-clear-button {
                .adf-content-node-selector-content-input-icon {
                    &:hover {
                        color: var(--adf-theme-foreground-base-color);
                    }
                }
            }
        }

        .adf-site-dropdown-container {
            display: block;

            .adf-sites-dropdown-form-field {
                width: 100%;
                margin-bottom: 15px;
            }
        }
    }

    &-breadcrumb {
        .adf-dropdown-breadcrumb-trigger {
            outline: none;

            .adf-dropdown-breadcrumb-icon {
                color: var(--adf-theme-foreground-base-color-045);

                &:hover {
                    color: var(--adf-theme-foreground-base-color-065);
                }
            }

            &:focus .adf-dropdown-breadcrumb-icon {
                color: var(--theme-primary-color);
            }
        }

        .adf-dropdown-breadcrumb-item-chevron {
            color: var(--adf-theme-foreground-base-color-045);
        }
    }

    &-content-list,
    &-list {
        height: 40vh;
        overflow: auto;
        border: 1px solid var(--adf-theme-foreground-text-color-007);
        border-top: 0;
        position: relative;

        &-empty + adf-infinite-pagination {
            position: absolute;
            bottom: 0;
            width: 100%;
        }

        .adf-highlight {
            color: var(--theme-primary-color);
        }

        .adf-datatable-list {
            border: none;

            .adf-name-location-cell-location {
                display: none;
            }

            .adf-datatable-selected {
                height: 100%;
                width: 100%;
            }

            .adf-datatable-selected > svg {
                fill: var(--theme-primary-color);
            }

            .adf-no-content-container.adf-datatable-cell {
                text-align: center;
                border: none;
            }

            .adf-datatable-cell {
                &--image {
                    min-width: $content-node-selector-thumbnail-width;
                    width: $content-node-selector-thumbnail-width;
                    max-width: $content-node-selector-thumbnail-max-width;
                }

                &:nth-child(2) {
                    flex: 1 0 95px;
                }

                .adf-no-content-container.adf-datatable-cell {
                    text-align: center;
                    border: none;
                }

                &.adf-content-selector-visibility-cell {
                    flex: 0 1 auto;
                    min-width: 1px;

                    .adf-datatable-cell-value {
                        padding: 0;
                    }
                }
            }

            .adf-datatable-body .adf-datatable-row {
                min-height: 40px;

                @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
                    padding-top: 15px;
                }

                &:first-child {
                    .adf-datatable-cell {
                        border-top: none;
                    }
                }

                &:last-child {
                    .adf-datatable-cell {
                        border-bottom: none;
                    }
                }
            }
        }

        &-searchLayout {
            .adf-datatable-list .adf-datatable-body .adf-datatable-row {
                min-height: 65px;

                @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
                    padding-top: 15px;
                }

                .adf-name-location-cell-name {
                    padding: 5px 10px 2px;
                }

                &.adf-content-selector-modified-cell {
                    display: none;
                }

                &.adf-content-selector-modifier-cell {
                    display: none;
                }

                &.adf-content-selector-visibility-cell {
                    display: none;
                }
            }
        }
    }
}
