
%queryBuilder-leftStroke {
  position: relative;
  margin-left: 10px;

  &:before {
    content: ' ';
    display: block;
    position: absolute;
    top: 50%;
    left: -10px;
    width: 10px;
    height: 2px;
    background: #efefef;
  }
}

.queryBuilder {
  line-height: 1;
  font-size: 12px;

  #{&} {
    border: 1px solid #eee;
    background: rgba($light-grey-color, .1);
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
  }

  .el-form-item__content {
    line-height: inherit;
  }

  .queryBuilder--readonly * {
    cursor: default;
  }
}

.queryBuilder-actions {
  display: flex;

  .el-button {
    background: #efefef;
    border: 0;
    padding: 5px 7px;
    margin-left: 3px;
    font-size: 18px;

    &:hover .path3:before { color: #25b943; }
  }
}

.queryBuilder-conditionOperator {
  background: #6e6e6e;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;

  .el-input__inner {
    background: none;
    border: 0;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    text-transform: uppercase;
    width: 65px;
    padding: 0 10px;
  }

  .el-input__suffix { right: 3px; }

  .el-input .el-select__caret { color: #fff; }


  .is-disabled {
    .el-input__inner {
      background: none;
      border: 0;
      font-size: 12px;
      font-weight: 500;
      color: #fff;
      text-transform: uppercase;
      width: 65px;
      padding: 0 10px;
    }

    .el-select__caret { display: none }
  }
}

.queryBuilder-conditionText {
  background: #2fb3ff;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #ffff;
  display: flex;
  align-items: center;
  padding: 0 9px;
  margin-right: 5px;
}

.queryBuilder-group {
  padding-left: 20px;
}

.queryBuilder-item {
  position: relative;
  padding-left: 30px;
  padding-top: 20px;

  &:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 1px;
    border-left: 1px dashed $light-grey-color;
  }

  &:last-child:before {
    height: 34px;
  }

  &:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 1px;
    width: 15px;
    margin-top: 34px;
    border-bottom: 1px dashed $light-grey-color;
  }
}

.queryBuilder-operatorHelper {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  font-size: 10px;
  text-transform: uppercase;
  line-height: 20px;
  color: #9e9e9e;
  background: #fff;

  .queryBuilder--sub & { background: #fafafa; }
}

.queryBuilder-removeButton {
  appearance: none;
  position: absolute;
  z-index: 1;
  top: 34px;
  left: 17px;
  transform: translate(-50%, -50%);
  padding: 0;
  border: none;
  background: #fff;
  border-radius: 99em;
  width: 16px;
  height: 16px;
  font-size: 12px;
  transition: color 0.3s;

  &:hover {
    font-size: 16px;

    .path1:before { color: $danger-color; }
  }
}

.queryBuilder-criterion {
  display: flex;
}

.queryBuilder-operator,
.queryBuilder-value,
.queryBuilder-field {
  margin-left: 10px;
  width: auto;
}

.queryBuilder-field,
.queryBuilder-operator,
.queryBuilder-value-visible {
  @extend %queryBuilder-leftStroke;
}

.queryBuilder-item .el-input__inner,
.queryBuilder-operator .el-input__inner {
  font-size: 12px;
  font-weight: 500;
}

.queryBuilder-value {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.queryBuilder-preview {
  background: #efefef;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #606266;
  line-height: 16px;
  padding: 7px 10px 5px;
  cursor: pointer;
  transition: background 0.3s;

  &:hover { background: #e5e5e5; }


  .queryBuilder--readonly &:hover { background: #efefef; }
}
