@use '../shared/styles/details-base';
@use '../shared/styles/utils';

@include utils.dark-theme {
	--gl-color-background-counter: #fff;
}

@include utils.light-theme {
	--gl-color-background-counter: #000;
}

// Vertical split mask for mixed filter mode icon
action-item.filter-mode-mixed::part(icon) {
	-webkit-mask: linear-gradient(
		to right,
		rgba(0, 0, 0, 1) 0%,
		rgba(0, 0, 0, 1) 50%,
		rgba(0, 0, 0, 0.4) 50%,
		rgba(0, 0, 0, 0.4) 100%
	);
	mask: linear-gradient(
		to right,
		rgba(0, 0, 0, 1) 0%,
		rgba(0, 0, 0, 1) 50%,
		rgba(0, 0, 0, 0.4) 50%,
		rgba(0, 0, 0, 0.4) 100%
	);
}

.commit-detail-panel {
	height: 100vh;
	display: flex;
	flex-direction: column;
	gap: 0;
	overflow: auto;
}

main {
	flex: 1 1 auto;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

[hidden] {
	display: none !important;
}

gl-commit-details,
gl-wip-details {
	display: contents;
}

webview-pane-group {
	height: 100%;
	overflow: hidden;
}

.popover-content {
	background-color: var(--color-background--level-15);
	padding: 0.8rem 1.2rem;
}

.inspect-header {
	display: flex;
	flex-direction: row;
	align-items: flex-start; // center;
	justify-content: space-between;
	gap: 0.4rem;
	border-top: 2px solid var(--color-background--level-15);

	&__tabs {
		flex: none;
		display: flex;
		flex-direction: row;
		// gap: -0.8rem;
		align-items: flex-start;
	}

	&__tab {
		position: relative;
		appearance: none;
		background-color: var(--color-background--level-10);
		color: var(--color-foreground--85);
		border: none;
		border-radius: 0 0 0.5rem 0.5rem;
		padding: 0.4rem 1.2rem;
		cursor: pointer;

		&:last-child {
			margin-inline-start: -0.6rem;
		}

		&.is-active {
			z-index: 1;
			background-color: color-mix(in srgb, var(--gl-color-background-counter) 25%, var(--color-background));
			padding-block: 0.6rem;
			box-shadow: 0 -2px 0 0 var(--vscode-button-hoverBackground);
			color: var(--color-foreground);
		}

		&-tracking {
			--gl-pill-foreground: currentColor;
			--gl-pill-border: color-mix(in srgb, transparent 80%, var(--color-foreground));
			margin-inline: 0.2rem -0.4rem;
		}

		&-indicator {
			--gl-indicator-size: 0.46rem;
			position: absolute;
			bottom: 0.825rem;
			left: 2.1rem;
			z-index: 1;

			&--ahead {
				--gl-indicator-color: var(--vscode-gitlens-decorations\.branchAheadForegroundColor);
			}
			&--behind {
				--gl-indicator-color: var(--vscode-gitlens-decorations\.branchBehindForegroundColor);
			}
			&--both {
				--gl-indicator-color: var(--vscode-gitlens-decorations\.branchDivergedForegroundColor);
			}
		}

		&.is-active &-indicator {
			bottom: 1.025rem;
		}

		&-pulse {
			position: absolute;
			bottom: 0.2rem;
			right: 0.4rem;
			z-index: 2;
		}
	}

	&__content {
		flex: 1;
		min-width: 0;
		margin: {
			top: 0.3rem;
			right: 0.3rem;
		}
	}
}

.section--message {
	> :first-child:not(:last-child) {
		margin-bottom: 0.4rem;
	}
}

:root {
	--gl-avatar-size: 1.6rem;
	--gl-patch-ghost-color: var(--color-foreground--50);
}

gl-popover[appearance='menu'] menu-list {
	background: none;
	border: none;
	padding-bottom: 0;
}

.button-group > gl-popover {
	display: inline-flex;
	align-self: stretch;
}

.button-group > gl-popover > gl-button {
	height: 100%;
}

hr {
	border: none;
	border-top: 1px solid var(--color-foreground--25);
}

.md-code {
	background: var(--vscode-textCodeBlock-background);
	border-radius: 3px;
	padding: 0px 4px 2px 4px;
	font-family: var(--vscode-editor-font-family);
}

.inline-popover {
	display: inline-block;
}

.tooltip-hint {
	white-space: nowrap;
	border-bottom: 1px dashed currentColor;
}

.alert {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	width: 100%;
	max-width: 100%;
	margin-block: 0;
	background-color: var(--color-alert-warningBackground);
	border-radius: 0.3rem;
	padding: 0.4rem 0.8rem;
	color: var(--color-alert-warningForeground, var(--vscode-input-foreground));
	border: 1px solid var(--color-alert-warningBorder);

	code-icon {
		flex: none;
		font-size: 1.3rem;
	}

	&__content {
		flex: 1;
		min-width: 0;
		font-size: 1.2rem;
		line-height: 1.4;
		margin: 0;
	}
}
