@import '../../../utils'

.MenuEditor
  position: relative
  width: 100%
  height: 100%
  overflow-y: auto
  scrollbar-color: var(--scrollbar-color) #0000
  background-color: var(--setup-bg)

.MenuEditor section
  position: relative
  display: grid
  width: 100%
  max-width: 400px
  padding: 2px 0 32px
  margin: 0 auto

.MenuEditor section > h2
  position: relative
  width: 100%
  font-size: rem(28)
  font-weight: 400
  color: var(--toolbar-fg)
  text-align: center
  margin: 28px 0 24px

.MenuEditor .menu-group
  position: relative
  width: 100%
  overflow: hidden
  padding: 0
  &.-dis
    padding: 12px 0 0
  
.MenuEditor .group-title
  position: relative
  font-size: rem(16)
  color: var(--toolbar-fg)

.MenuEditor .opt
  position: relative
  display: flex
  align-items: center
  padding: 0
  border-radius: 3px
  &:before
    content: ''
    position: absolute
    top: 1px
    left: 1px
    width: calc(100% - 2px)
    height: calc(100% - 2px)
    background-color: var(--toolbar-fg)
    border-radius: 3px
    opacity: 0
  &:hover
    &:before
      opacity: .06
    .opt-title
      opacity: 1
    .opt-btn
      opacity: .8

  &[data-separator="true"]:after
    content: ''
    position: relative
    width: 100%
    height: 1px
    margin: 0 0 0 8px
    background-color: var(--toolbar-fg)
    opacity: .1
    order: -1

  &[data-selected="true"]
    box-shadow: inset 0 0 0 1px var(--toolbar-fg)
    background-color: #00000016

  .opt-title
    position: relative
    font-size: rem(16)
    color: var(--toolbar-fg)
    white-space: nowrap
    overflow: hidden
    text-overflow: ellipsis
    padding: 2px 5px 2px 0
    margin: 0 auto 0 0
    opacity: .7
    cursor: default

  .opt-btn
    position: relative
    width: 22px
    height: 22px
    fill: var(--toolbar-fg)
    flex-shrink: 0
    flex-grow: 0
    cursor: pointer
    opacity: .2
    &:before
      content: ''
      position: absolute
      top: 1px
      left: 1px
      width: calc(100% - 2px)
      height: calc(100% - 2px)
      background-color: var(--toolbar-fg)
      border-radius: 3px
      opacity: 0
    &.-up svg
      transform: rotateZ(180deg)
    &.-in svg
      transform: rotateZ(-90deg)
    &.-rm svg
      top: calc(50% - 9px)
      left: calc(50% - 9px)
      width: 18px
      height: 18px
    &:hover
      opacity: 1
      &:hover:before
        opacity: .1
    &:active
      opacity: .7
      &:hover:before
        opacity: .06
    svg
      position: absolute
      top: calc(50% - 8px)
      left: calc(50% - 8px)
      width: 16px
      height: 16px
.MenuEditor .menu-group[data-type="sub"] .opt
  margin: 0 0 0 32px
  padding: 0 0 0 8px
  &:after
    margin: 0
.MenuEditor .menu-group.-dis .opt
  padding: 0 0 0 22px
  opacity: .32
  cursor: pointer
.MenuEditor .menu-group.-dis .opt .opt-title
  cursor: pointer
.MenuEditor .opt[data-separator="true"] .opt-btn.-in
  display: none

.MenuEditor .ctrls
  position: relative
  display: flex
  grid-gap: 8px 8px
  justify-content: center
  flex-wrap: wrap
  margin: 16px 16px 0

.MenuEditor .btn
  width: auto
  padding: 5px 16px
