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

:root {
    /* These need to be root because tabs get attached to the body during dragging. */
    --g-private-horizontal-tab-height: 28.5px;
    --g-private-horizontal-tab-scrollbar-rail-height: 7px;
    --g-private-horizontal-tab-scrollbar-height: 5px;
    --g-tabbar-toolbar-z-index: 1001;
}

/*-----------------------------------------------------------------------------
| General tab bar style
|----------------------------------------------------------------------------*/

.p-TabBar {
    font-size: var(--g-ui-font-size1);
}

.p-TabBar[data-orientation='horizontal'] {
    overflow-x: hidden;
    overflow-y: hidden;
    min-height: calc(var(--g-private-horizontal-tab-height) + var(--g-private-horizontal-tab-scrollbar-rail-height) / 2);
}

.p-TabBar .p-TabBar-content {
    cursor: pointer;
}

.p-TabBar[data-orientation='horizontal'] .p-TabBar-tab {
    flex: none;
    /* height: calc(var(--g-private-horizontal-tab-height) + var(--g-private-horizontal-tab-scrollbar-rail-height) / 2); */
    height: 20px;
    min-width: 35px;
    /* line-height: var(--g-private-horizontal-tab-height); */
    padding: 0px 8px;
    align-items: center;
    margin: 6px 0 6px 6px;
    border-radius: 6px;
}

.p-TabBar[data-orientation='horizontal'] .p-TabBar-tab:nth-child(1) {
    margin-left: 14px;
}

.p-TabBar[data-orientation='horizontal'] .p-TabBar-tab .theia-tab-icon-label,
.p-TabBar-tab.p-mod-drag-image .theia-tab-icon-label {
    display: flex;
    line-height: var(--g-content-line-height);
    align-items: center;
}


.p-TabBar[data-orientation='horizontal'] .p-TabBar-tab:not(.p-mod-current) {
    color: var(--g-panelTitle-inactiveForeground);
}

.p-TabBar[data-orientation='horizontal'] .p-TabBar-tab.p-mod-current {
    color: var(--g-panelTitle-activeForeground);
    /* border-top: var(--g-border-width) solid var(--g-panelTitle-activeBorder); */
    background-color: var(--g-panelTitle-activeBackground);
}

.p-TabBar[data-orientation='horizontal'] .p-TabBar-tab.p-mod-current.theia-mod-active {
    border-top-color: var(--g-focusBorder);
}
 /** 强制替换 tab bar 上的icon 颜色*/
 .p-TabBar[data-orientation='horizontal'] .p-TabBar-tab .p-TabBar-tabIcon {
    background-color: var(--g-icon-foreground) !important;
}
/*-----------------------------------------------------------------------------
| Tabs in the center area (main and bottom)
|----------------------------------------------------------------------------*/

/*
#theia-main-content-panel .p-DockPanel-handle[data-orientation='horizontal'] {
    border-left: var(--g-border-width) solid var(--g-editorGroup-border);
}

#theia-main-content-panel .p-DockPanel-handle[data-orientation='vertical'] + .p-TabBar {
    border-top: var(--g-border-width) solid var(--g-editorGroup-border);
}

#theia-main-content-panel .p-TabBar .p-TabBar-tab {
    border-right: var(--g-border-width) solid var(--g-tab-border);
}

 #theia-main-content-panel .p-TabBar .p-TabBar-tab:hover.theia-mod-active {
    background: var(--g-tab-hoverBackground) !important;
    box-shadow: var(--g-tab-hoverBorder) 0 -1px inset !important;
}

#theia-main-content-panel .p-TabBar .p-TabBar-tab:hover:not(.theia-mod-active) {
    background: var(--g-tab-unfocusedHoverBackground) !important;
    box-shadow: var(--g-tab-unfocusedHoverBorder) 0 -1px inset !important;
} */

/* active tab in an active group */
/* body.theia-editor-highlightModifiedTabs
#theia-main-content-panel .p-TabBar .p-TabBar-tab.p-mod-current.theia-mod-active.theia-mod-dirty {
    border-top: 1px solid var(--g-tab-activeModifiedBorder);
}

#theia-main-content-panel .p-TabBar .p-TabBar-tab.p-mod-current.theia-mod-active {
    background: var(--g-tab-activeBackground);
    color: var(--g-tab-activeForeground);
    border-top: 1px solid var(--g-tab-activeBorderTop);
    border-bottom: 1px solid var(--g-tab-activeBorder);
}
 */
/* inactive tab in an active group */
/* body.theia-editor-highlightModifiedTabs
#theia-main-content-panel .p-TabBar .p-TabBar-tab:not(.p-mod-current).theia-mod-active.theia-mod-dirty {
    border-top: 1px solid var(--g-tab-inactiveModifiedBorder);
}

#theia-main-content-panel .p-TabBar .p-TabBar-tab:not(.p-mod-current).theia-mod-active {
    background: var(--g-tab-inactiveBackground);
    color: var(--g-tab-inactiveForeground);
} */

