/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

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

:root {
  /* These need to be root because tabs get attached to the body during dragging. */
  --jp-private-horizontal-tab-height: 24px;
  --jp-private-horizontal-tab-width: 216px;
  --jp-private-horizontal-tab-active-top-border: 2px;
}

/*-----------------------------------------------------------------------------
| Tabs in the dock panel
|----------------------------------------------------------------------------*/

.p-DockPanel-tabBar {
  border-bottom: var(--jp-border-width) solid var(--jp-border-color1);
  overflow: visible;
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
}

.p-DockPanel-tabBar[data-orientation='horizontal'] {
  min-height: calc(
    var(--jp-private-horizontal-tab-height) + 2 * var(--jp-border-width)
  );
}

.p-DockPanel-tabBar[data-orientation='vertical'] {
  min-width: 80px;
}

.p-DockPanel-tabBar > .p-TabBar-content {
  align-items: flex-end;
  min-width: 0;
  min-height: 0;
}

.p-DockPanel-tabBar .p-TabBar-tab {
  flex: 0 1 var(--jp-private-horizontal-tab-width);
  min-height: calc(
    var(--jp-private-horizontal-tab-height) + var(--jp-border-width)
  );
  min-width: 0px;
  margin-left: calc(-1 * var(--jp-border-width));
  line-height: var(--jp-private-horizontal-tab-height);
  padding: 0px 8px;
  background: var(--jp-layout-color2);
  border: var(--jp-border-width) solid var(--jp-border-color1);
  border-bottom: none;
  position: relative;
}

.p-DockPanel-tabBar .p-TabBar-tab:hover:not(.p-mod-current) {
  background: var(--jp-layout-color1);
}

.p-DockPanel-tabBar .p-TabBar-tab:first-child {
  margin-left: 0;
}

/* This is a current tab of a tab bar in the dock panel: each tab bar has 1. */
.p-DockPanel-tabBar .p-TabBar-tab.p-mod-current {
  background: var(--jp-layout-color1);
  color: var(--jp-ui-font-color0);
  min-height: calc(
    var(--jp-private-horizontal-tab-height) + 2 * var(--jp-border-width)
  );
  transform: translateY(var(--jp-border-width));
}

/* This is the main application level current tab: only 1 exists. */
.p-DockPanel-tabBar .p-TabBar-tab.jp-mod-current:before {
  position: absolute;
  top: calc(-1 * var(--jp-border-width));
  left: calc(-1 * var(--jp-border-width));
  content: '';
  height: var(--jp-private-horizontal-tab-active-top-border);
  width: calc(100% + 2 * var(--jp-border-width));
  background: var(--jp-brand-color1);
}

/* This is the left tab bar current tab: only 1 exists. */
.p-TabBar-tab.p-mod-current {
  color: var(--jp-ui-font-color0);
  background: var(--jp-layout-color1);
}

.p-TabBar-tab.p-mod-current:hover {
  background: var(--jp-layout-color1);
}

.p-DockPanel-tabBar .p-TabBar.p-mod-left .p-TabBar-tab,
.p-DockPanel-tabBar .p-TabBar.p-mod-right .p-TabBar-tab {
  flex: 0 1 40px;
  margin-top: -1px;
  line-height: 40px;
}

.p-DockPanel-tabBar .p-TabBar.p-mod-left .p-TabBar-tab {
  border-right: none;
}

.p-DockPanel-tabBar .p-TabBar.p-mod-right .p-TabBar-tab {
  border-left: none;
}

.p-DockPanel-tabBar .p-TabBar.p-mod-left .p-TabBar-tab:first-child,
.p-DockPanel-tabBar .p-TabBar.p-mod-right .p-TabBar-tab:first-child {
  margin-top: 0;
}

.p-DockPanel-tabBar .p-TabBar.p-mod-left .p-TabBar-tab.p-mod-current,
.p-DockPanel-tabBar .p-TabBar.p-mod-right .p-TabBar-tab.p-mod-current {
  min-width: 80px;
  max-width: 80px;
}

.p-DockPanel-tabBar .p-TabBar.p-mod-right .p-TabBar-tab.p-mod-current {
  transform: translateX(-1px);
}

.p-DockPanel-tabBar .p-TabBar-tabIcon,
.p-DockPanel-tabBar .p-TabBar-tabLabel,
.p-DockPanel-tabBar .p-TabBar-tabCloseIcon {
  display: inline-block;
}

.p-DockPanel-tabBar .p-TabBar-tab .p-TabBar-tabIcon,
.p-TabBar-tab.p-mod-drag-image .p-TabBar-tabIcon {
  width: 14px;
  background-position: left center;
  background-repeat: no-repeat;
  background-size: 14px;
  margin-right: 4px;
}

.p-DockPanel-tabBar .p-TabBar-tab.p-mod-current .p-TabBar-tabIcon {
  margin-bottom: var(--jp-border-width);
}

.p-TabBar-WindowTabLabel {
  margin-top: 4px;
}

.p-DockPanel-tabBar .p-TabBar-tab.p-mod-closable > .p-TabBar-tabCloseIcon {
  margin-left: 4px;
  padding-top: 8px;
  background-size: 16px;
  height: 16px;
  width: 16px;
  background-image: var(--jp-icon-close);
  background-position: center;
  background-repeat: no-repeat;
}

.p-DockPanel-tabBar
  .p-TabBar-tab.p-mod-closable.jp-mod-dirty
  > .p-TabBar-tabCloseIcon {
  background-size: 10px;
  background-image: var(--jp-icon-circle);
}

.p-DockPanel-tabBar
  .p-TabBar-tab.p-mod-closable
  > .p-TabBar-tabCloseIcon:hover {
  background-size: 16px;
  background-image: var(--jp-icon-close-circle);
}

.p-TabBar-tab.p-mod-drag-image {
  background: var(--jp-layout-color1);
  border: var(--jp-border-width) solid var(--jp-border-color1);
  border-top: var(--jp-border-width) solid var(--jp-brand-color1);
  box-shadow: var(--jp-elevation-z4);
  color: var(--jp-ui-font-color1);
  font-size: var(--jp-ui-font-size1);
  line-height: var(--jp-private-horizontal-tab-height);
  min-height: var(--jp-private-horizontal-tab-height);
  min-width: var(--jp-private-horizontal-tab-width);
  padding: 0px 10px;
  transform: translateX(-40%) translateY(-58%);
}

/* .p-TabBar-tab.p-mod-drag-image .p-TabBar-tabLabel {
  margin-left: 4px;
} */
