/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

.session-changes-editor {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--vscode-editor-background);
	color: var(--vscode-agentsPanel-foreground);
}

.session-changes-editor-body {
	position: relative;
}

.session-changes-editor-empty-state {
	position: absolute;
	inset: 0;
	align-items: center;
	justify-content: center;
}

.session-changes-editor-empty-state:not([hidden]) {
	display: flex;
}

.session-changes-editor-body.has-empty-state .multiDiffEditor .placeholder {
	display: none;
}

.session-changes-file-stats {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: var(--vscode-spacing-size40);
	margin-left: var(--vscode-spacing-size60);
	font-size: var(--vscode-fontSize-body2);
}

.session-changes-file-stats .working-set-lines-added {
	color: var(--vscode-chat-linesAddedForeground);
}

.session-changes-file-stats .working-set-lines-removed {
	color: var(--vscode-chat-linesRemovedForeground);
}

.monaco-action-bar .checkbox-action-item.changeset-review-action {
	display: flex;
	align-items: center;
	height: var(--vscode-spacing-size200);
	padding: 0 var(--vscode-spacing-size40);
	cursor: pointer;
	color: var(--vscode-foreground);
	border: var(--vscode-strokeThickness) solid var(--vscode-toolbar-hoverBackground);
	border-radius: var(--vscode-cornerRadius-small);
}

.changeset-review-action.checked {
	background: var(--vscode-actionBar-toggledBackground);
}

.changeset-review-action .checkbox-label {
	font-size: var(--vscode-fontSize-body2);
	line-height: var(--vscode-spacing-size200);
	white-space: nowrap;
	cursor: pointer;
}

.changeset-review-action.disabled {
	cursor: default;
	opacity: 0.5;
}

.changeset-review-action.disabled .checkbox-label {
	cursor: default;
}

.session-changes-editor-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 35px;
	min-height: 35px;
	min-width: 0;
	padding: 0 var(--vscode-spacing-size80);
	gap: var(--vscode-spacing-size80);
}

.session-changes-editor-header-left,
.session-changes-editor-header-right {
	display: flex;
	align-items: center;
	overflow: hidden;
	min-width: 0;
}

.session-changes-editor-header-left {
	flex: 1 1 auto;
	gap: var(--vscode-spacing-size40);
}

.session-changes-editor-header-left > .monaco-toolbar,
.session-changes-editor-header-left .monaco-action-bar,
.session-changes-editor-header-left .actions-container,
.session-changes-editor-header-left .action-item {
	min-width: 0;
	max-width: 100%;
}

.session-changes-editor-header-left > .monaco-toolbar:first-child {
	flex: 0 1 auto;
}

.session-changes-editor-header-left > .monaco-toolbar:last-child {
	flex: 1 1 auto;
}