/* active tab in an unfocused group */
/* body.theia-editor-highlightModifiedTabs
#theia-main-content-panel .p-TabBar .p-TabBar-tab.p-mod-current:not(.theia-mod-active).theia-mod-dirty {
    border-top: 1px solid var(--g-tab-unfocusedActiveModifiedBorder);
}

#theia-main-content-panel .p-TabBar .p-TabBar-tab.p-mod-current:not(.theia-mod-active) {
    background: var(--g-tab-unfocusedActiveBackground);
    color: var(--g-tab-unfocusedActiveForeground);
    border-top: 1px solid var(--g-tab-unfocusedActiveBorderTop);
    border-bottom: 1px solid var(--g-tab-unfocusedActiveBorder);
} */

/* inactive tab in an unfocused group */
/* body.theia-editor-highlightModifiedTabs
#theia-main-content-panel .p-TabBar .p-TabBar-tab:not(.p-mod-current):not(.theia-mod-active).theia-mod-dirty {
    border-top: 1px solid var(--g-tab-unfocusedInactiveModifiedBorder);
}

#theia-main-content-panel .p-TabBar .p-TabBar-tab:not(.p-mod-current):not(.theia-mod-active) {
    background: var(--g-tab-inactiveBackground);
    color: var(--g-tab-inactiveForeground);
}
 */
.p-TabBar.theia-app-centers {
    background: var(--g-editorGroupHeader-tabsBackground);
    border-radius: var(--g-panel-radius) var(--g-panel-radius) 0 0;
    overflow: hidden;
    border: var(--g-border-width) solid var(--g-editor-lineColor);
    border-bottom: none;
}

.p-TabBar.theia-app-centers::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    pointer-events: none;
    background-color: var(--g-editorGroupHeader-tabsBorder);
    width: 100%;
    height: 1px;
}

.p-TabBar.theia-app-centers .p-TabBar-tabIcon,
.p-TabBar.theia-app-centers .p-TabBar-tabLabel,
.p-TabBar.theia-app-centers .p-TabBar-tabLabelDetails,
.p-TabBar.theia-app-centers .p-TabBar-tabCloseIcon {
    display: inline-block;
}

.p-TabBar.theia-app-centers .p-TabBar-tabLabelDetails {
    margin-left: 5px;
    color: var(--g-descriptionForeground);
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
}

.p-TabBar.theia-app-centers .p-TabBar-tabLabelWrapper {
    display: flex;
}

.p-TabBar-tab-secondary-label {
    color: var(--g-settings-headerForeground);
    cursor: pointer;
    font-size: var(--g-ui-font-size0);
    margin-left: 5px;
    text-decoration-line: underline;

    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--g-icon-foreground) 50%), linear-gradient(135deg, var(--g-icon-foreground) 50%, transparent 50%);
    background-position: calc(100% - 6px) 8px, calc(100% - 2px) 8px, 100% 0;
    background-size: 4px 5px;
    background-repeat: no-repeat;
    padding: 2px 14px 0 0;
}

.p-TabBar .p-TabBar-tabIcon,
.p-TabBar-tab.p-mod-drag-image .p-TabBar-tabIcon {
    width: 15px;
    line-height: 1.7;
    font-size: 12px;
    text-align: center;
    background-repeat: no-repeat;
}

.p-TabBar.theia-app-centers .p-TabBar-tabIcon,
.p-TabBar-tab.p-mod-drag-image .p-TabBar-tabIcon {
    min-height: 14px;
    background-size: 13px;
    background-position-y: 3px;
    background: var(--g-icon-foreground);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 13px;
    mask-repeat: no-repeat;
    mask-size: 13px;
    padding-right: calc(var(--g-ui-padding) / 2);
}

.p-TabBar[data-orientation='horizontal'] .p-TabBar-tabIcon.file-icon,
.p-TabBar-tab.p-mod-drag-image .p-TabBar-tabIcon.file-icon {
    /* background: none; */
    padding-bottom: 0px;
    min-height: 20px;
}

.p-TabBar[data-orientation='horizontal'] .p-TabBar-tabIcon.fa,
.p-TabBar-tab.p-mod-drag-image .p-TabBar-tabIcon.fa {
    background: none;
    min-height: 0;
    height: inherit;
}

.p-TabBar.theia-app-centers .p-TabBar-tab.p-mod-closable > .p-TabBar-tabCloseIcon {
    padding-left: 10px;
    height: var(--g-icon-size);
    width: var(--g-icon-size);
    background-size: 13px;
    background-position: center;
    background-repeat: no-repeat;
    background-image: var(--g-icon-close);
}

.p-TabBar.theia-app-centers .p-TabBar-tab.p-mod-closable {
    padding-right: 2px;
}


