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

.interactive-session {
	max-width: 850px;
	margin: auto;
}

.interactive-list > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row > .monaco-tl-row > .monaco-tl-twistie {
	/* Hide twisties from chat tree rows, but not from nested trees within a chat response */
	display: none !important;
}

.interactive-item-container {
	padding: 16px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	color: var(--vscode-interactive-session-foreground);

	cursor: default;
	user-select: text;
	-webkit-user-select: text;
}

.interactive-item-container .header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
}

.interactive-item-container .header.hidden {
	display: none;
}

.interactive-item-container .header .user {
	display: flex;
	align-items: center;
	gap: 6px;
}

.interactive-item-container .header .username {
	margin: 0;
	font-size: 12px;
	font-weight: 600;
}

.interactive-item-container .header .detail-container {
	font-size: 0.9em;
	opacity: 0.7;
}

.interactive-item-container .chat-animated-ellipsis {
	display: inline-block;
	width: 11px;
}

.interactive-item-container:not(.show-detail-progress) .chat-animated-ellipsis {
	display: none;
}

@keyframes ellipsis {
	0% {
		content: "";
	}
	25% {
		content: ".";
	}
	50% {
		content: "..";
	}
	75% {
		content: "...";
	}
	100% {
		content: "";
	}
}

.interactive-item-container .chat-animated-ellipsis::after {
	content: '';
	white-space: nowrap;
	overflow: hidden;
	width: 3em;
	animation: ellipsis steps(4, end) 1s infinite;
}

.interactive-item-container .header .avatar-container {
	display: flex;
	pointer-events: none;
	user-select: none;
}

.interactive-item-container .header .avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	outline: 1px solid var(--vscode-chat-requestBorder);
}

.interactive-item-container .header .avatar.codicon-avatar {
	background: var(--vscode-chat-avatarBackground);
}

.interactive-item-container .header .avatar+.avatar {
	margin-left: -8px;
}

.interactive-item-container .header .avatar .icon {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background-color: var(--vscode-chat-list-background);
}

.interactive-item-container .header .avatar .codicon {
	color: var(--vscode-chat-avatarForeground) !important;
	font-size: 14px;
}

.interactive-item-container .header .agent-avatar-container {
	margin-left: -30px;
	transition: margin 0.15s ease-out;
	transition-delay: 0.5s;
	z-index: -1;
}

.interactive-item-container .header .agent-avatar-container.loading {
	margin-left: 0px;
	z-index: 1;
}

.interactive-item-container .header .agent-avatar-container.complete {
	margin-left: -12px;
	z-index: 1;
}

.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar,
.monaco-list:not(:focus-within) .monaco-list-row .interactive-item-container:not(:hover) .header .monaco-toolbar,
.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar .action-label,
.monaco-list:not(:focus-within) .monaco-list-row .interactive-item-container:not(:hover) .header .monaco-toolbar .action-label {
	/* Also apply this rule to the .action-label directly to work around a strange issue- when the
	toolbar is hidden without that second rule, tabbing from the list container into a list item doesn't work
	and the tab key doesn't do anything. */
	display: none;
}

.interactive-item-container .header .monaco-toolbar .monaco-action-bar .actions-container {
	gap: 4px;
}

.interactive-item-container .header .monaco-toolbar .action-label {
	border: 1px solid transparent;
	padding: 2px;
}

.interactive-item-container .header .monaco-toolbar {
	position: absolute;
	right: 0px;
	background-color: var(--vscode-chat-list-background);
}

.interactive-item-container.interactive-request .header .monaco-toolbar {
	/* Take the partially-transparent background color override for request rows */
	background-color: inherit;
}

.interactive-item-container .header .monaco-toolbar .checked.action-label,
.interactive-item-container .header .monaco-toolbar .checked.action-label:hover {
	color: var(--vscode-inputOption-activeForeground) !important;
	border-color: var(--vscode-inputOption-activeBorder);
	background-color: var(--vscode-inputOption-activeBackground);
}

.interactive-item-container .value {
	width: 100%;
}

.interactive-item-container .value .rendered-markdown table {
	width: 100%;
	text-align: left;
	margin-bottom: 16px;
}

.interactive-item-container .value .rendered-markdown table,
.interactive-item-container .value .rendered-markdown table td,
.interactive-item-container .value .rendered-markdown table th {
	border: 1px solid var(--vscode-chat-requestBorder);
	border-collapse: collapse;
	padding: 4px 6px;
}

