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

.chat-debug-editor {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* ---- Home view ---- */
.chat-debug-home {
	display: flex;
	flex-direction: column;
	flex: 1;
	overflow: hidden;
}
.chat-debug-home-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 48px 24px;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}
.chat-debug-home-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 8px;
}
.chat-debug-home-subtitle {
	font-size: 13px;
	color: var(--vscode-descriptionForeground);
	margin: 0 0 24px;
}
.chat-debug-home-empty {
	font-size: 13px;
	color: var(--vscode-descriptionForeground);
	margin: 0;
}
.chat-debug-home-session-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	max-width: 400px;
}
.chat-debug-home-session-item {
	display: flex;
	align-items: center;
	width: 100%;
	text-align: left;
	padding: 8px 12px;
	border: 1px solid var(--vscode-widget-border, transparent);
	background: transparent;
	color: var(--vscode-foreground);
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	gap: 8px;
}
.chat-debug-home-session-item:hover {
	background: var(--vscode-list-hoverBackground);
}
.chat-debug-home-session-item:disabled {
	cursor: default;
	opacity: 0.7;
}
.chat-debug-home-session-item:disabled:hover {
	background: transparent;
}
.chat-debug-home-session-item-title {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.chat-debug-home-session-item-shimmer {
	height: 14px;
	min-width: 160px;
	border-radius: 3px;
	background: linear-gradient(
		90deg,
		var(--vscode-descriptionForeground) 25%,
		var(--vscode-chat-thinkingShimmer, rgba(255, 255, 255, 0.3)) 50%,
		var(--vscode-descriptionForeground) 75%
	);
	background-size: 200% 100%;
	animation: chat-debug-shimmer 2s linear infinite;
	opacity: 0.15;
}
.chat-debug-home-session-badge {
	flex-shrink: 0;
	padding: 2px 8px;
	border-radius: 10px;
	background: var(--vscode-badge-background);
	color: var(--vscode-badge-foreground);
	font-size: 11px;
	font-weight: 500;
}

@keyframes chat-debug-shimmer {
	0% { background-position: 120% 0; }
	100% { background-position: -120% 0; }
}

/* ---- Breadcrumb ---- */
.chat-debug-breadcrumb {
	flex-shrink: 0;
	border-bottom: 1px solid var(--vscode-widget-border, transparent);
}
.chat-debug-breadcrumb .monaco-breadcrumbs {
	height: 22px;
}
.chat-debug-breadcrumb .monaco-breadcrumb-item {
	display: flex;
	align-items: center;
	font-size: 12px;
}
.chat-debug-breadcrumb .monaco-breadcrumb-item::before {
	width: 16px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.chat-debug-breadcrumb-item-link {
	cursor: pointer;
}
.chat-debug-breadcrumb .monaco-breadcrumb-item:last-child .codicon:last-child {
	display: none;
}

/* ---- Overview view ---- */
.chat-debug-overview {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	flex: 1;
}
.chat-debug-overview-content {
	padding: 16px 24px;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}
.chat-debug-overview-title-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
}
.chat-debug-overview-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 6px;
}
.chat-debug-overview-title-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}
.chat-debug-overview-section {
	margin-bottom: 24px;
}
.chat-debug-overview-section-label {
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 10px;
	color: var(--vscode-foreground);
}
.chat-debug-overview-metrics {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}
.chat-debug-overview-metric-card {
	border: 1px solid var(--vscode-widget-border, var(--vscode-panel-border));
	border-radius: 4px;
	padding: 12px 16px;
	min-width: 120px;
}
.chat-debug-overview-metric-label {
	font-size: 11px;
	color: var(--vscode-descriptionForeground);
	margin-bottom: 4px;
}
.chat-debug-overview-metric-value {
	font-size: 16px;
	font-weight: 600;
}
.chat-debug-overview-metric-shimmer {
	display: inline-block;
	height: 16px;
	min-width: 48px;
	border-radius: 3px;
	background: linear-gradient(
		90deg,
		var(--vscode-descriptionForeground) 25%,
		var(--vscode-chat-thinkingShimmer, rgba(255, 255, 255, 0.3)) 50%,
		var(--vscode-descriptionForeground) 75%
	);
	background-size: 200% 100%;
	animation: chat-debug-shimmer 2s linear infinite;
	opacity: 0.15;
}
.chat-debug-overview-details {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 6px 16px;
	font-size: 13px;
}
.chat-debug-overview-detail-row {
	display: contents;
}
.chat-debug-overview-detail-label {
	color: var(--vscode-descriptionForeground);
	white-space: nowrap;
}
.chat-debug-overview-detail-value {
	color: var(--vscode-foreground);
}
.chat-debug-overview-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.chat-debug-overview-action-button.monaco-button {
	width: auto;
}
.chat-debug-icon-button.monaco-button {
	width: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	border: none;
	background: transparent;
	color: var(--vscode-foreground);
	border-radius: 4px;
	cursor: pointer;
	opacity: 0.7;
	flex-shrink: 0;
	padding: 0;
}
.chat-debug-icon-button.monaco-button:hover {
	opacity: 1;
	background: var(--vscode-toolbar-hoverBackground);
}
.chat-debug-overview-action-button-primary {
	background: var(--vscode-button-background);
	color: var(--vscode-button-foreground);
}
.chat-debug-overview-action-button-primary:hover {
	background: var(--vscode-button-hoverBackground);
}

