@import '../../style/themes/index';
@import '../../style/mixins/index';

@m-rules-prefix-cls: m-rules;

.@{m-rules-prefix-cls} {

  &-item {
    margin: 0 0 12px 24px;

    &-custom-value-input.ant-input,
    .ant-cascader {
      width: 228px;
    }

    &-cascader-custom.ant-cascader-picker {
      width: 110px;
    }

    .ant-form-item &-select {
      width: 100px;
    }

    &-value {
      display: flex;

      .ant-input {
        &:hover {
          z-index: 5;
        }
      }

      .ant-cascader {
        &:hover {
          z-index: 5;
        }
      }
    }

    &-icon {
      margin-right: @margin-xs;
    }

    &-close-icon {
      position: relative;
      top: -12px;
      cursor: pointer;
      opacity: 0;
      transition: opacity 0.25s ease-in-out, color 0.25s ease-in-out;

      &:hover {
        color: @error-color;
      }
    }

    &:hover {
      .@{m-rules-prefix-cls}-item-close-icon {
        opacity: 1;
      }
    }
  }

  &-group {
    &-item {
      width: 100%;
      padding: 24px 16px 0;
      background-color: #f5f7f8;
    }

    &-children {
      position: relative;
      padding-top: 16px;

      &::before {
        position: absolute;
        top: 0;
        left: 8px;
        z-index: 1;
        display: block;
        width: 1px;
        height: calc(100% - 4px);
        content: "";
        background: #d9dfe6;
      }
    }

    &-text-name {
      width: 346px;
    }

    &-text-value {
      width: 552px;
    }
  }

  &-child-container {
    position: relative;
    margin-bottom: -14px;
  }

  &-link {
    position: absolute;
    top: 35px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #107cee;
    cursor: pointer;
    user-select: none;
    background-color: #fff;
    border: 1px solid #d9dfe6;
  }

  &-add {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    color: #107cee;
    cursor: pointer;

    &-icon {
      width: 18px;
      height: 18px;
      padding-left: 2px;
      margin-right: 8px;
      background-color: #d4e7fc;
    }
  }
}
