/********************************************************************************
 * 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-only WITH Classpath-exception-2.0
 ********************************************************************************/

/*-----------------------------------------------------------------------------
| Variables
|----------------------------------------------------------------------------*/

:root {
  --theia-private-sidebar-tab-width: 48px;
  --theia-private-sidebar-tab-height: 32px;
  --theia-private-sidebar-tab-padding-top-and-bottom: 11px;
  --theia-private-sidebar-tab-padding-left-and-right: 10px;
  --theia-private-sidebar-scrollbar-rail-width: 7px;
  --theia-private-sidebar-scrollbar-width: 5px;
  --theia-private-sidebar-icon-size: 24px;
}

/*-----------------------------------------------------------------------------
| SideBars (left and right)
|----------------------------------------------------------------------------*/

.lm-TabBar.theia-app-sides {
  display: block;
  color: var(--theia-activityBar-inactiveForeground);
  font-size: var(--theia-ui-font-size1);
  min-width: var(--theia-private-sidebar-tab-width);
  max-width: var(--theia-private-sidebar-tab-width);
  overflow: hidden;
}

.lm-TabBar-content {
  gap: 4px 0px;
}

.lm-TabBar.theia-app-sides .lm-TabBar-content {
  z-index: 1;
}

.lm-TabBar.theia-app-sides .lm-TabBar-tab {
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: var(--theia-private-sidebar-tab-height);
  cursor: pointer;
}

.lm-TabBar.theia-app-sides .lm-TabBar-tab.lm-mod-current,
.lm-TabBar.theia-app-sides .lm-TabBar-tab:hover {
  color: var(--theia-activityBar-foreground);
  background-color: var(--theia-activityBar-activeBackground);
  min-height: var(--theia-private-sidebar-tab-height);
  height: var(--theia-private-sidebar-tab-height);
  border-top: none;
}

.lm-TabBar.theia-app-left .lm-TabBar-tab.lm-mod-current {
  border-top-color: transparent;
  box-shadow: 2px 0 0 var(--theia-activityBar-activeBorder) inset;
}

.lm-TabBar.theia-app-right .lm-TabBar-tab.lm-mod-current {
  border-top-color: transparent;
  box-shadow: -2px 0 0 var(--theia-activityBar-activeBorder) inset;
}

.lm-TabBar.theia-app-sides .lm-TabBar-tabLabel,
.lm-TabBar.theia-app-sides .lm-TabBar-tabCloseIcon {
  display: none;
}

/* inactive common icons */
.lm-TabBar.theia-app-sides .lm-TabBar-tabIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--theia-private-sidebar-icon-size);
  text-align: center;
  color: inherit;

  /* svg */
  width: var(--theia-private-sidebar-tab-width);
  height: var(--theia-private-sidebar-tab-width);
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-size: var(--theia-private-sidebar-icon-size);
  -webkit-mask-size: var(--theia-private-sidebar-icon-size);
  mask-position: 50% 50%;
  -webkit-mask-position: 50% 50%;
}

/* inactive legacy/plugin icons */
.lm-TabBar.theia-app-sides .lm-TabBar-tabIcon:not(.codicon) {
  background: var(--theia-activityBar-inactiveForeground);
}

/* inactive file icons */
.lm-TabBar.theia-app-sides .file-icon.lm-TabBar-tabIcon {
  background: inherit !important;
}

/* inactive font-awesome icons */
.lm-TabBar.theia-app-sides .fa.lm-TabBar-tabIcon {
  background: none !important;
}

/* active icons */
.lm-TabBar.theia-app-sides .lm-TabBar-tabIcon:hover,
.lm-TabBar.theia-app-sides .lm-mod-current .lm-TabBar-tabIcon {
  color: var(--theia-activityBar-foreground);
}

/* active legacy/plugin icons */
.lm-TabBar.theia-app-sides .lm-TabBar-tabIcon:not(.codicon):hover,
.lm-TabBar.theia-app-sides .lm-mod-current .lm-TabBar-tabIcon:not(.codicon) {
  background-color: var(--theia-activityBar-foreground);
}

.lm-TabBar.theia-app-left .lm-TabBar-tabLabel {
  transform-origin: top left 0;
  transform: rotate(-90deg) translateX(-100%);
}

.lm-TabBar.theia-app-right .lm-TabBar-tabLabel {
  transform-origin: top left 0;
  transform: rotate(90deg) translateY(-50%);
}

#theia-left-content-panel.theia-mod-collapsed,
#theia-right-content-panel.theia-mod-collapsed {
  max-width: var(--theia-private-sidebar-tab-width);
}

#theia-left-content-panel.theia-mod-collapsed .theia-app-sidebar-container {
  border-right: none;
}

#theia-right-content-panel.theia-mod-collapsed .theia-app-sidebar-container {
  border-left: none;
}

#theia-left-content-panel > .lm-Panel {
  border-right: var(--theia-panel-border-width) solid
    var(--theia-activityBar-border);
}

#theia-right-content-panel > .lm-Panel {
  border-left: var(--theia-panel-border-width) solid
    var(--theia-activityBar-border);
}

.theia-side-panel {
  background-color: var(--theia-sideBar-background);
}

.lm-Widget.theia-side-panel .lm-Widget,
.lm-Widget .theia-sidepanel-toolbar {
  color: var(--theia-sideBar-foreground);
}

.theia-app-sidebar-container {
  min-width: var(--theia-private-sidebar-tab-width);
  max-width: var(--theia-private-sidebar-tab-width);
  background: var(--theia-activityBar-background);
  display: flex;
  flex-direction: column;
}

.theia-app-sidebar-container .theia-app-sides {
  flex-grow: 1;
}

