/* Stepfox Playground chrome */

body.sfpg-page {
	margin: 0;
	padding: 0;
	height: 100vh;
	overflow: hidden;
	background: #1e1e1e;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#sfpg-root,
.sfpg-app {
	height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Boot splash */
.sfpg-boot {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	height: 100vh;
	color: #aaa;
	font-size: 14px;
}

.sfpg-boot-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #444;
	border-top-color: #fff;
	border-radius: 50%;
	animation: sfpg-spin 0.7s linear infinite;
}

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

/* Header */
.sfpg-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: 52px;
	padding: 0 12px;
	background: #1e1e1e;
	border-bottom: 1px solid #333;
	color: #fff;
	flex: none;
	z-index: 90;
}

.sfpg-header-left,
.sfpg-header-center,
.sfpg-header-right {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.sfpg-brand {
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.sfpg-brand span {
	color: #23d18b;
	font-weight: 400;
	margin-left: 4px;
}

.sfpg-header .components-button.sfpg-theme-button {
	color: #fff;
	background: #2f2f2f;
	border: 1px solid #444;
	border-radius: 4px;
	height: 34px;
	padding: 0 12px;
	font-weight: 600;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sfpg-header .components-button.sfpg-theme-button:hover {
	border-color: #23d18b;
	color: #fff;
}

.sfpg-caret {
	margin-left: 6px;
	opacity: 0.6;
	font-size: 10px;
}

.sfpg-select {
	background: #2f2f2f;
	color: #fff;
	border: 1px solid #444;
	border-radius: 4px;
	height: 34px;
	padding: 0 8px;
	font-size: 13px;
	max-width: 240px;
}

.sfpg-vp-button {
	background: transparent;
	border: 1px solid transparent;
	border-radius: 4px;
	color: #ccc;
	height: 32px;
	width: 36px;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
}

.sfpg-vp-button:hover {
	background: #2f2f2f;
}

.sfpg-vp-button.is-active {
	background: #2f2f2f;
	border-color: #23d18b;
}

.sfpg-header .components-button.sfpg-header-action {
	color: #ccc;
	height: 34px;
}

.sfpg-header .components-button.sfpg-header-action:hover {
	color: #fff;
}

.sfpg-header .components-button.sfpg-header-action.is-active {
	color: #23d18b;
}

.sfpg-header .components-button.sfpg-download {
	background: #23d18b;
	color: #0b271b;
	border-radius: 4px;
	height: 34px;
	padding: 0 14px;
	font-weight: 700;
}

.sfpg-header .components-button.sfpg-download:hover:not(:disabled) {
	background: #2ee89d;
	color: #0b271b;
}

.sfpg-header .components-button.sfpg-download:disabled {
	opacity: 0.5;
}

/* Layout */
.sfpg-body {
	display: flex;
	flex: 1;
	min-height: 0;
}

.sfpg-listview {
	width: 280px;
	flex: none;
	background: #fff;
	border-right: 1px solid #ddd;
	overflow: auto;
	padding: 8px;
}

.sfpg-sidebar {
	width: 280px;
	flex: none;
	background: #fff;
	border-left: 1px solid #ddd;
	overflow: auto;
}

.sfpg-canvas-area {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: #2f2f2f;
	overflow: hidden;
}

.sfpg-block-tools {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.sfpg-canvas {
	flex: 1;
	min-height: 0;
	margin: 0 auto;
	width: 100%;
	transition: max-width 0.25s ease;
	background: #fff;
	display: flex;
	flex-direction: column;
}

.sfpg-canvas iframe {
	flex: 1;
	width: 100%;
	border: 0;
}

.sfpg-vp-desktop {
	max-width: 100%;
}

.sfpg-vp-tablet {
	max-width: 810px;
	margin-top: 16px;
	margin-bottom: 16px;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.sfpg-vp-mobile {
	max-width: 400px;
	margin-top: 16px;
	margin-bottom: 16px;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

/* Loading / errors */
.sfpg-loading {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #ccc;
	gap: 8px;
}

.sfpg-error {
	padding: 8px 12px;
	background: #1e1e1e;
}

/* Theme picker overlay */
.sfpg-themes-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
}

.sfpg-themes-panel {
	background: #1e1e1e;
	border: 1px solid #333;
	border-radius: 8px;
	width: min(1080px, 100%);
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	color: #fff;
}

.sfpg-themes-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #333;
	font-size: 15px;
}

.sfpg-themes-panel-head .components-button {
	color: #ccc;
}

.sfpg-themes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 14px;
	padding: 18px;
	overflow: auto;
}

.sfpg-theme-card {
	background: #2a2a2a;
	border: 2px solid #3a3a3a;
	border-radius: 6px;
	padding: 0 0 10px;
	cursor: pointer;
	text-align: left;
	color: #eee;
	overflow: hidden;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.sfpg-theme-card:hover {
	border-color: #23d18b;
	transform: translateY(-2px);
}

.sfpg-theme-card.is-active {
	border-color: #23d18b;
}

.sfpg-theme-card img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	object-position: top;
	background: #111;
}

.sfpg-theme-card-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #111;
	color: #555;
	font-size: 42px;
	font-weight: 700;
}

.sfpg-theme-card-name {
	display: block;
	padding: 10px 12px 0;
	font-size: 13px;
	font-weight: 600;
}

/* Keep block popovers above our chrome */
.sfpg-app .components-popover {
	z-index: 99999;
}

@media (max-width: 900px) {
	.sfpg-sidebar,
	.sfpg-listview {
		position: fixed;
		top: 52px;
		bottom: 0;
		z-index: 95;
		box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
	}

	.sfpg-sidebar {
		right: 0;
	}

	.sfpg-listview {
		left: 0;
	}

	.sfpg-header-center {
		display: none;
	}
}
