@import '~styles/config';

.editMenu {
  position: relative;

  width: 40px;
  height: 40px;

  &__icon {
    @include reset-button;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    cursor: pointer;
  }

  &__SVG {
    @include btn-fill-colors;

    circle {
      // stylelint-disable-line
      transition: fill 300ms ease-in-out;
    }
  }

  &__icon:hover &__SVG circle,
  &__icon:focus &__SVG circle {
    // stylelint-disable-line
    fill: $color-dark;
  }

  &__icon:hover &__SVG.fill-white circle,
  &__icon:focus &__SVG.fill-white circle {
    // stylelint-disable-line
    fill: $color-grey400;
  }

  &__menu {
    display: none;

    position: absolute;
    top: 50px;
    right: 0;

    z-index: 1000000;

    width: auto;

    @media not all and (min-width: $min-tablet) {
      width: 50vw;
      min-width: 170px;
    }

    background-color: #fff;

    animation: fadein $transition-enter ease-in-out;

    // small arrow at top
    &::before {
      content: '';
      position: absolute;
      right: 15px;
      top: -5px;

      width: 0;
      height: 0;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-bottom: 5px solid #fff;
      box-shadow: 0 20px 70px 0 rgba(32, 32, 32, 0.15);
    }

    &.isEditMenuOpen {
      display: block;
    }
  }

  &__shadow {
    width: 100%;
    height: 100%;
    box-shadow: 0 20px 70px 0 rgba(32, 32, 32, 0.15);
  }

  &__top {
    display: flex;
    flex-direction: column;
    padding: 15px 10px 10px;
  }

  &__bottom {
    display: flex;
    flex-direction: column;
    padding: 10px;

    border-top: 1px solid $color-grey100;
  }

  &__button {
    @include reset-button;
    @include responsive-font(12, 15);

    padding: 15px 30px;
    cursor: pointer;

    user-select: none;

    font-weight: 500;
    text-align: left;

    &:hover,
    &:focus {
      @include colorify('color');
    }
  }

  &__link {
    @include reset-anchor;
    @include reset-button;
    @include responsive-font(16, 18);

    padding: 15px 30px;
    cursor: pointer;

    user-select: none;

    font-weight: 500;
    color: $font-color;
    text-align: left;

    &:hover,
    &:focus {
      @include colorify('color');
    }
  }
}

@keyframes fadein {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}
