@import "bootstrap/less/variables.less";
@import "octicon-mixins.less";

.tree-view-resizer {
  position: relative;
  height: 100%;
  overflow: hidden;
  cursor: default;
  -webkit-user-select: none;
  min-width: 50px;
  z-index: 2;

  .tree-view-resize-handle {
    position: absolute;
    top: 0;
    right: -5px;
    bottom: 0;
    width: 10px;
    cursor: col-resize;
    z-index: 3;
  }
}

.tree-view-scroller {
  height: 100%;
  width: 100%;
  overflow: auto;
}

.tree-view {
  min-width: -webkit-min-content;
  min-height: 100%;
  @item-line-height: @line-height-base * 1.25;
  @disclosure-arrow-size: 12px;
  @icon-margin: @line-height-base / 4;

  position: relative;
  padding: 0 @icon-margin;
  margin-bottom: 0;
  cursor: default;

  .entry {
    text-wrap: none;
    white-space: nowrap;

    .name {
      position: relative;
      z-index: 1;
    }

    &.selected > .highlight {
      position: absolute;
      left: 0;
      right: 0;
      height: @item-line-height;
    }
  }

  .directory {
    > .header {
      line-height: @item-line-height;
      .disclosure-arrow { margin-right: @icon-margin; }
    }

    .entries {
      margin-left: 12px;
    }
  }

  .file {
    line-height: @item-line-height;

    .name {
      margin-left: @disclosure-arrow-size + @icon-margin;
    }
  }

  // icons
  .name:before {
    margin-right: @icon-margin;
    position: relative;
    top: 1px;
  }

  .directory > .header {
    .disclosure-arrow {
      .mini-icon(arr-collapsed, @disclosure-arrow-size);
      position: relative;
    }
    .directory-icon { .mini-icon(directory); }
    .repository-icon { .mini-icon(public-repo); }
    .submodule-icon { .mini-icon(submodule); }
  }

  .directory.expanded > .header {
    .disclosure-arrow { .mini-icon(arr-expanded, @disclosure-arrow-size); }
  }

  .file {
    .text-icon { .mini-icon(text-file); }
    .image-icon { .mini-icon(download-media); }
    .compressed-icon { .mini-icon(download-zip); }
    .pdf-icon { .mini-icon(download-pdf); }
    .readme-icon { .mini-icon(readme); }
    .binary-icon { .mini-icon(binary-file); }
    .symlink-icon { .mini-icon(symlink); }
  }
}


.tree-view-dialog {
  padding: 5px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;

  .prompt {
    padding-bottom: 3px;
    font-size: 12px;
    line-height: 16px;
    &:before { margin-right: @line-height-base / 4; }
    &.add-file { .mini-icon(new-file); }
    &.add-directory { .mini-icon(create-directory); }
    &.prompt.move { .mini-icon(arr-right); }
  }
}
