@import "../../styles/modules/importAll";

.ContextMenu {
  position: absolute;
  background-color: $white;
  box-shadow:0 0 6px rgba($black,0.5) ;
  z-index: 999;
  line-height: 1.4rem;
  /* Default positioning... */
  width: 10rem;
  right: 0;

  ul,
  ol {
      list-style: none;
  }
  
  &.hasArrow {
    margin-top: 10px;
  }
  .arrow {
    content: '';
    display: block;
    width: 0px;
    height: 0px;
    position: absolute;
  }
  .arrow.arrow-topLeft {
    top: -10px;
    left: 0px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid $black;
  }
  .arrow.arrow-topRight {
    top: -10px;
    right: 0px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid $black;
  }
  .arrow.arrow-bottomLeft {
    bottom: 10px;
    left: 0px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid $black;
  }
  .arrow.arrow-bottomRight {
    bottom: -10px;
    right: 0px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid $black;
  }
  .contextMenuItem {
    background-color: $white;
    padding: 0.75rem 1rem;
    width: 100%;
    position: relative;

    .caret {
      position: absolute;
      right: 9px;
      top: 13px;
      display: none;
    }

    &:hover {
      background-color: rgba($textSecondary, 0.2);
    }
    &.selected {
      &:after {
        content: '✓';
        float: right;
        margin-right: 0.5rem;
      }
    }
    &.clickable {
      &:hover {
        opacity: 1;
      }
    }
    &-disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }
    &-with-submenu {
      > .caret {
        display: block;
      }
    }
  }
  .subMenu {
    background-color: $white;
    position: absolute;
    width: 12rem;
    right: -12rem;
    display: inline-block;
    margin-right: 0;
    /* Offset padding of this + padding of parent + border*/
    margin-top: calc(-1rem + 3px);
  }
  &.leftSubMenu .subMenu {
    right: 0;
    left: -12rem;
  }
  .newCollection {
    border-top: 1px solid;

    &:first-of-type {
      border-top: 0;
    }
  }
}