.interactive-item-container .value .rendered-markdown a,
.interactive-item-container .value .interactive-session-followups,
.interactive-item-container .value .rendered-markdown a code {
	color: var(--vscode-textLink-foreground);
}

.interactive-item-container .value .rendered-markdown a:hover,
.interactive-item-container .value .rendered-markdown a:active {
	color: var(--vscode-textLink-activeForeground);
}

.hc-black .interactive-item-container .value .rendered-markdown a code,
.hc-light .interactive-item-container .value .rendered-markdown a code {
	color: var(--vscode-textPreformat-foreground);
}

.interactive-list {
	overflow: hidden;
}

.interactive-request {
	border-bottom: 1px solid var(--vscode-chat-requestBorder);
	border-top: 1px solid var(--vscode-chat-requestBorder);
	background-color: var(--vscode-chat-requestBackground);
}

.hc-black .interactive-request,
.hc-light .interactive-request {
	border-left: 3px solid var(--vscode-chat-requestBorder);
	border-right: 3px solid var(--vscode-chat-requestBorder);
}

.interactive-item-container .value {
	white-space: normal;
	word-wrap: break-word;
}

.interactive-item-container .value > :last-child.rendered-markdown > :last-child {
	margin-bottom: 0px;
}

.interactive-item-container .value .rendered-markdown h1 {
	font-size: 20px;
	font-weight: 600;
	margin: 16px 0;

}

.interactive-item-container .value .rendered-markdown h2 {
	font-size: 16px;
	font-weight: 600;
	margin: 16px 0;
}

.interactive-item-container .value .rendered-markdown h3 {
	font-size: 14px;
	font-weight: 600;
	margin: 16px 0;
}

.interactive-item-container .value .rendered-markdown p {
	margin: 0 0 16px 0;
	line-height: 1.5em;
}

.interactive-item-container .value .rendered-markdown ul {
	padding-inline-start: 24px;
}

.interactive-item-container .value .rendered-markdown ol {
	padding-inline-start: 28px;
}

.interactive-item-container .value .rendered-markdown li {
	line-height: 1.3rem;
}

.interactive-item-container .monaco-tokenized-source,
.interactive-item-container code {
	font-family: var(--monaco-monospace-font);
	font-size: 12px;
	color: var(--vscode-textPreformat-foreground);
	background-color: var(--vscode-textPreformat-background);
	padding: 1px 3px;
	border-radius: 4px;
}

.interactive-item-container.interactive-item-compact {
	padding: 8px 20px;
}

.interactive-item-container.interactive-item-compact.no-padding {
	padding: unset;
	gap: unset;
}

.interactive-item-container.interactive-item-compact .header {
	height: 16px;
}

.interactive-item-container.interactive-item-compact .header .avatar {
	width: 18px;
	height: 18px;
}

.interactive-item-container.interactive-item-compact .header .avatar .icon {
	width: 16px;
	height: 16px;
}

.interactive-item-container.interactive-item-compact .header .codicon-avatar .codicon {
	font-size: 12px;
}

.interactive-item-container.interactive-item-compact .header .avatar+.avatar {
	margin-left: -4px;
}

.interactive-item-container.interactive-item-compact .value {
	min-height: 0;
}

.interactive-item-container.interactive-item-compact .value .rendered-markdown p {
	margin: 0 0 8px 0;
}

.interactive-item-container.interactive-item-compact .value .rendered-markdown h1 {
	margin: 8px 0;

}

.interactive-item-container.interactive-item-compact .value .rendered-markdown h2 {
	margin: 8px 0;
}

.interactive-item-container.interactive-item-compact .value .rendered-markdown h3 {
	margin: 8px 0;
}

.interactive-item-container.interactive-item-compact .value .rendered-markdown p {
	margin: 0 0 8px 0;
}

.interactive-session .interactive-input-and-execute-toolbar {
	display: flex;
	box-sizing: border-box;
	cursor: text;
	background-color: var(--vscode-input-background);
	border: 1px solid var(--vscode-input-border, transparent);
	border-radius: 4px;
	position: relative;
	padding: 0 6px;
	margin-bottom: 4px;
	align-items: flex-end;
	justify-content: space-between;
}

