/********************************************************************************
 * Copyright (C) 2017, 2018 TypeFox and others.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the Eclipse
 * Public License v. 2.0 are satisfied: GNU General Public License, version 2
 * with the GNU Classpath Exception which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
 ********************************************************************************/

.theia-Tree {
    overflow: hidden;
    font-size: var(--g-ui-font-size1);
    max-height: calc(100% - var(--g-border-width));
    position: relative;
}

.theia-Tree:focus .theia-TreeContainer.empty {
    outline-width: 1px;
    outline-style: solid;
    outline-offset: -1px;
    opacity: 1 !important;
    outline-color: var(--g-focusBorder);
}

.theia-Tree:focus,
.theia-TreeContainer .ReactVirtualized__List:focus {
    outline: 0;
    box-shadow: none;
    border: none;
}

.theia-TreeContainer {
    height: 100%;
}

.theia-TreeNode {
    line-height: var(--g-content-line-height);
    display: flex;
    border-radius: var(--g-base-radius);
    overflow: hidden;
    /*transition: background .3s;*/
}

.theia-TreeNode:hover {
    background: var(--g-list-hoverBackground);
    color: var(--g-list-hoverForeground);
    cursor: pointer;
}

.theia-TreeNodeContent {
    display: flex;
    align-items: center;
    width: calc(100% - var(--g-scrollbar-rail-width));
    height: var(--g-tree-height);
}

.theia-TreeNodeContent .render-engine-icon {
    width: var(--g-tree-icon-width);
    height: var(--g-tree-icon-width);
    -webkit-mask-size: var(--g-tree-icon-width);
    mask-size: var(--g-tree-icon-width);
}

.theia-ExpansionToggle {
    display: flex;
    justify-content: center;
    padding-left: calc(var(--g-ui-padding) / 2);
    padding-right: calc(var(--g-ui-padding) / 2);
    min-width: var(--g-icon-size);
    min-height: var(--g-icon-size);
    background-size: var(--g-icon-size);
    background: var(--g-icon-chevron-right) center center no-repeat;
    margin-left: 4px;
}

.theia-ExpansionToggle.theia-mod-busy {
    background: var(--g-icon-loading) center center no-repeat;
    animation: theia-spin 1.25s linear infinite;
}

.theia-ExpansionToggle:not(.theia-mod-busy):hover {
    cursor: pointer;
}

.theia-ExpansionToggle:not(.theia-mod-busy):not(.theia-mod-collapsed) {
    transform: rotate(90deg);
}

.theia-Tree:focus .theia-TreeNode.theia-mod-selected,
.theia-Tree .ReactVirtualized__List:focus .theia-TreeNode.theia-mod-selected {
    background: var(--g-list-activeSelectionBackground);
    color: var(--g-list-activeSelectionForeground) !important;
}

.theia-Tree:focus .theia-TreeNode.theia-mod-selected .theia-TreeNodeTail,
.theia-Tree .ReactVirtualized__List:focus .theia-TreeNode.theia-mod-selected .theia-TreeNodeTail,
.theia-Tree:focus .theia-TreeNode.theia-mod-selected .theia-caption-suffix,
.theia-Tree .ReactVirtualized__List:focus .theia-TreeNode.theia-mod-selected .theia-caption-suffix {
    color: var(--g-list-activeSelectionForeground) !important;
}

.theia-Tree .theia-TreeNode.theia-mod-selected {
    background: var(--g-list-inactiveSelectionBackground);
    color: var(--g-list-inactiveSelectionForeground);
}

.theia-TreeNode.theia-mod-not-selectable {
    color: var(--g-descriptionForeground);
}

.theia-TreeNode.theia-mod-not-selectable:hover {
    background: none;
    cursor: default;
}

.theia-TreeNodeSegment {
    flex-grow: 0;
    user-select: none;
    white-space: nowrap;
}

.theia-TreeNodeSegmentGrow {
    flex-grow: 1 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theia-TreeNodeTail {
    min-width: 1rem;
    text-align: center;
}

.theia-TreeNodeSegment mark {
    background-color: var(--g-list-filterMatchBackground);
    color: var(--g-list-inactiveSelectionForeground);
}

.theia-tree-source-node-placeholder {
    text-align: center;
    font-style: italic;
    opacity: var(--g-mod-disabled-opacity);
}

.theia-tree-element-node {
    width: 100%
}

.theia-tree-dragging-nodes {
  position: fixed;
  width: 100px;
  background-color: #333;
  padding-left: 30px;
  box-sizing: border-box;
  z-index: 1000;
  opacity: 0.5;
}
.theia-tree-dragging-node {
  opacity: 0.2;
}
.theia-tree-dropping-line {
  position: fixed;
  z-index: 1000;
  width: 200px;
  height: 2px;
  left: 100px;
  top: 100px;
  background-color: var(--g-playground-select);
  display: none;
}
.theia-tree-dropping-line:before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: var(--g-small-radius);
  left: 0;
  top: -3px;
  display: block;
  background-color: var(--g-playground-select);
}