.session-changes-editor-header-left .action-label > span:not(.codicon) {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.session-changes-editor-header-left .action-label {
	font-size: var(--vscode-fontSize-label1);
	align-items: center;
	min-width: 0;
	max-width: 100%;

	> span {
		margin-left: 2px;
	}

	> .codicon {
		font-size: var(--vscode-codiconFontSize-compact) !important;
		padding-left: var(--vscode-spacing-size40);
		width: 12px;
		height: 12px;
		flex-shrink: 0;
	}
}

.changes-picker-action-rich {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 100%;
}

.changes-picker-action-rich > .monaco-dropdown,
.changes-picker-action-rich > .monaco-dropdown > .dropdown-label {
	min-width: 0;
	max-width: 100%;
}

.changes-picker-action-rich .action-label {
	display: inline-flex;
	align-items: center;
	gap: var(--vscode-spacing-size40);
	min-width: 0;
	max-width: 100%;
	font-size: var(--vscode-fontSize-label1);
}

.changes-picker-action-with-summary .action-label {
	box-sizing: border-box;
	padding: var(--vscode-spacing-size20) var(--vscode-spacing-size60);
	background-color: var(--vscode-commandCenter-background);
	color: var(--vscode-commandCenter-foreground);
	border-radius: var(--vscode-cornerRadius-small);
}

.changes-picker-action-with-summary .action-label > .codicon {
	color: var(--vscode-commandCenter-foreground);
}

:is(.hc-black, .hc-light) .changes-picker-action-with-summary .action-label {
	border: var(--vscode-strokeThickness) solid var(--vscode-contrastBorder);
}

.changes-picker-action-with-summary .action-label:focus-visible {
	outline: var(--vscode-strokeThickness) solid var(--vscode-focusBorder);
	outline-offset: calc(-1 * var(--vscode-strokeThickness));
}

.changes-picker-action-rich .changes-picker-label {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.changes-picker-action-rich .changes-picker-label.non-default {
	font-weight: var(--vscode-fontWeight-semiBold);
}

.changes-picker-action-rich .changes-picker-summary {
	display: inline-flex;
	align-items: center;
	gap: var(--vscode-spacing-size40);
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.changes-picker-action-rich .changes-picker-separator {
	color: var(--vscode-descriptionForeground);
	flex-shrink: 0;
}

.changes-picker-action-rich .action-label > .codicon {
	font-size: var(--vscode-codiconFontSize-compact) !important;
	width: auto;
	height: auto;
	padding-left: 0;
	flex-shrink: 0;
}

.session-changes-editor-header-right {
	flex: 0 2 auto;
	min-width: 0;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: var(--vscode-spacing-size40);
}

.session-changes-editor-header-right .monaco-button,
.session-changes-editor-header-right .monaco-button-dropdown,
.session-changes-editor-header-right .monaco-button-dropdown > .monaco-button {
	width: auto;
	min-width: 0;
}

.session-changes-editor-header-right .monaco-button {
	height: 26px;
	padding: var(--vscode-spacing-size40) var(--vscode-spacing-size80);
	box-sizing: border-box;
	font-size: var(--vscode-fontSize-label1);
	line-height: 18px;
	white-space: nowrap;
}

.session-changes-editor-header-right > .monaco-button,
.session-changes-editor-header-right > .monaco-button-dropdown {
	flex: 0 1 auto;
}

.session-changes-editor-header-right > .monaco-button.secondary,
.session-changes-editor-header-right > .monaco-button-dropdown > .monaco-button.secondary.monaco-text-button {
	flex: 0 0 auto;
}

.session-changes-editor-header-right .monaco-button-dropdown {
	display: flex;
	align-items: center;
	height: 26px;
	overflow: hidden;
}

.session-changes-editor-header-right .monaco-button > span:not(.codicon) {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.session-changes-editor-header-right .monaco-button-dropdown > .monaco-button-dropdown-separator {
	flex: 0 0 auto;
	margin: 0;
}

.session-changes-editor-header-right .monaco-button-dropdown > .monaco-button:not(.monaco-dropdown-button) {
	flex: 1 1 auto;
	overflow: hidden;
}

.session-changes-editor-header-right .monaco-button-dropdown > .monaco-button.monaco-dropdown-button {
	flex: 0 0 auto;
	padding: var(--vscode-spacing-size40);
	min-width: 0;
	border-radius: 0 var(--vscode-cornerRadius-small) var(--vscode-cornerRadius-small) 0;
}

.session-changes-editor-header-right .monaco-button.secondary.monaco-text-button.codicon {
	flex: 0 0 auto;
	padding: var(--vscode-spacing-size20) var(--vscode-spacing-size60);
	font-size: var(--vscode-codiconFontSize) !important;
}

/* Compact the ChangesActionsBar buttons so the changes-editor header stays compact
 * without extra padding. The toolbar action-item override below applies in the title bar. */
.changes-actions-bar .monaco-button,
.changes-actions-bar .monaco-button-dropdown {
	height: 22px;
	box-sizing: border-box;
}

/* Scope title-bar normalization to the toolbar action item so the classic internal
 * changes-editor header and the auxiliary-bar Changes view are left untouched. */
.monaco-action-bar .action-item.changes-actions-bar {
	display: flex;
	align-items: center;
	gap: var(--vscode-spacing-size40);
	min-width: 0;
	margin-left: var(--vscode-spacing-size20);
	margin-right: var(--vscode-spacing-size20);
}

/* Normalize the button bar height for the title bar without affecting the classic header. */
.monaco-action-bar .action-item.changes-actions-bar .monaco-button,
.monaco-action-bar .action-item.changes-actions-bar .monaco-button-dropdown {
	height: 22px;
	min-height: 22px;
	padding-block: 0;
}

.monaco-action-bar .action-item.changes-actions-bar .monaco-button-dropdown {
	display: flex;
	min-width: 0;
	max-width: 100%;
}

.monaco-action-bar .action-item.changes-actions-bar .monaco-button:not(.monaco-dropdown-button) {
	flex: 1 1 auto;
	flex-wrap: wrap;
	min-width: 0;
	overflow: hidden;
}

.monaco-action-bar .action-item.changes-actions-bar .monaco-button-dropdown > .monaco-button-dropdown-separator,
.monaco-action-bar .action-item.changes-actions-bar .monaco-button-dropdown > .monaco-button.monaco-dropdown-button {
	flex: 0 0 auto;
}

.monaco-action-bar .action-item.changes-actions-bar .monaco-button > span:not(.codicon) {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* The generic actionbar rule `.monaco-action-bar .action-item .codicon { width:
 * 16px; height: 16px }` clamps every codicon — including the button elements
 * themselves (which carry the `codicon` class), squashing the secondary icon
 * buttons and detaching the split-button chevron. Un-clamp them (higher
 * specificity than the base rule) so the buttons size to their own content.
 * A button's leading icon is exempt: it shares its box with the spinner that
 * replaces it while the action runs, so the button bar owns its sizing. */
.monaco-action-bar .action-item.changes-actions-bar .codicon:not(.monaco-button-leading-icon) {
	width: auto;
	height: 20px;
	flex-shrink: 0;
	color: var(--vscode-button-foreground) !important;
}

.session-changes-editor-body {
	position: relative;
	flex: 1;
	min-height: 0;
}

.session-changes-editor-body .multiDiffEditor-card .multiDiffEntry.first-diff-entry > .header:not(.shadow) > .header-content {
	margin-top: 0;
	height: calc(var(--vscode-spacing-size320) + var(--vscode-spacing-size40));
}