.interactive-session .interactive-input-part.compact .interactive-input-and-execute-toolbar {
	margin-bottom: 0;
}

.interactive-session .interactive-input-and-side-toolbar {
	display: flex;
	gap: 4px;
	align-items: center;
}

.interactive-session .interactive-input-and-execute-toolbar.focused {
	border-color: var(--vscode-focusBorder);
}

.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .mtk1 {
	color: var(--vscode-input-foreground);
}

.interactive-session .interactive-input-and-execute-toolbar .monaco-editor,
.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .monaco-editor-background {
	background-color: var(--vscode-input-background) !important;
}

.interactive-session .interactive-input-and-execute-toolbar .monaco-editor .cursors-layer {
	padding-left: 4px;
}

.interactive-session .interactive-input-part .interactive-execute-toolbar {
	height: 22px;

	/* It's bottom-aligned, make it appear centered within the container */
	margin-bottom: 7px;
}

.interactive-session .interactive-input-part .interactive-execute-toolbar .monaco-action-bar .actions-container {
	display: flex;
	gap: 4px;
}

.interactive-session .interactive-input-part .interactive-execute-toolbar .codicon-debug-stop {
	color: var(--vscode-icon-foreground) !important;
}

.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor,
.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor .margin,
.interactive-response .interactive-result-code-block .interactive-result-editor .monaco-editor .monaco-editor-background {
	background-color: var(--vscode-interactive-result-editor-background-color) !important;
}

.interactive-item-compact .interactive-result-code-block {
	margin: 0 0 8px 0;
}

.interactive-item-container .interactive-result-code-block .monaco-toolbar .monaco-action-bar .actions-container {
	padding-inline-start: unset;
}

.interactive-response .interactive-response-error-details {
	display: flex;
	align-items: start;
	gap: 6px;
}

.interactive-response .interactive-response-error-details .rendered-markdown :last-child {
	margin-bottom: 0px;
}

.interactive-response .interactive-response-error-details .codicon {
	margin-top: 1px;
}

.interactive-response .interactive-response-error-details .codicon-error {
	color: var(--vscode-errorForeground) !important; /* Have to override default styles which apply to all lists */
}

.interactive-response .interactive-response-error-details .codicon-info {
	color: var(--vscode-notificationsInfoIcon-foreground) !important; /* Have to override default styles which apply to all lists */
}

.interactive-session .interactive-input-part {
	margin: 0px 20px;
	padding: 12px 0px;
	display: flex;
	flex-direction: column;
}

.interactive-session .interactive-input-part.compact {
	margin: 0;
	padding: 6px 0px;
}

.interactive-session .chat-implicit-context {
	padding: 8px 8px 13px;
	margin-bottom: -5px;
	border: 1px solid var(--vscode-input-border, var(--vscode-input-background, transparent));
	border-radius: 6px 6px 0px 0px;
}

.interactive-session-followups {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: start;
}

.interactive-session-followups .monaco-button {
	text-align: left;
	width: initial;
}

.interactive-session-followups .monaco-button .codicon {
	margin-left: 0;
	margin-top: 1px;
}

.interactive-item-container .interactive-response-followups .monaco-button {
	padding: 4px 8px;
}

.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups {
	margin-bottom: 8px;
}

.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups .monaco-button {
	display: block;
	color: var(--vscode-textLink-foreground);
	font-size: 12px;
}

.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups code {
	font-family: var(--monaco-monospace-font);
	font-size: 11px;
}

.interactive-session .interactive-input-part .interactive-input-followups .interactive-session-followups .monaco-button .codicon-sparkle {
	float: left;
}

.interactive-session-followups .monaco-button.interactive-followup-reply {
	padding: 0px;
	border: none;
}

.interactive-welcome .value .interactive-session-followups {
	margin-bottom: 16px;
}

.interactive-item-container .monaco-toolbar .codicon {
	/* Very aggressive list styles try to apply focus colors to every codicon in a list row. */
	color: var(--vscode-icon-foreground) !important;
}

.interactive-item-container.filtered-response .value > .rendered-markdown {
	pointer-events: none;
	-webkit-mask-image: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.05) 60%, rgba(0, 0, 0, 0.00) 80%);
	mask-image: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.05) 60%, rgba(0, 0, 0, 0.00) 80%);
}

