@import '../../style/index.less';

@pro-header-hover-bg: rgba(0, 0, 0, 0.05);

.menu {
  :global(.anticon) {
    border: 1px red dashed;
    //margin-right: 8px;
  }

  :global(.ant-dropdown-menu-item) {
    min-width: 160px;
  }
}

.right {
  display: flex;
  //margin-left: auto;
  overflow: hidden;

  & .ant-space-item {
    height: 100%;
    margin-right: 6px !important;
  }

  .action {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 10px;
    transition: all 0.3s;

    &.account {
      > * {
        pointer-events: auto;
      }
    }

    > * {
      /* 鼠标事件穿透*/
      pointer-events: none;
    }

    > span {
      vertical-align: middle;
    }

    &:hover {
      cursor: pointer;
      background: @pro-header-hover-bg;
    }

    &:global(.opened) {
      background: @pro-header-hover-bg;
    }
  }

  .search {
    padding: 0 12px;

    &:hover {
      background: transparent;
    }
  }

  .account {
    .avatar {
      margin-right: 8px;
      height: 100%;
      color: @primary-color;
      background: rgba(255, 255, 255, 0.85);
    }

    .name {
      font-size: 13px;
    }

    .down {
      margin-left: 6px;
    }

    :hover {
      .down {
        //transform: rotate(180deg);
        //display: none;
        //visibility: hidden;
      }
    }
  }
}

.dark {
  color: @component-background;

  .right {
    .action {
      &:hover {
        color: unset;
        background: #252a3d;
        //background: rgba(37, 42, 61, 0.2);
        //background: #252a3d;
      }

      &:global(.opened) {
        background: #252a3d;
      }
    }
  }
}

.@{dropdown-prefix-cls} {
  @icon-padding: 8px;

  &-menu {
    &-item {
      span:not(.anticon) {
        margin-right: @icon-padding;
      }

      .anticon {
        width: 1em;
        height: 1em;
        font-size: 1em;
        margin-right: @icon-padding;
      }
    }

    &-submenu-title {
      padding: 5px 12px;
      display: flex;

      & > span {
        flex: 1;
      }

      .@{dropdown-prefix-cls}-menu-submenu-arrow {
        display: flex;
        flex: 0 0 0;
        justify-content: center;
        align-items: center;
        margin-left: 8px;
        position: unset;

        .anticon {
          width: 1em;
          height: 1em;
          margin: 0 !important;
        }
      }
    }

    &-item,
    &-submenu-title {
      &-divider {
        margin: 2px 8px;
      }
    }
  }
}
