@import '../index.scss';

.amos-popover-down::after {
  /* stylelint-disable-next-line declaration-no-important */
  border-bottom: 6px solid $background-transparent !important;
}

.mod-com-firetree {
  width: 100%;
  height: 100%;
  // border-right: solid 1px #eaeaea;
  border-right: solid 1px $color-eaeaea;

  .mod-com-firetree-header {
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 8px;
    background: $header-background;

    >input {
      flex: 1;
      height: 36px;
      margin-right: 8px;
      // border: solid 1px #d9d9d9;
      // color: var(--gm-font-color);
      background: $background-color-051c45;
      border: solid 1px $color-d9d9d9;
      border-radius: 4px;
    }
  }

  .mod-com-firetree-check {
    color: white;
    margin-left: 10px;
    margin-bottom: -10px;

    .amos-checkbox-input:checked+.amos-checkbox-status+.amos-checkbox-text {
      color: white;
    }

    >checkbox:hover {
      color: white;
    }
  }

  .mod-com-firetree-content {
    width: 100%;
    height: calc(100% - 42px);
    background: $firetree-background;
    overflow: auto;

    @include pretty-scrollbar(5px, 8px, $scrollOutColor, $scrollInnerColor);

    .amos-tree {
      padding-right: 0;
      padding-left: 6px;
      transform: scale(1);
    }

    .amos-tree .amos-tree-treenode {
      &.amos-tree-treenode-selected {
        >.amos-tree-node-content-wrapper {
          background: transparent;

          &::before {
            background: rgba(168, 241, 223, 0.3);
          }
        }
      }
    }

    .amos-tree span.amos-tree-node-content-wrapper {
      display: inline-flex;
      width: calc(100% - 24px);
      height: 24px;
      padding: 0;
      vertical-align: top;
      align-items: center;

      .amos-tree-title {
        width: 100%;
        height: 24px;
      }

      &:hover {
        background: transparent;

        &::before {
          background: rgba(168, 241, 223, 0.3);
        }

        .mod-com-firetree-tree-more {
          display: inline-flex;
          // background: #b1f5e1;
          background: $color-b1f5e1;
        }
      }

      &::before {
        position: fixed;
        left: 0;
        z-index: -1;
        width: 100%;
        height: 24px;
        background: transparent;
        content: '';
      }
    }

    .amos-tree.amos-tree-dashline li span.amos-tree-switcher {
      z-index: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: transparent;

      &::after {
        width: 16px;
        height: 16px;
        background-image: url('~@gm/graphmod-assets/assets/common/treeOpen.svg');
        background-repeat: no-repeat;
        content: '';
      }

      &.amos-tree-switcher-open {
        transform: rotate(90deg);
      }

      &.amos-tree-switcher-noop {
        &::after {
          width: 8px;
          height: 8px;
          background: rgba(158, 157, 164, 0.4);
          border-radius: 50%;
        }
      }
    }
  }
}

.mod-com-firetree-item {
  position: relative;
  display: inline-flex;
  width: 100%;
  height: 100%;
  align-items: center;

  img {
    max-width: 24px;
    object-fit: contain;
  }

  .child-icon {
    width: 16px;
    height: 16px;
    margin-right: 5px;
  }

  >span {
    width: 0;
    height: 100%;
    flex: 1;
    overflow: hidden;
    line-height: 24px;
    // color: #707070;
    color: $font-color-black;
    text-overflow: ellipsis;
    word-break: break-all;
    white-space: nowrap;

    >input {
      width: 100%;
      height: 100%;
      padding-left: 5px;
      font-size: 12px;
      // border: 1px solid #345fa6;
      border: 1px solid $color-345fa6;
      border-radius: 0;
      outline: none;
    }
  }

  .mod-com-firetree-tree-more {
    display: none;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
  }
}

.mod-com-firetree-popover {
  // background: white;
  background: $background-color-white;
  // border: 1px solid $color-e7e7e7;
  border: 1px solid $amos-form-item-border;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);

  .amos-nestedmenu-light {
    background: $form-modal-background;
    border: 1px solid $amos-form-item-border;

    .leafmenu {
      color: $font-color-black;
    }
  }
}

.mod-com-firetree-popover-wrapper.amos-popover {
  padding-top: 0;
}

.mod-com-firetree-menu.amos-nestedmenu {
  min-width: 09;
  padding: 5px 0;
  box-shadow: none;

  .mod-com-firetree-menuitem-content {
    display: flex;
    align-items: center;
    padding: 0 8px;
  }

  .amos-nestedmenu-item:active:not(.disabled) {
    background-color: transparent;
  }

  li {
    display: flex;
    height: 30px;
    padding-right: 0;
    padding-left: 0;
    font-size: 13px;
    line-height: 30px;
    // color: #333;
    color: $font-color-333333;
    align-items: center;
    cursor: pointer;

    .amos-nestedmenu-item {
      padding: 0;
      line-height: 30px;

      &:hover {
        background: transparent;
      }
    }

    &:hover {
      // background: #f6f6f6;
      background: $firecard-menulist-background-hover;
    }

    &.mod-com-firetree-menudivider {
      // border-bottom: 1px solid #e7e7e7;
      border-bottom: 1px solid $color-e7e7e7;
    }

    img {
      width: 20px;
      height: 20px;
      margin-right: 5px;
    }

    .mod-com-firetree-menu-img {
      display: inline-block;
      width: 20px;
      height: 20px;
      margin-right: 5px;
    }
  }
}

.mod-com-firetree-popover-wrapper .amos-nestedmenu-subitem-popup {
  width: auto;
  min-width: 0;
  // background: $background-color-white;

  .amos-nestedmenu {
    width: auto;
    min-width: 90px;
    padding: 5px 0;
    // border: 1px solid #e7e7e7;
    background: $form-modal-background;
    border: 1px solid $amos-form-item-border;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);

    .mod-com-firetree-menuitem-content {
      display: flex;
      align-items: center;
      padding: 0 8px;
    }

    li {
      display: flex;
      height: 30px;
      padding-right: 0;
      padding-left: 0;
      font-size: 13px;
      line-height: 30px;
      // color: #333;
      color: $font-color-333333;
      align-items: center;
      cursor: pointer;

      .amos-nestedmenu-item {
        padding: 0;
        line-height: 30px;

        &:hover {
          background: transparent;
        }
      }

      &:hover {
        // background: #f6f6f6;
        background: $firecard-menulist-background-hover;
      }

      &.mod-com-firetree-menudivider {
        // border-bottom: 1px solid #e7e7e7;
        border-bottom: 1px solid $color-e7e7e7;
      }

      img {
        width: 20px;
        height: 20px;
        margin-right: 5px;
      }

      .mod-com-firetree-menu-img {
        display: inline-block;
        width: 20px;
        height: 20px;
        margin-right: 5px;
      }
    }
  }
}
