// (C) 2024-2025 GoodData Corporation
@use "../../../styles/scss/mixins";

.gd-ui-kit-paged-virtual-list {
    $root: &;

    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    height: 100%;
    width: 100%;

    &__list {
        &:focus-visible {
            outline: none;

            #{$root}__item--isFocused {
                @include mixins.focus-ring;

                // Safari-specific: use -5px offset to prevent clipping
                @supports (-webkit-hyphens: none) {
                    outline-offset: -5px;
                }
            }
        }
    }

    &--hasScroll {
        padding-right: 4px;
    }

    &__scroll-container {
        min-height: 0;
        max-height: 100%;
        overflow: auto;
        overscroll-behavior: contain;
        overflow-x: hidden;
        overscroll-behavior: contain;

        ul {
            margin: 0;
        }

        &::-webkit-scrollbar {
            -webkit-appearance: none;
            appearance: none;
            width: 6px;
        }

        &::-webkit-scrollbar-thumb {
            background-color: var(--gd-palette-complementary-7);
            border-radius: 3px;
        }

        &--hover {
            &::-webkit-scrollbar {
                width: 10px;
            }

            &::-webkit-scrollbar-thumb {
                border: 2px solid transparent;
                border-radius: 5px;
                background-clip: padding-box;

                &:hover {
                    border: 0;
                    background-color: var(--gd-palette-complementary-5);
                }
            }
        }
    }

    &__item {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 0;
        left: 0;
    }

    &__gap {
        width: 100%;
    }
}