.p-TabBar.theia-app-centers .p-TabBar-tab.p-mod-closable:hover > .p-TabBar-tabCloseIcon,
.p-TabBar.theia-app-centers .p-TabBar-tab.p-mod-current > .p-TabBar-tabCloseIcon {
    background-image: var(--g-icon-close);
}

.p-TabBar.theia-app-centers .p-TabBar-tab.p-mod-closable.theia-mod-dirty > .p-TabBar-tabCloseIcon {
    background-size: 10px;
    background-image: var(--g-icon-circle);
}

.p-TabBar.theia-app-centers .p-TabBar-tab.p-mod-closable.theia-mod-dirty > .p-TabBar-tabCloseIcon:hover {
    background-size: 13px;
    background-image: var(--g-icon-close);
}

.p-TabBar-tabIcon.no-icon {
    display: none !important;
}

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

.p-TabBar[data-orientation='horizontal'] > .p-TabBar-content-container > .ps__rail-x {
    height: var(--g-private-horizontal-tab-scrollbar-rail-height);
    z-index: 1000;
}

.p-TabBar[data-orientation='horizontal'] > .p-TabBar-content-container > .ps__rail-x > .ps__thumb-x {
    height: var(--g-private-horizontal-tab-scrollbar-height) !important;
    bottom: calc((var(--g-private-horizontal-tab-scrollbar-rail-height) - var(--g-private-horizontal-tab-scrollbar-height)) / 2);
}

.p-TabBar[data-orientation='horizontal'] > .p-TabBar-content-container > .ps__rail-x:hover,
.p-TabBar[data-orientation='horizontal'] > .p-TabBar-content-container > .ps__rail-x:focus {
    height: var(--g-private-horizontal-tab-scrollbar-rail-height) !important;
}

.p-TabBar[data-orientation='horizontal'] > .p-TabBar-content-container > .ps__rail-x:hover > .ps__thumb-x,
.p-TabBar[data-orientation='horizontal'] > .p-TabBar-content-container > .ps__rail-x:focus > .ps__thumb-x {
    height: calc(var(--g-private-horizontal-tab-scrollbar-height) / 2) !important;
    bottom: calc((var(--g-private-horizontal-tab-scrollbar-rail-height) - var(--g-private-horizontal-tab-scrollbar-height)) / 2);
}


/*-----------------------------------------------------------------------------
| Dragged tabs
|----------------------------------------------------------------------------*/

.p-TabBar-tab.p-mod-drag-image {
    transform: translateX(-40%) translateY(-58%);
    opacity: 0.8;
    line-height: var(--g-private-horizontal-tab-height);
    height: var(--g-private-horizontal-tab-height);
    min-height: var(--g-private-horizontal-tab-height);
    padding: 0px 10px;
    font-size: var(--g-ui-font-size1);
    background: var(--g-editorGroupHeader-tabsBackground);
    border: var(--g-border-width) solid var(--g-contrastBorder);
    box-shadow: 1px 1px 2px var(--g-widget-shadow);
    display: flex;
    align-items: center;
}

/*-----------------------------------------------------------------------------
| Tab-bar toolbar
|----------------------------------------------------------------------------*/

.p-TabBar-toolbar {
    z-index: var(--g-tabbar-toolbar-z-index); /* Due to the scrollbar (`z-index: 1000;`) it has a greater `z-index`. */
    display: flex;
    flex-direction: row-reverse;
    padding: 4px;
    padding-left: 0px;
    margin-right: 4px;
}

.p-TabBar-content-container {
    display: flex;
    flex: 1;
    /* border-bottom: var(--g-border-width) solid var(--g-editor-lineColor); */
}

.p-TabBar-toolbar .item {
    display: flex;
    align-items: center;
    margin-left: 8px; /* `padding` + `margin-right` from the container toolbar */
    opacity: var(--g-mod-disabled-opacity);;
    cursor: default;
}

.p-TabBar-toolbar .item.enabled {
    opacity: 1.0;
    cursor: pointer;
}

.p-TabBar-toolbar .item.enabled.active {
    transform: scale(1.272019649);
}

.p-TabBar-toolbar .item > div {
    height: 18px;
    width: 18px;
    background-repeat: no-repeat;
    line-height: 18px;
}

.p-TabBar-toolbar .item .collapse-all {
    background: var(--g-icon-collapse-all) no-repeat;
}

.p-TabBar-toolbar .item .close {
    background: var(--g-icon-collapse-all) no-repeat;
}

.p-TabBar-toolbar .item .clear-all {
    background: var(--g-icon-clear) no-repeat;
}

.p-TabBar-toolbar .item .refresh {
    background: var(--g-icon-refresh) no-repeat;
}

.p-TabBar-toolbar .item .cancel {
    background: var(--g-icon-close) no-repeat;
}