/* #region Quick Chat */

.quick-input-widget .interactive-session .interactive-input-part {
	padding: 8px 6px 6px 6px;
	margin: 0 3px;
}

.quick-input-widget .interactive-session .interactive-input-part .interactive-execute-toolbar {
	margin-bottom: 1px;
}

.quick-input-widget .interactive-session .interactive-input-and-execute-toolbar {
	margin: 0;
	border-radius: 2px;
	padding: 0 4px 0 6px;
}

.quick-input-widget .interactive-list {
	border-bottom-right-radius: 6px;
	border-bottom-left-radius: 6px;
}

.quick-input-widget .interactive-response {
	min-height: 86px;
}

/* #endregion */

.interactive-response-progress-tree .monaco-list-row:not(.selected) .monaco-tl-row:hover {
	background-color: var(--vscode-list-hoverBackground);
}

.interactive-response-progress-tree {
	margin: 16px 0px;
}

.interactive-response-progress-tree.focused {
	border-color: var(--vscode-focusBorder, transparent);
}

.interactive-item-container .value .interactive-response-placeholder-codicon .codicon {
	color: var(--vscode-editorGhostText-foreground);
}

.interactive-item-container .value .interactive-response-placeholder-content {
	color: var(--vscode-editorGhostText-foreground);
	font-size: 12px;
	margin-bottom: 16px;
}

.interactive-item-container .value .interactive-response-placeholder-content p {
	margin: 0;
}

.interactive-response  .interactive-response-codicon-details {
	display: flex;
	align-items: start;
	gap: 6px;
}

.chat-used-context-list .monaco-list {
	border: none;
	border-radius: 4px;
	width: auto;
}

.interactive-item-container .chat-resource-widget {
	background-color: var(--vscode-chat-slashCommandBackground);
	color: var(--vscode-chat-slashCommandForeground);
	border-radius: 4px;
	white-space: nowrap;
	padding: 1px 3px;
}

.interactive-session .chat-used-context.chat-used-context-collapsed .chat-used-context-list {
	display: none;
}

.interactive-session .chat-used-context {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.interactive-response-progress-tree,
.interactive-session .chat-used-context-list {
	border: 1px solid var(--vscode-chat-requestBorder);
	border-radius: 4px;
	margin-bottom: 8px;
	padding: 4px;
}

.interactive-session .chat-used-context-list .monaco-list .monaco-list-row {
	border-radius: 2px;
}

.interactive-session .chat-used-context-label {
	font-size: 12px;
	color: var(--vscode-foreground);
	opacity: 0.8;
	user-select: none;
}

.interactive-session .chat-used-context-label:hover {
	opacity: unset;
}

.interactive-session .chat-used-context-label .monaco-button {
	/* unset Button styles */
	display: inline-flex;
	width: 100%;
	border: none;
	padding: 0;
	text-align: initial;
	justify-content: initial;
}

.interactive-session .chat-used-context-label .monaco-text-button:focus {
	outline: none;
}

.interactive-session .chat-used-context-label .monaco-text-button:focus-visible {
	outline: 1px solid var(--vscode-focusBorder);
}

.interactive-session .chat-used-context .chat-used-context-label .monaco-button .codicon {
	margin: 0 0 0 4px;
}

.interactive-item-container .rendered-markdown.progress-step {
	display: flex;
	margin-left: 4px;
	white-space: normal;
}

.interactive-item-container .rendered-markdown.progress-step > p {
	color: var(--vscode-descriptionForeground);
	font-size: 12px;
	display: flex;
	gap: 5px;
	align-items: center;
	margin-bottom: 4px;
}

.interactive-item-container .rendered-markdown.progress-step > p .codicon {
	/* Very aggressive list styles try to apply focus colors to every codicon in a list row. */
	color: var(--vscode-icon-foreground) !important;
}

.interactive-item-container .rendered-markdown.progress-step > p .codicon.codicon-check {
	color: var(--vscode-debugIcon-startForeground) !important;
}

.interactive-item-container .chat-command-button {
	display: flex;
	margin-bottom: 16px;
}

.interactive-item-container .chat-command-button .monaco-button {
	text-align: left;
	width: initial;
	padding: 4px 8px;
}

.interactive-item-container .chat-command-button .monaco-button .codicon {
	margin-left: 0;
	margin-top: 1px;
}
