$padding: 6px;

.menu {
    color: var(--g1700);
    backdrop-filter: blur(10px);
    border-radius: 6px;

    list-style: none;

    font-size: 0.8em;
    user-select: none;
    cursor: default;

    padding: $padding 0;
    min-width: 150px;

    // light theme
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--a200);

    @supports not (backdrop-filter: blur(10px)) {
        background: var(--g100);
    }

    // dark theme
    :global(.dark) & {
        background: rgba(0, 0, 0, 0.5);
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
        border: 1px solid var(--a100);
    }
}

.shortcut {
    color: var(--g600);
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: $padding 16px;
    text-overflow: ellipsis;
    white-space: nowrap;

    &.disabled {
        color: var(--g600);
    }
}

a.item {
    font-weight: 450;
    height: 28px;

    &:not(.disabled) {
        cursor: pointer;

        position: relative;

        &::before {
            content: "";

            position: absolute;
            inset: 0 $padding 0 $padding;

            border-radius: 3px;

            z-index: -1;
        }

        &:hover,
        &:focus,
        &[aria-selected="true"] {
            color: var(--g1900);

            &::before {
                background: var(--a100);
            }
        }

        &:active {
            color: var(--g2000);

            &::before {
                background: var(--a50);
            }
        }

        &:hover,
        &:focus,
        &:active {
            .shortcut {
                color: inherit;
            }
        }
    }
}

.itemChildren {
    display: flex;
    align-items: center;
    gap: 6px;
}

.right {
    display: flex;
    align-items: center;
}

.menu > hr {
    border: 0;
    border-top: 1px solid inherit;
    margin: $padding auto;
    width: calc(100% - $padding * 2);
}