/* ---- Logs view ---- */
.chat-debug-logs {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	flex: 1;
}
.chat-debug-editor-header {
	display: flex;
	align-items: center;
	padding: 8px 16px;
	gap: 12px;
	flex-shrink: 0;
}
.chat-debug-editor-header .viewpane-filter-container {
	flex: 1;
	max-width: 500px;
	margin-right: auto;
}
.chat-debug-editor-header .viewpane-filter-container .monaco-inputbox {
	border-color: var(--vscode-panelInput-border, transparent) !important;
}
.chat-debug-view-mode-toggle.monaco-button {
	width: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.chat-debug-troubleshoot-button.monaco-button {
	width: auto;
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}
.chat-debug-view-mode-labels {
	display: grid;
}
.chat-debug-view-mode-label {
	grid-row: 1;
	grid-column: 1;
}
.chat-debug-view-mode-label.hidden {
	visibility: hidden;
}
.chat-debug-table-header {
	display: flex;
	padding: 4px 16px;
	font-weight: 600;
	font-size: 12px;
	border-bottom: 1px solid var(--vscode-widget-border, var(--vscode-panel-border));
	flex-shrink: 0;
	color: var(--vscode-foreground);
	opacity: 0.8;
}
.chat-debug-table-header .chat-debug-col-created {
	width: 160px;
	flex-shrink: 0;
}
.chat-debug-table-header .chat-debug-col-name {
	width: 200px;
	flex-shrink: 0;
}
.chat-debug-table-header .chat-debug-col-details {
	flex: 1;
}
.chat-debug-logs-content {
	display: flex;
	flex-direction: row;
	flex: 1;
	overflow: hidden;
}
.chat-debug-logs-main {
	display: flex;
	flex-direction: column;
	flex: 1;
	overflow: hidden;
}
.chat-debug-logs-body {
	position: relative;
	display: flex;
	flex-direction: row;
	flex: 1;
	overflow: hidden;
}
.chat-debug-list-container {
	flex: 1;
	overflow: hidden;
}
.chat-debug-log-row {
	display: flex;
	align-items: center;
	padding: 0 16px;
	height: 28px;
	font-size: 12px;
}
.chat-debug-log-row .chat-debug-log-created {
	width: 160px;
	flex-shrink: 0;
	color: var(--vscode-descriptionForeground);
}
.monaco-list:focus .monaco-list-row.selected .chat-debug-log-created,
.monaco-list:focus .monaco-list-row.focused .chat-debug-log-created {
	color: inherit;
}
.chat-debug-log-row .chat-debug-log-name {
	width: 200px;
	flex-shrink: 0;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.chat-debug-log-row .chat-debug-log-details {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.chat-debug-log-row.chat-debug-log-error,
.chat-debug-log-row.chat-debug-log-error:hover {
	background-color: var(--vscode-inputValidation-errorBackground, rgba(255, 0, 0, 0.1)) !important;
	color: var(--vscode-errorForeground) !important;
}
.monaco-tl-row:has(.chat-debug-log-row.chat-debug-log-error) {
	background-color: var(--vscode-inputValidation-errorBackground, rgba(255, 0, 0, 0.1)) !important;
}
.chat-debug-log-row.chat-debug-log-warning {
	background-color: var(--vscode-inputValidation-warningBackground, rgba(255, 204, 0, 0.1)) !important;
}
.monaco-tl-row:has(.chat-debug-log-row.chat-debug-log-warning) {
	background-color: var(--vscode-inputValidation-warningBackground, rgba(255, 204, 0, 0.1)) !important;
}
.chat-debug-log-row.chat-debug-log-trace {
	opacity: 0.7;
}
.chat-debug-logs-shimmer-row {
	position: absolute;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	padding: 0 16px;
	height: 28px;
	gap: 40px;
	pointer-events: none;
}
.chat-debug-logs-shimmer-bar {
	flex: 1;
	height: 10px;
	border-radius: 3px;
	background: linear-gradient(
		90deg,
		var(--vscode-descriptionForeground) 25%,
		var(--vscode-chat-thinkingShimmer, rgba(255, 255, 255, 0.3)) 50%,
		var(--vscode-descriptionForeground) 75%
	);
	background-size: 200% 100%;
	animation: chat-debug-shimmer 2s linear infinite;
	opacity: 0.15;
}
.chat-debug-detail-panel {
	flex-shrink: 0;
	width: 350px;
	display: flex;
	flex-direction: column;
	border-left: 1px solid var(--vscode-widget-border, var(--vscode-panel-border));
	border-top: 1px solid var(--vscode-widget-border, var(--vscode-panel-border));
	box-shadow: -6px 0 6px -6px var(--vscode-widget-shadow);
	background: var(--vscode-panel-background);
	font-size: 12px;
	position: relative;
	overflow: hidden;
}
.chat-debug-detail-header {
	display: flex;
	justify-content: flex-end;
	padding: 8px 16px 0;
	flex-shrink: 0;
}
.chat-debug-detail-button.monaco-button {
	width: auto;
	border: none;
	background: transparent;
	color: var(--vscode-foreground);
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	padding: 2px 6px;
	border-radius: 4px;
	opacity: 0.7;
}
.chat-debug-detail-button.monaco-button:hover {
	opacity: 1;
	background: var(--vscode-toolbar-hoverBackground);
}
.chat-debug-detail-content {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}
.chat-debug-detail-panel pre {
	margin: 0;
	padding: 8px 16px;
	white-space: pre-wrap;
	word-break: break-word;
	font-size: 12px;
	user-select: text;
	-webkit-user-select: text;
	cursor: text;
	outline: none;
}
.chat-debug-detail-panel pre:focus {
	outline: 1px solid var(--vscode-focusBorder);
}

/* ---- File List Content ---- */
.chat-debug-file-list {
	padding: 8px 16px;
	font-size: 12px;
	user-select: text;
	-webkit-user-select: text;
}
.chat-debug-file-list-title {
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 4px;
}
.chat-debug-file-list-summary {
	color: var(--vscode-descriptionForeground);
	margin-bottom: 8px;
}
.chat-debug-file-list-section {
	margin-bottom: 8px;
}
.chat-debug-file-list-section-title {
	font-weight: 600;
	margin-bottom: 4px;
	display: flex;
	align-items: center;
	gap: 4px;
}
.chat-debug-file-list-status-icon {
	flex-shrink: 0;
	width: 16px;
	text-align: center;
}
.chat-debug-file-list-status-icon.status-loaded {
	color: var(--vscode-testing-iconPassed, #73c991);
}
.chat-debug-file-list-status-icon.status-skipped {
	color: var(--vscode-descriptionForeground);
}
.chat-debug-file-list-status-icon.status-error {
	color: var(--vscode-testing-iconFailed, #f14c4c);
}
.chat-debug-file-list-row {
	display: flex;
	align-items: center;
	padding: 2px 4px;
	gap: 4px;
	overflow: hidden;
}
.chat-debug-file-list-row .chat-inline-anchor-widget {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex-shrink: 0;
}
.chat-debug-file-list-group-header {
	margin-top: 4px;
	padding: 2px 4px;
	color: var(--vscode-descriptionForeground);
}
.chat-debug-file-list-group-header:first-child {
	margin-top: 0;
}
.chat-debug-file-list-group-label {
	font-weight: 600;
	font-size: 11px;
}
.chat-debug-file-list-icon {
	flex-shrink: 0;
	width: 16px;
	text-align: center;
}
.chat-debug-file-link {
	color: var(--vscode-textLink-foreground);
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.chat-debug-file-link:hover {
	text-decoration: underline;
	color: var(--vscode-textLink-activeForeground);
}
.chat-debug-file-list-badge {
	color: var(--vscode-descriptionForeground);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex-shrink: 1;
	min-width: 0;
}
.chat-debug-file-list-detail {
	color: var(--vscode-descriptionForeground);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex-shrink: 1;
	min-width: 0;
}

/* ---- Message Content (User Message / Agent Response) ---- */
.chat-debug-message-content {
	padding: 8px 16px;
	font-size: 12px;
	user-select: text;
	-webkit-user-select: text;
	outline: none;
}
.chat-debug-message-content:focus {
	outline: 1px solid var(--vscode-focusBorder);
}
.chat-debug-message-content-title {
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 4px;
}
.chat-debug-message-content-summary {
	color: var(--vscode-descriptionForeground);
	margin-bottom: 8px;
	white-space: pre-wrap;
	word-break: break-word;
}
.chat-debug-message-sections {
	margin-top: 4px;
}
.chat-debug-message-sections-label {
	font-weight: 600;
	margin-bottom: 4px;
}
.chat-debug-message-section {
	margin-bottom: 4px;
	border: 1px solid var(--vscode-widget-border, transparent);
	border-radius: 4px;
	overflow: hidden;
}
.chat-debug-message-section-header {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	background: var(--vscode-editorWidget-background);
	border-radius: 3px;
	user-select: none;
	font-weight: 600;
	color: var(--vscode-foreground);
	cursor: pointer;
}
.chat-debug-message-section-header:hover {
	background: var(--vscode-list-hoverBackground);
}
.chat-debug-message-section-chevron {
	flex-shrink: 0;
	width: 16px;
	text-align: center;
}
.chat-debug-message-section-title {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.chat-debug-message-section-content-wrapper {
	border-top: 1px solid var(--vscode-widget-border, transparent);
	max-height: 300px;
	overflow-y: auto;
}
.chat-debug-message-section-content {
	margin: 0;
	padding: 8px 12px;
	white-space: pre-wrap;
	word-break: break-word;
	font-size: 12px;
	font-family: var(--vscode-chat-font-family, monospace);
	background: transparent;
	outline: none;
}
.chat-debug-message-section-content:focus {
	outline: 1px solid var(--vscode-focusBorder);
}

/* ---- File list: inline file link ---- */
.chat-debug-file-list-row a.chat-inline-anchor-widget {
	cursor: pointer;
}

/* ---- File list: settings gear button ---- */
.chat-debug-settings-gear.monaco-button {
	flex-shrink: 0;
	opacity: 0.7;
	border-radius: 3px;
	padding: 2px;
	background: none;
	border: none;
	color: inherit;
	min-width: auto;
}
.chat-debug-settings-gear.monaco-button:hover {
	opacity: 1;
	background: var(--vscode-toolbar-hoverBackground);
}
.chat-debug-settings-gear-header-passthrough {
	pointer-events: none;
}
.chat-debug-settings-gear-header-passthrough .chat-debug-settings-gear {
	pointer-events: auto;
}

/* ---- File list: source folder section ---- */
.chat-debug-source-folder-content {
	padding: 8px 12px;
	border-top: 1px solid var(--vscode-widget-border, transparent);
}
.chat-debug-source-folder-note {
	margin-bottom: 4px;
}
.chat-debug-source-folder-row {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	padding: 1px 0;
}
.chat-debug-source-folder-index {
	color: var(--vscode-descriptionForeground);
	flex-shrink: 0;
	min-width: 16px;
	text-align: right;
}
.chat-debug-source-folder-label {
	word-break: break-all;
}

/* ---- File list: location badge link ---- */
.chat-debug-file-list-badge-link {
	cursor: pointer;
}

/* ---- Flow chart view ---- */
.chat-debug-flowchart {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	flex: 1;
}
.chat-debug-flowchart-content-wrapper {
	display: flex;
	flex: 1;
	overflow: hidden;
}
.chat-debug-flowchart-content {
	flex: 1;
	overflow: hidden;
	position: relative;
	cursor: grab;
	background: var(--vscode-editor-background);
}
.chat-debug-flowchart-content:active {
	cursor: grabbing;
}
.chat-debug-flowchart-svg-wrapper {
	transform-origin: 0 0;
	position: absolute;
	top: 0;
	left: 0;
}
.chat-debug-flowchart-svg {
	display: block;
}
.chat-debug-flowchart-node rect {
	transition: opacity 0.15s;
}
.chat-debug-flowchart-node:hover rect:first-child {
	opacity: 0.85;
}
.chat-debug-flowchart-subgraph-header {
	cursor: pointer;
}
.chat-debug-flowchart-subgraph:hover rect.chat-debug-flowchart-subgraph-header {
	opacity: 0.25;
}
.chat-debug-flowchart-focus-ring {
	display: none;
}
.chat-debug-flowchart-node:focus,
.chat-debug-flowchart-node:focus-visible {
	outline: none !important;
}
.chat-debug-flowchart-node:focus .chat-debug-flowchart-focus-ring {
	display: inline;
}
.chat-debug-flowchart-subgraph-header:focus {
	outline: 2px solid var(--vscode-focusBorder);
	outline-offset: 2px;
}
.chat-debug-flowchart-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 13px;
	color: var(--vscode-descriptionForeground);
}
.chat-debug-flowchart-show-more {
	display: flex;
	justify-content: center;
	margin: 12px 0 0;
}
