$dark-row-hover-background: #878d92;
$dark-row-even-background: #515151;
$dark-row-selected-background: #878d92;
$dark-horizontal-dot-line: url('data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%220%200%202%202%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%3E%3Crect%20x%3D%220%22%20stroke%3D%22grey%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E') left top / 2px 2px;
$dark-vertical-dot-line: url('data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%220%200%202%202%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20stroke%3D%22grey%22%20width%3D%221%22%20height%3D%221%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E') left top / 2px 2px;


$light-row-hover-background: #efefef;
$light-row-even-background: #F8F8F8;
$light-row-selected-background: #c8e2fb;

$light-horizontal-dot-line: url('data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%220%200%202%202%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E') left top / 2px 2px;
$light-vertical-dot-line: url('data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%220%200%202%202%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E') left top / 2px 2px;

@import "../../constants/style/color";

.treeContainer {
  width: 100%;
  display: flex;
  overflow: auto;
  flex-direction: column;

  &.isAutoHeightFill {
    height: 100%;
  }

  &.hasAddButton {
    height: calc(100% - 50px);
  }

  &:not(.hasAddButton) {
    height: 100%;
  }

  .rootNode {
    font-weight: 800;
  }

  .header {
    margin-bottom: 2px;
    border-bottom: 2px solid grey;
    text-transform: uppercase;
    font-size: 12px;
    font-family: 'PT Sans', serif;

    &:hover {
      background-color: transparent;
    }
  }

  .column {
    flex: 1;
    align-items: center;
    text-align: left;
    display: inline-flex;
    height: 24px;
    overflow: hidden;

    > span {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  .expandColumn {
    align-self: flex-start;
    text-align: left;
    font-weight: bold;
    padding-left: 4px;
    display: inline-flex;
  }

  .vDotLine, .vDotLineInvisible {
    width: 2px;
    height: 24px;
    float: left;
    display: block;
    margin-left: 15px;
    margin-right: 2px;
  }

  .vDotLineInvisible {
    visibility: hidden;
  }

  .vDotLineLast {
    height: 13px;
  }

  .hDotLine {
    width: 10px;
    height: 2px;
    float: left;
    display: block;
    margin: 12px 2px 12px -2px;
  }

  .open, .close {
    width: 12px;
    height: 12px;
    float: left;
    margin-top: 6px;
    margin-right: 6px;
  }

  .open {
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%220%200%2012%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ctitle%2F%3E%3Cg%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2212%22%20height%3D%2212%22%20fill%3D%22white%22%20stroke%3D%22gray%22%20stroke-width%3D%221%22%2F%3E%3Cline%20x1%3D%223%22%20y1%3D%226%22%20x2%3D%229%22%20y2%3D%226%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E');
  }

  .close {
    background: url('data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%220%200%2012%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2212%22%20height%3D%2212%22%20fill%3D%22white%22%20stroke%3D%22gray%22%20stroke-width%3D%221%22%2F%3E%3Cline%20x1%3D%223%22%20y1%3D%226%22%20x2%3D%229%22%20y2%3D%226%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%2F%3E%3Cline%20x1%3D%226%22%20y1%3D%223%22%20x2%3D%226%22%20y2%3D%229%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E') center center / 12px 12px no-repeat;
  }

  .row {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    height: 24px;
  }

  .dropPlaceLine {
    position: absolute;
    height: 2px;
    background-color: $primary;
    pointer-events: none;
    box-sizing: border-box;
    opacity: 1;

    .dropPlaceCircle {
      margin-top: -1px;
      margin-left: -3px;
      right: 0;
      height: 4px;
      width: 4px;
      border-radius: 4px;
      background-color: $primary;
    }

    &.dropAsPrevious {
      top: -1px;
    }

    &.dropAsNext {
      bottom: -1px;
    }
  }

  .draggedRow > :not(.dropPlaceLine){
    opacity: 0.4;
  }

  .isDraggable {
    cursor: move;
  }

  .selectable {
    cursor: pointer;
  }

  .disabled {
    color: #9c9c9c;
  }

  .rightExtraItemContainer {
    padding: 0px 3px;
    display: flex;
    align-items: center;
    cursor: default;
  }

  .deleteButtonContainer {
    width: 20px;
  }

  &:global(.theme-light) {
    .tree {
      background-color: transparent;
    }
    .vDotLine {
      background: $light-vertical-dot-line;
    }
    .hDotLine {
      background: $light-horizontal-dot-line
    }

    &.isStriped {
      .row:nth-child(even):not(.active):not(.hover):not(.draggedRow) {
        background-color: $light-row-even-background;
      }
    }

    .row.hover:not(.active):not(.draggedRow) {
      background-color: $light-row-hover-background;
    }

    .active {
      background-color: $light-row-selected-background;
    }
  }
  &:global(.theme-dark) {
    .tree {
      background-color: transparent;
    }
    .vDotLine {
      background: $dark-vertical-dot-line;
    }
    .hDotLine {
      background: $dark-horizontal-dot-line
    }

    &.isStriped {
      .row:nth-child(even):not(.active):not(.hover):not(.draggedRow) {
        background-color: $light-row-even-background;
      }
    }

    .row.hover:not(.active):not(.draggedRow) {
      background-color: $dark-row-hover-background;
    }

    .active {
      background-color: $dark-row-selected-background;
    }
  }
  .iconContainer {
    padding: 7px 2px 2px;
  }
  .rowContainer {
    display: flex;
    flex: 1
  }
}

.addDeleteButtonsContainer {
  text-align: center;
  margin: 10px 0;
}

.itemOverlay {
  white-space: normal;
  max-width: 860px;
  padding: 5px;
}
