$nestable-root-class: dd;
$nestable-list-class: dd-list;
$nestable-item-class: dd-item;
$nestable-drag-class: dd-dragel;
$nestable-handle-class: dd-handle;
$nestable-content-class: dd-content;
$nestable-content-more-class: dd-content-more;
$nestable-collapsed-class: dd-collapsed;
$nestable-expanded-content-class: dd-expanded-content;
$nestable-placeholder-class: dd-placeholder;
$nestable-no-children-class: dd-nochildren;
$nestable-empty-class: dd-empty;

.#{$nestable-root-class} {
  position: relative;
  display: block;
  max-width: 600px;
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 20px;
  list-style: none;
}

.#{$nestable-list-class} {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.#{$nestable-item-class},
.#{$nestable-empty-class},
.#{$nestable-placeholder-class} {
  position: relative;
  display: block;
  min-height: 30px;
  margin: 0;
  padding: 0 0 0 30px;
  font-size: 13px;
  line-height: 20px;
}

.#{$nestable-handle-class} {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 30px;
  height: 30px;
  margin: 0;
  background: linear-gradient(180deg, #ddd 0%, #bbb 100%);
  border: 1px solid #ccc;
  border-radius: 3px;
  box-sizing: border-box;
  overflow: hidden;
  font-weight: bold;
  color: #333;
  text-decoration: none;
  text-indent: 30px;
  white-space: nowrap;
  cursor: pointer;

  &:before {
    content: '≡';
    position: absolute;
    top: 4px;
    left: 0;
    display: block;
    width: 100%;
    font-size: 20px;
    font-weight: normal;
    color: #fff;
    text-align: center;
    text-indent: 0;
  }

  &:hover {
    background: #ddd;
    color: #2ea8e5;
  }
}

.#{$nestable-content-class} {
  display: block;
  margin: 5px 0;
  padding: 5px 10px 5px 40px;
  background: linear-gradient(180deg, #fafafa 0%, #eee 100%);
  border: 1px solid #ccc;
  border-radius: 3px;
  font-weight: bold;
  color: #333;
  text-decoration: none;
  line-height: 18px;

  &:hover {
    background: #fff;
    color: #2ea8e5;
  }
}

.#{$nestable-content-more-class} {
  display: none;
  margin-top: 10px;
}

.#{$nestable-item-class} > button {
  position: relative;
  float: left;
  width: 25px;
  height: 20px;
  margin: 5px 0;
  padding: 0;
  background: transparent;
  border: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
  text-align: center;
  text-indent: 100%;
  white-space: nowrap;
  cursor: pointer;

  &:before {
    position: absolute;
    display: block;
    width: 100%;
    text-align: center;
    text-indent: 0;
  }

  &.dd-expand:before {
    content: '+';
  }

  &.dd-collapse:before {
    content: '-';
  }

  &.dd-expand-content:before {
    content: '+';
  }

  &.dd-collapse-content:before {
    content: '-';
  }
}

.dd-expand {
  display: none;
}
.#{$nestable-collapsed-class} .#{$nestable-list-class},
.#{$nestable-collapsed-class} .dd-collapse {
  display: none;
}
.#{$nestable-collapsed-class} .dd-expand {
  display: block;
}

.dd-collapse-content {
  display: none;
}
.#{$nestable-expanded-content-class} > .dd-collapse-content {
  display: block;
}
.#{$nestable-expanded-content-class} > .dd-expand-content {
  display: none;
}

.#{$nestable-empty-class},
.#{$nestable-placeholder-class} {
  min-height: 30px;
  margin: 5px 0;
  padding: 0;
  background: #f2fbff;
  border: 1px dashed #b6bcbf;
  box-sizing: border-box;
}

.#{$nestable-empty-class} {
  min-height: 100px;
  background-color: #e5e5e5;
  background-size: 60px 60px;
  background-position: 0 0, 30px 30px;
  border: 1px dashed #bbb;
}

.#{$nestable-drag-class} {
  position: absolute;
  z-index: 9999;
  pointer-events: none;

  & > .#{$nestable-item-class} .#{$nestable-handle-class} {
    margin-top: 0;
  }

  .#{$nestable-handle-class} {
    box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
  }
}

.#{$nestable-no-children-class} .#{$nestable-placeholder-class} {
  display: none;
}
