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

.browser-root {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;

	.browser-toolbar {
		display: flex;
		align-items: center;
		padding: 6px 8px;
		border-bottom: 1px solid var(--vscode-widget-border);
		background-color: var(--vscode-editor-background);
		flex-shrink: 0;
		gap: 8px;
	}

	.browser-nav-toolbar,
	.browser-actions-toolbar {
		display: flex;
		align-items: center;
		flex-shrink: 0;
	}

	.browser-url-input {
		flex: 1;
		padding: 4px 8px;
		background-color: var(--vscode-input-background);
		color: var(--vscode-input-foreground);
		border: 1px solid var(--vscode-input-border);
		border-radius: 2px;
		outline: none;
		font-size: 13px;

		&:focus {
			border-color: var(--vscode-focusBorder);
		}
	}

	.browser-container {
		flex: 1;
		min-height: 0;
		margin: 0 2px 2px;
		overflow: hidden;
		position: relative;
		outline: none !important;
	}

	.browser-placeholder-screenshot {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-image: none;
		background-size: contain;
		background-repeat: no-repeat;
	}

	.browser-overlay-paused {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		pointer-events: none;
		color: var(--vscode-foreground);
		background-color: color-mix(in srgb, var(--vscode-editor-background) 15%, transparent);
		opacity: 0;
		visibility: hidden;
		transition: opacity 200ms ease-in;

		&.visible {
			opacity: 1;
			visibility: visible;
		}

		&.show-message {
			background-color: color-mix(in srgb, var(--vscode-editor-background) 60%, transparent);
		}
	}

	.browser-overlay-paused-message {
		padding: 20px 40px;
		border-radius: 4px;
		border: 1px solid var(--vscode-editorWidget-border);
		background-color: var(--vscode-editor-background);
		box-shadow: 0 2px 8px var(--vscode-widget-shadow);
		max-width: 80%;
		text-align: center;
		display: none;
	}

	.browser-overlay-paused.show-message .browser-overlay-paused-message {
		display: block;
	}

	.browser-overlay-paused-heading {
		font-size: 18px;
		font-weight: 600;
		margin-bottom: 8px;
	}

	.browser-overlay-paused-detail {
		font-size: 14px;
		color: var(--vscode-descriptionForeground);
	}

	.browser-error-container {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		flex: 1;
		display: flex;
		align-items: flex-start;
		justify-content: flex-start;
		padding: 80px 40px;
		margin: 0 2px 2px;
		background-color: var(--vscode-editor-background);
	}

	.browser-error-content {
		max-width: 600px;
		width: 100%;
	}

	.browser-error-title {
		font-size: 18px;
		font-weight: 600;
		color: var(--vscode-errorForeground);
		margin-bottom: 20px;
	}

	.browser-error-detail {
		margin-bottom: 12px;
		line-height: 1.6;
		color: var(--vscode-foreground);

		strong {
			font-weight: 600;
		}

		code {
			background-color: var(--vscode-textCodeBlock-background);
			padding: 2px 6px;
			border-radius: 3px;
			font-family: var(--monaco-monospace-font);
			font-size: 12px;
		}
	}

	.browser-find-widget-wrapper {
		flex-shrink: 0;
		position: relative;
		z-index: 10;
		overflow: hidden;

		&.find-visible {
			border-bottom: 1px solid var(--vscode-widget-border);
		}

		/* Override SimpleFindWidget absolute positioning to flow in layout */
		.simple-find-part-wrapper {
			position: relative;
			top: 0;
			right: 0;
			padding: 0;
			margin-left: auto;
		}

		.simple-find-part {
			border-radius: 0;
			border: none;
			top: 0 !important;
			padding: 6px 8px 6px 12px;
			transition: none;

			&:not(.visible) {
				display: none;
			}

			.monaco-sash {
				width: 2px !important;
				border-radius: 0;

				&::before {
					width: var(--vscode-sash-hover-size);
					left: calc(50% - (var(--vscode-sash-hover-size) / 2));
				}
			}

			/* Hide whole word and regex toggles */
			.codicon-whole-word,
			.codicon-regex {
				display: none;
			}
		}
	}

	.browser-welcome-container {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: var(--vscode-editor-background);

		.browser-welcome-content {
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 12px;
		}

		.browser-welcome-icon {
			min-height: 48px;

			.codicon {
				font-size: 40px;
			}
		}

		.browser-welcome-title {
			font-size: 24px;
			margin-top: 5px;
			text-align: center;
			line-height: normal;
			padding: 0 8px;
		}

		.browser-welcome-subtitle {
			position: relative;
			text-align: center;
			max-width: 100%;
			padding: 0 20px;
			margin: 8px auto 0;
			color: var(--vscode-foreground);

			p {
				margin-top: 8px;
				margin-bottom: 8px;
			}
		}

		.browser-welcome-tip {
			color: var(--vscode-descriptionForeground);
			text-align: center;
			margin: 16px auto 0;
			max-width: 400px;
			padding: 0 12px;
			font-style: italic;
		}
	}
}
