// (C) 2026 GoodData Corporation

// Rendered inside UiPopover.__content (which adds 10px padding all around).
// Pull the padding back so rows span the popover edge-to-edge.

.gd-ui-kit-permission-menu {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    // Bound the popover so the labels drill-in stays on screen when an attribute
    // has many labels — the checklist's own items area scrolls (overflow-y:auto)
    // only once an ancestor caps the height. Matches the 300px the removed
    // UiMoreOptionsMenu supplied via UiMenu.
    max-height: 300px;
    margin: calc(-1 * var(--gd-spacing-10px));

    &__items {
        display: flex;
        flex-direction: column;
        padding: var(--gd-spacing-5px) 0;
    }

    &__divider {
        height: 1px;
        margin: var(--gd-spacing-5px) 0;
        background: var(--gd-palette-complementary-3);
    }

    &__item-row {
        display: flex;
        align-items: stretch;

        // Hover/focus highlight on the row wrapper, so it also covers the tooltip
        // anchor wrapper a disabled row is nested in.
        &:hover,
        &:focus-within {
            background: var(--gd-palette-complementary-2);
        }
    }

    &__item {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: var(--gd-spacing-5px);
        padding: var(--gd-spacing-5px) var(--gd-spacing-10px);
        border: 0;
        background: transparent;
        cursor: pointer;
        text-align: left;
        font: inherit;
        color: var(--gd-palette-complementary-8);

        &:focus-visible {
            outline: none;
        }

        // Selected radio item — same convention as the legacy share dialog,
        // which renders the active permission level in primary-base.
        &[aria-checked="true"] {
            color: var(--gd-palette-primary-base);
            font-weight: 700;
        }

        &--disabled {
            color: var(--gd-palette-complementary-5);
            cursor: default;
        }
    }

    // Explanations are sentences; keep them from stretching into one long line.
    &__item-tooltip {
        max-width: 220px;
    }

    &__item-label {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 12px;
        line-height: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
