// Made by Luting ^-^
// 下拉菜单动画
@keyframes overlay-appear {
  0% {
    opacity: 0;
    transform: translateY(-5%);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

// clone 下拉菜单
.tippy-box {
  margin-top: -6px;
  background: var(--color-box-header);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0px 0px 0px 0.5px #30363d, 0px 6px 12px -3px rgba(1, 4, 9, 0.4), 0px 6px 18px 0px rgba(1, 4, 9, 0.4);
  animation: 200ms cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running overlay-appear;

  .clone-panel-field {
    margin-top: 16px;
  }

  .flex-text-block.clone-panel-field {
    color: #fff;
    font-weight: bold;
    margin-left: 16px;
  }

  .clone-panel-tab {
    margin-left: 16px;

    button {
      padding: 15px 12px;
    }

    .active {
      border-color: #f78166;
    }
  }

  .flex-items-block {
    margin: 0;

    .item {
      display: block;
      padding: 11px 16px;
      text-align: left;
      text-transform: none;
      line-height: 1em;
      margin: 0;

      svg {
        margin-right: 0.5rem;
      }
    }

    > .item:hover {
      color: var(--color-text);
      text-decoration: none;
      background: var(--color-hover);
    }
  }
}

// 下拉菜单
.ui.dropdown .menu {
  margin-top: 3.75px !important;
  border-radius: 12px !important;
  overflow: hidden auto;
  box-shadow: 0px 0px 0px 0.5px #30363d, 0px 6px 12px -3px #01040966, 0px 6px 18px 0px #01040966;
  animation: 200ms cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running overlay-appear;
}

.ui.dropdown .menu,
.branch-tag-item.active,
.ui.pointing.dropdown > .menu:not(.hidden):after {
  background: var(--color-box-header) !important;
}

%item-style {
  background: #1f6feb;
}

.ui.dropdown .menu > .item.context:hover {
  @extend %item-style;
}

.user-main-content,
.repo-setting-content,
.user-setting-content,
.org-setting-content,
.admin-setting-content {
  .ui.dropdown .menu > .item {
    &:hover {
      @extend %item-style;

      a {
        color: var(--color-text);
      }
    }
  }
}

// 按钮菜单选项(主要为仓库)
.tippy-box .flex-items-block,
.ui.dropdown > .visible.menu .scrolling.menu,
.ui.button.dropdown .menu {
  .item {
    display: flex;
    align-items: center;
    border-radius: var(--border-radius);
    margin: 0 8px;

    &:first-of-type {
      border-radius: var(--border-radius);
      margin-top: 8px;
    }

    &:last-of-type {
      border-radius: var(--border-radius);
      margin-bottom: 8px;
    }
  }
}

.ui.dropdown.branch-selector-dropdown > .visible.menu {
  // 仓库分支列表下查看操作按钮
  > .item {
    display: flex;
    align-items: center;
    border-radius: var(--border-radius);
    margin: 8px;
    padding: 6px 8px !important;
  }

  .scrolling.menu .item {
    padding: 6px 16px !important;

    // 分支菜单下划线
    &:before {
      content: ' ';
      display: block;
      position: absolute;
      width: 100%;
      top: 0px;
      left: 0px;
      border-width: 1px 0px 0px;
      border-style: solid;
      border-image: initial;
      border-color: #3d444db3;
    }

    &:first-of-type:before {
      border-color: transparent;
    }

    &:hover {
      &:before {
        border-color: transparent;
      }

      + :before {
        border-color: transparent;
      }
    }

    .ui.label {
      margin-top: 1px;
      margin-left: auto;
      margin-right: 0;
    }
  }
}
