/**
 * Responsive Mockup Generator frontend styles
 *
 * 1. Component reset
 * 2. Toolbar
 * 3. Canvas and devices
 * 4. Shared client view
 * 5. Responsive adjustments
 */

/* 1. Component reset */
.wprmg-app,
.wprmg-app * {
	box-sizing: border-box;
}

.wprmg-app.wprmg-app {
	--wprmg-accent: #3155e7;
	--wprmg-accent-dark: #233fbb;
	--wprmg-accent-dark-contrast: #fff;
	--wprmg-accent-soft: #eef1ff;
	--wprmg-accent-contrast: #fff;
	--wprmg-accent-on-soft: #3155e7;
	--wprmg-content-width: 1288px;
	--wprmg-border: #dce2ef;
	--wprmg-card: #ffffff;
	--wprmg-ink: #182033;
	--wprmg-muted: #667085;
	--wprmg-surface: #ffffff;
	--wprmg-canvas: #edf1f8;
	container-type: inline-size;
	color: var(--wprmg-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	line-height: 1.5;
	margin: 28px auto;
	max-width: var(--wprmg-content-width);
	position: relative;
	text-align: left;
	width: 100%;
}

.wprmg-app.wprmg-colors-theme {
	--wprmg-accent: var(--nectar-accent-color, var(--wp--preset--color--contrast, var(--global--color-primary, currentColor)));
	--wprmg-accent-dark: var(--nectar-accent-color, var(--wp--preset--color--contrast, var(--global--color-secondary, currentColor)));
	--wprmg-accent-dark-contrast: var(--wp--preset--color--base, var(--global--color-background, #fff));
	--wprmg-accent-soft: color-mix(in srgb, currentColor 9%, transparent);
	--wprmg-accent-contrast: var(--wp--preset--color--base, var(--global--color-background, #fff));
	--wprmg-accent-on-soft: currentColor;
	--wprmg-border: rgba(127, 127, 127, 0.28);
	--wprmg-card: var(--wp--preset--color--base, var(--global--color-background, #fff));
	--wprmg-ink: var(--wp--preset--color--contrast, var(--global--color-primary, currentColor));
	--wprmg-muted: currentColor;
	--wprmg-surface: var(--wp--preset--color--base, var(--global--color-background, #fff));
	--wprmg-canvas: color-mix(in srgb, currentColor 6%, transparent);
	color: inherit;
}

.wprmg-app button,
.wprmg-app input,
.wprmg-app select {
	font: inherit;
}

.wprmg-notice {
	background: var(--wprmg-canvas);
	border: 1px solid var(--wprmg-border);
	border-radius: 12px;
	color: var(--wprmg-ink);
	padding: 18px 20px;
}

/* 2. Toolbar */
.wprmg-toolbar {
	align-items: end;
	background: var(--wprmg-surface);
	border: 1px solid var(--wprmg-border);
	border-radius: 18px 18px 0 0;
	box-shadow: 0 16px 40px rgba(24, 32, 51, 0.08);
	display: grid;
	gap: 16px;
	grid-template-columns: minmax(310px, 1fr) auto;
	padding: 20px;
}

.wprmg-url-form {
	display: block;
	margin: 0;
	min-width: 0;
}

.wprmg-field,
.wprmg-field span,
.wprmg-toggle {
	font-family: inherit;
}

.wprmg-field {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin: 0;
}

.wprmg-label,
.wprmg-device-toggles legend {
	color: var(--wprmg-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.045em;
	line-height: 1.2;
	text-transform: uppercase;
}

.wprmg-input-wrap {
	align-items: center;
	display: flex;
	position: relative;
}

.wprmg-input-icon {
	color: var(--wprmg-muted);
	font-size: 19px;
	left: 15px;
	line-height: 1;
	pointer-events: none;
	position: absolute;
	top: 16px;
}

.wprmg-app .wprmg-url-input,
.wprmg-app .wprmg-preset {
	appearance: none;
	background: var(--wprmg-card);
	border: 1px solid var(--wprmg-border);
	border-radius: 12px;
	box-shadow: none;
	color: var(--wprmg-ink);
	height: 52px;
	line-height: 1.2;
	margin: 0;
	min-width: 0;
	outline: none;
	padding: 0 14px;
	width: 100%;
}

.wprmg-app .wprmg-url-input {
	padding-left: 44px;
	padding-right: 106px;
}

.wprmg-app .wprmg-preset {
	background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%);
	background-position: calc(100% - 17px) 22px, calc(100% - 12px) 22px;
	background-repeat: no-repeat;
	background-size: 5px 5px, 5px 5px;
	padding-right: 34px;
}

.wprmg-app .wprmg-url-input:focus,
.wprmg-app .wprmg-preset:focus,
.wprmg-app .wprmg-inline-preview:focus-visible,
.wprmg-app .wprmg-button:focus-visible,
.wprmg-app .wprmg-device:focus-visible {
	border-color: var(--wprmg-accent);
	box-shadow: 0 0 0 3px var(--wprmg-accent-soft);
	outline: none;
}

.wprmg-app .wprmg-inline-preview {
	appearance: none;
	background: var(--wprmg-accent) !important;
	border: 0;
	border-radius: 9px;
	color: var(--wprmg-accent-contrast) !important;
	cursor: pointer;
	font-size: 14px;
	font-weight: 700;
	height: 42px;
	line-height: 1;
	margin: 0;
	padding: 0 18px;
	position: absolute;
	right: 5px;
	top: 5px;
}

.wprmg-app .wprmg-inline-preview:hover {
	background: var(--wprmg-accent-dark) !important;
	color: var(--wprmg-accent-dark-contrast) !important;
}

.wprmg-app .wprmg-button {
	align-items: center;
	appearance: none;
	background: var(--wprmg-card);
	border: 1px solid var(--wprmg-border);
	border-radius: 12px;
	box-shadow: none;
	color: var(--wprmg-ink);
	cursor: pointer;
	display: inline-flex;
	font-size: 14px;
	font-weight: 650;
	gap: 7px;
	height: 52px;
	justify-content: center;
	line-height: 1;
	margin: 0;
	padding: 0 15px;
	text-decoration: none;
	text-transform: none;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.wprmg-app .wprmg-button:hover {
	background: var(--wprmg-accent-soft);
	border-color: var(--wprmg-accent);
	color: var(--wprmg-accent-on-soft);
	text-decoration: none;
}

.wprmg-app .wprmg-button:active {
	transform: translateY(1px);
}

.wprmg-options {
	align-items: end;
	display: grid;
	gap: 10px;
	grid-template-columns: auto 180px auto;
	margin: 0;
	padding: 0;
}

.wprmg-device-toggles {
	border: 0;
	display: block;
	margin: 0;
	min-width: 0;
	padding: 0;
}

.wprmg-device-toggles legend {
	display: block;
	margin-bottom: 7px;
	width: 100%;
}

.wprmg-toggle-list {
	background: var(--wprmg-canvas);
	border: 1px solid var(--wprmg-border);
	border-radius: 12px;
	display: flex;
	flex-wrap: nowrap;
	gap: 2px;
	padding: 4px;
}

.wprmg-toggle {
	cursor: pointer;
	display: inline-flex;
	margin: 0;
	position: relative;
}

.wprmg-toggle input {
	height: 1px;
	top: auto;
	left: -10000px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.wprmg-toggle span {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 9px;
	color: var(--wprmg-muted);
	display: flex;
	font-size: 13px;
	font-weight: 650;
	gap: 6px;
	height: 42px;
	line-height: 1;
	padding: 0 9px;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.wprmg-toggle span svg {
	fill: none;
	height: 18px;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
	width: 18px;
}

.wprmg-toggle span b {
	font: inherit;
}

.wprmg-toggle input:checked + span {
	background: var(--wprmg-accent-soft);
	box-shadow: 0 1px 3px rgba(35, 63, 187, 0.12);
	color: var(--wprmg-accent-on-soft);
}

.wprmg-toggle input:focus-visible + span {
	box-shadow: 0 0 0 3px var(--wprmg-accent-soft);
}

.wprmg-actions {
	display: flex;
	flex-wrap: nowrap;
	gap: 5px;
	justify-content: flex-end;
}

.wprmg-share svg {
	fill: currentcolor;
	height: 17px;
	width: 17px;
}

.wprmg-status {
	color: var(--wprmg-muted);
	font-size: 13px;
	grid-column: 1 / -1;
	margin: 12px 0 0;
	min-height: 20px;
}

/* 3. Canvas and devices */
.wprmg-stage-wrap {
	background: var(--wprmg-canvas);
	border: 1px solid var(--wprmg-border);
	border-radius: 0 0 18px 18px;
	border-top: 0;
	overflow: hidden;
	position: relative;
}

.wprmg-project-bar {
	align-items: center;
	background: var(--wprmg-card);
	border-bottom: 1px solid var(--wprmg-border);
	display: flex;
	justify-content: center;
	min-height: 72px;
	padding: 14px 24px;
	position: relative;
	text-align: center;
	z-index: 6;
}

.wprmg-project-bar div {
	min-width: 0;
}

.wprmg-project-title,
.wprmg-project-url {
	display: block;
}

.wprmg-project-title {
	color: var(--wprmg-ink);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
}

.wprmg-project-url {
	color: var(--wprmg-muted);
	font-size: 13px;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wprmg-stage {
	height: 0;
	overflow: hidden;
	padding-bottom: 66.40625%;
	position: relative;
	width: 100%;
}

.wprmg-canvas {
	background: var(--wprmg-canvas);
	height: 680px;
	left: 0;
	overflow: hidden;
	position: absolute;
	top: 0;
	transform-origin: 0 0;
	width: 1024px;
}

.wprmg-canvas::before {
	background-image: radial-gradient(rgba(74, 93, 130, 0.15) 0.8px, transparent 0.8px);
	background-size: 18px 18px;
	content: "";
	inset: 0;
	mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 78%);
	pointer-events: none;
	position: absolute;
}

.wprmg-device {
	background: #1a1d25;
	border: 1px solid rgba(255, 255, 255, 0.24);
	box-shadow: 0 26px 55px rgba(31, 42, 68, 0.24), 0 5px 15px rgba(31, 42, 68, 0.14);
	cursor: grab;
	position: absolute;
	touch-action: none;
	user-select: none;
}

.wprmg-device:active {
	cursor: grabbing;
}

.wprmg-device-hidden {
	display: none;
}

.wprmg-screen {
	background: #fff;
	overflow: hidden;
	position: absolute;
}

.wprmg-screen iframe {
	background: #fff;
	border: 0;
	box-sizing: content-box;
	display: block;
	left: 0;
	margin: 0;
	max-height: none !important;
	max-width: none !important;
	min-height: 0 !important;
	min-width: 0 !important;
	padding: 0;
	position: absolute;
	top: 0;
	transform-origin: 0 0;
}

.wprmg-thumbnail-view .wprmg-screen img {
	display: block;
	height: 100%;
	max-height: none !important;
	max-width: none !important;
	object-fit: fill;
	width: 100%;
}

.wprmg-device-loading .wprmg-screen::before {
	background: rgba(255, 255, 255, 0.82);
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
	z-index: 3;
}

.wprmg-device-loading .wprmg-screen::after {
	animation: wprmg-spin 0.75s linear infinite;
	border: 3px solid rgba(49, 85, 231, 0.2);
	border-radius: 50%;
	border-top-color: var(--wprmg-accent);
	content: "";
	height: 32px;
	left: calc(50% - 16px);
	pointer-events: none;
	position: absolute;
	top: calc(50% - 16px);
	width: 32px;
	z-index: 4;
}

@keyframes wprmg-spin {
	to {
		transform: rotate(360deg);
	}
}

.wprmg-drag-shield {
	inset: 0;
	position: absolute;
	z-index: 2;
}

.wprmg-device-camera {
	background: #4d5261;
	border-radius: 999px;
	position: absolute;
}

.wprmg-device-desktop {
	border-radius: 15px 15px 8px 8px;
	height: 370px;
	left: 235px;
	top: 54px;
	width: 554px;
	z-index: 1;
}

.wprmg-device-desktop::after {
	background: linear-gradient(90deg, #7b8190, #d8dae0 45%, #8a909e);
	border-radius: 0 0 5px 5px;
	bottom: -74px;
	clip-path: polygon(42% 0, 58% 0, 62% 78%, 72% 88%, 72% 100%, 28% 100%, 28% 88%, 38% 78%);
	content: "";
	height: 74px;
	left: 0;
	position: absolute;
	width: 100%;
}

.wprmg-device-desktop .wprmg-screen {
	border-radius: 7px;
	height: 312px;
	left: 17px;
	top: 17px;
	width: 518px;
}

.wprmg-device-desktop iframe {
	height: 980px !important;
	transform: scale(0.32375);
	width: 1600px !important;
}

.wprmg-device-desktop .wprmg-device-camera {
	bottom: 17px;
	height: 5px;
	left: calc(50% - 2.5px);
	width: 5px;
}

.wprmg-device-laptop {
	border-radius: 12px 12px 5px 5px;
	height: 278px;
	left: 492px;
	top: 354px;
	width: 458px;
	z-index: 3;
}

.wprmg-device-laptop .wprmg-screen {
	border-radius: 4px;
	height: 236px;
	left: 15px;
	top: 15px;
	width: 426px;
}

.wprmg-device-laptop iframe {
	height: 800px !important;
	transform: scale(0.3328125);
	width: 1280px !important;
}

.wprmg-device-laptop .wprmg-device-base {
	background: linear-gradient(#e8e9ec, #8f95a1);
	border-radius: 2px 2px 12px 12px;
	bottom: -14px;
	height: 14px;
	left: -30px;
	position: absolute;
	width: 518px;
}

.wprmg-device-tablet {
	border-radius: 19px;
	height: 326px;
	left: 110px;
	top: 272px;
	width: 226px;
	z-index: 4;
}

.wprmg-device-tablet .wprmg-screen {
	border-radius: 7px;
	height: 282px;
	left: 16px;
	top: 22px;
	width: 194px;
}

.wprmg-device-tablet iframe {
	height: 1024px !important;
	transform: scale(0.25260417, 0.27539063);
	width: 768px !important;
}

.wprmg-device-tablet .wprmg-device-camera {
	height: 4px;
	left: calc(50% - 2px);
	top: 9px;
	width: 4px;
}

.wprmg-device-mobile {
	border-radius: 22px;
	height: 226px;
	left: 307px;
	top: 418px;
	width: 112px;
	z-index: 5;
}

.wprmg-device-mobile .wprmg-screen {
	border-radius: 12px;
	height: 196px;
	left: 8px;
	top: 15px;
	width: 94px;
}

.wprmg-device-mobile iframe {
	height: 760px !important;
	transform: scale(0.29375, 0.25789474);
	width: 320px !important;
}

.wprmg-device-mobile .wprmg-device-camera {
	height: 3px;
	left: calc(50% - 10px);
	top: 6px;
	width: 20px;
}

.wprmg-stage[data-preset="mobile-pair"] .wprmg-device-tablet {
	transform: scale(1.4);
	transform-origin: left top;
}

.wprmg-stage[data-preset="mobile-pair"] .wprmg-device-mobile {
	transform: scale(1.5);
	transform-origin: left top;
}

.wprmg-stage[data-preset="desktop-only"] .wprmg-device-desktop {
	transform: scale(1.3);
	transform-origin: left top;
}

.wprmg-stage[data-preset="laptop-only"] .wprmg-device-laptop {
	transform: scale(1.75);
	transform-origin: left top;
}

.wprmg-stage[data-preset="tablet-only"] .wprmg-device-tablet {
	transform: scale(1.65);
	transform-origin: left top;
}

.wprmg-stage[data-preset="mobile-only"] .wprmg-device-mobile {
	transform: scale(2.35);
	transform-origin: left top;
}

/* 4. Shared client view */
.wprmg-app.wprmg-shared-view {
	align-items: center;
	background: var(--wprmg-canvas);
	display: flex;
	inset: 0;
	justify-content: center;
	margin: 0;
	max-width: none;
	overflow: hidden;
	padding: 24px;
	position: fixed;
	z-index: 999999;
}

.wprmg-shared-view .wprmg-toolbar {
	display: none;
}

.wprmg-shared-view .wprmg-stage-wrap {
	border: 1px solid var(--wprmg-border);
	border-radius: 18px;
	box-shadow: 0 30px 80px rgba(24, 32, 51, 0.22);
	width: min(1180px, calc(100vw - 48px));
}

.wprmg-shared-close {
	align-items: center;
	background: var(--wprmg-card);
	border: 1px solid var(--wprmg-border);
	border-radius: 50%;
	box-shadow: 0 8px 26px rgba(24, 32, 51, 0.2);
	color: var(--wprmg-ink);
	display: flex;
	font-size: 30px;
	height: 44px;
	justify-content: center;
	line-height: 1;
	position: fixed;
	right: 18px;
	text-decoration: none;
	top: 18px;
	width: 44px;
	z-index: 2;
}

.wprmg-shared-close:hover,
.wprmg-shared-close:focus-visible {
	background: var(--wprmg-accent-soft);
	border-color: var(--wprmg-accent);
	color: var(--wprmg-accent);
	outline: none;
}

body.wprmg-shared-open {
	overflow: hidden;
}

body.wprmg-thumbnail-source {
	background: #fff;
	height: 680px;
	margin: 0 !important;
	overflow: hidden;
	padding: 0 !important;
	width: 1024px;
}

.wprmg-app.wprmg-thumbnail-view {
	background: #fff;
	display: block;
	height: 680px;
	inset: 0 auto auto 0;
	margin: 0;
	max-width: none;
	overflow: hidden;
	padding: 0;
	width: 1024px;
}

.wprmg-thumbnail-view .wprmg-stage-wrap,
.wprmg-thumbnail-view .wprmg-stage {
	background: #fff;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	height: 680px !important;
	padding: 0 !important;
	width: 1024px !important;
}

.wprmg-thumbnail-view .wprmg-canvas {
	background: #fff;
	transform: scale(1) !important;
}

.wprmg-thumbnail-view .wprmg-canvas::before {
	display: none;
}

/* 5. Responsive adjustments */
@media (max-width: 920px) {
	.wprmg-toolbar {
		grid-template-columns: 1fr;
	}

	.wprmg-options {
		border-top: 1px solid #edf0f5;
		gap: 14px;
		grid-template-columns: minmax(0, 1fr) 180px auto;
		margin-top: 8px;
		padding-top: 18px;
	}

	.wprmg-toggle-list {
		width: max-content;
	}
}

/* Theme content columns can be narrower than the browser viewport. */
@container (max-width: 920px) {
	.wprmg-toolbar {
		grid-template-columns: 1fr;
	}

	.wprmg-options {
		border-top: 1px solid #edf0f5;
		gap: 14px;
		grid-template-columns: minmax(0, 1fr) 180px auto;
		margin-top: 8px;
		padding-top: 18px;
	}

	.wprmg-toggle-list {
		width: max-content;
	}
}

@media (max-width: 640px) {
	.wprmg-app {
		margin: 20px auto;
	}

	.wprmg-toolbar {
		border-radius: 14px 14px 0 0;
		padding: 16px;
	}

	.wprmg-options {
		grid-template-columns: 1fr;
	}

	.wprmg-toggle-list {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		width: 100%;
	}

	.wprmg-toggle span {
		justify-content: center;
	}

	.wprmg-actions {
		grid-column: auto;
		justify-content: stretch;
	}

	.wprmg-actions .wprmg-button {
		flex: 1 1 140px;
	}

	.wprmg-select-field {
		max-width: none;
	}

	.wprmg-shared-view .wprmg-stage-wrap {
		width: calc(100vw - 20px);
	}

	.wprmg-app.wprmg-shared-view {
		padding: 10px;
	}

	.wprmg-project-bar {
		min-height: 64px;
		padding: 10px 54px 10px 16px;
	}
}

@container (max-width: 640px) {
	.wprmg-toolbar {
		border-radius: 14px 14px 0 0;
		padding: 16px;
	}

	.wprmg-options {
		grid-template-columns: 1fr;
	}

	.wprmg-toggle-list {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		width: 100%;
	}

	.wprmg-toggle span {
		justify-content: center;
	}

	.wprmg-actions {
		grid-column: auto;
		justify-content: stretch;
	}

	.wprmg-actions .wprmg-button {
		flex: 1 1 140px;
	}

	.wprmg-select-field {
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wprmg-app * {
		scroll-behavior: auto;
		transition-duration: 0.01ms;
	}

	.wprmg-device-loading .wprmg-screen::after {
		animation-duration: 1.5s;
	}
}