.theia-app-sidebar-container .theia-sidebar-menu {
  flex-shrink: 0;
}

.lm-Widget.theia-sidebar-menu {
  background-color: var(--theia-activityBar-background);
  display: flex;
  flex-direction: column-reverse;
}

.lm-Widget .theia-sidebar-menu-item {
  cursor: pointer;
}

.lm-Widget.theia-sidebar-menu i {
  padding: var(--theia-private-sidebar-tab-padding-top-and-bottom)
    var(--theia-private-sidebar-tab-padding-left-and-right);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--theia-activityBar-inactiveForeground);
  background-color: var(--theia-activityBar-background);
  font-size: var(--theia-private-sidebar-icon-size);
}

.theia-sidebar-menu .theia-sidebar-menu-item:hover i {
  color: var(--theia-activityBar-foreground);
}

.theia-sidebar-menu i.theia-compact-menu {
  font-size: 16px;
}

.lm-SplitPanel-handle.sash-hidden {
  visibility: hidden;
}

/*-----------------------------------------------------------------------------
| Perfect scrollbar
|----------------------------------------------------------------------------*/

.lm-TabBar.theia-app-sides > .ps__rail-y {
  width: var(--theia-private-sidebar-scrollbar-rail-width);
  z-index: 1000;
}

#theia-app-shell .lm-TabBar.theia-app-sides > .ps__rail-y > .ps__thumb-y {
  width: var(--theia-private-sidebar-scrollbar-width);
  right: calc(
    (
        var(--theia-private-sidebar-scrollbar-rail-width) -
          var(--theia-private-sidebar-scrollbar-width)
      ) / 2
  );
}

.lm-TabBar.theia-app-sides > .ps__rail-y:hover,
.lm-TabBar.theia-app-sides > .ps__rail-y:focus {
  width: var(--theia-private-sidebar-scrollbar-rail-width);
}

.lm-TabBar.theia-app-sides > .ps__rail-y:hover > .ps__thumb-y,
.lm-TabBar.theia-app-sides > .ps__rail-y:focus > .ps__thumb-y {
  width: var(--theia-private-sidebar-scrollbar-width);
  right: calc(
    (
        var(--theia-private-sidebar-scrollbar-rail-width) -
          var(--theia-private-sidebar-scrollbar-width)
      ) / 2
  );
}

/*-----------------------------------------------------------------------------
| Bottom content panel
|----------------------------------------------------------------------------*/

#theia-bottom-content-panel {
  background: var(--theia-panel-background);
}

#theia-bottom-content-panel .theia-input {
  border-color: var(--theia-panelInput-border);
}

#theia-bottom-content-panel .lm-DockPanel-handle[data-orientation="horizontal"] {
  border-left: var(--theia-border-width) solid var(--theia-panel-border);
}

#theia-bottom-content-panel .lm-TabBar {
  border-top: var(--theia-border-width) solid var(--theia-panel-border);
  background: inherit;
}

/* Ensure the empty bottom panel keeps a top border separating it from the main panel. */
#theia-bottom-content-panel:not(:has(.lm-TabBar)) {
  border-top: var(--theia-border-width) solid var(--theia-panel-border);
}

#theia-bottom-content-panel .lm-TabBar-tab {
  background: inherit;
}

#theia-bottom-content-panel .lm-TabBar-tab:not(.lm-mod-current) {
  color: var(--theia-panelTitle-inactiveForeground);
}

#theia-bottom-content-panel .lm-TabBar-tab.lm-mod-current {
  color: var(--theia-panelTitle-activeForeground);
  box-shadow: 0 var(--theia-border-width) 0 var(--theia-panelTitle-activeBorder)
    inset;
}

#theia-bottom-content-panel
  .lm-TabBar:not(.theia-tabBar-active)
  .lm-TabBar-tab
  .theia-tab-icon-label {
  color: var(--theia-tab-unfocusedInactiveForeground);
}

#theia-bottom-content-panel
  .lm-TabBar:not(.theia-tabBar-active)
  .lm-TabBar-tab.lm-mod-current
  .theia-tab-icon-label {
  color: var(--theia-tab-unfocusedActiveForeground);
}

/*-----------------------------------------------------------------------------
| Hidden tab bars used for rendering vertical side bars
|----------------------------------------------------------------------------*/

.theia-TabBar-hidden-content {
  display: flex;
  position: absolute;
  visibility: hidden;
  padding-inline-start: 0px;
}

.lm-TabBar.theia-app-sides > .theia-TabBar-hidden-content .lm-TabBar-tab {
  line-height: var(--theia-private-sidebar-tab-width);
}

.lm-TabBar.theia-app-left > .theia-TabBar-hidden-content .lm-TabBar-tabLabel {
  transform: none;
}

.lm-TabBar.theia-app-right > .theia-TabBar-hidden-content .lm-TabBar-tabLabel {
  transform: none;
}

/*-----------------------------------------------------------------------------
| Sidepanel Toolbar
|----------------------------------------------------------------------------*/

.theia-sidepanel-toolbar {
  display: flex;
  align-items: center;
  min-height: var(--theia-horizontal-toolbar-height);
  background-color: var(--theia-sideBar-background);
  overflow: hidden;
}

.theia-sidepanel-toolbar .theia-sidepanel-title {
  color: var(--theia-settings-headerForeground);
  flex: 1;
  margin-left: calc(var(--theia-ui-padding) * 3);
  text-transform: uppercase;
  font-size: var(--theia-ui-font-size0);
  min-width: 1rem;
}

.theia-sidepanel-toolbar .lm-TabBar-toolbar .item {
  color: var(--theia-icon-foreground);
}

.noWrapInfo {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.noWrapInfoTree {
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}
