/**
 * Layout for the Wuppi Design admin SPA.
 */

.wuppi-settings-wrap {
	max-width: none;
}

.wuppi-settings-loading {
	color: #757575;
	font-style: italic;
}

.wuppi-settings-loading-state {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 24px;
}

.wuppi-settings-layout {
	display: grid;
	grid-template-columns: minmax(280px, 440px) 1fr;
	gap: 24px;
	margin-top: 16px;
	align-items: start;
}

@media (max-width: 960px) {
	.wuppi-settings-layout {
		grid-template-columns: 1fr;
	}
}

.wuppi-settings-controls {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.wuppi-settings-controls .components-tab-panel__tabs {
	border-bottom: 1px solid #dcdcde;
	padding-inline: 8px;
}

.wuppi-tab-panel {
	padding: 8px 16px 16px;
	max-height: calc(100vh - 280px);
	overflow-y: auto;
}

.wuppi-tab-panel .components-panel__body > * + * {
	margin-top: 20px;
}

.wuppi-tab-panel .components-panel__body-toggle {
	background: #f6f7f7;
	box-shadow: none !important;
	outline: none !important;
}

.wuppi-tab-panel .components-panel__body.is-opened {
	padding-bottom: 16px;
}

.wuppi-settings-preview {
	position: sticky;
	top: 32px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	overflow: hidden;
	min-height: 480px;
	display: flex;
	flex-direction: column;
}

.wuppi-preview-pane {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: clamp(480px, 70vh, 900px);
}

.wuppi-device-toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border-bottom: 1px solid #dcdcde;
	background: #f6f7f7;
	flex-shrink: 0;
}

.wuppi-device-toolbar__devices {
	display: flex;
	gap: 2px;
	flex: 1;
	justify-content: center;
}


.wuppi-preview-viewport {
	position: relative;
	flex: 1;
	overflow: hidden;
}

.wuppi-preview-iframe {
	display: block;
	width: 100%;
	height: 100%;
	margin-inline: auto;
	border: 0;
	background: #fff;
	transition: width 0.2s ease, opacity 0.2s ease;
}

.wuppi-preview-pane--tablet .wuppi-preview-viewport,
.wuppi-preview-pane--mobile .wuppi-preview-viewport {
	background: #e8eaed;
}

.wuppi-preview-pane--tablet .wuppi-preview-iframe {
	width: 1024px;
	max-width: 100%;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
}

.wuppi-preview-pane--mobile .wuppi-preview-iframe {
	width: 390px;
	max-width: 100%;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
}

.wuppi-preview-skeleton {
	position: absolute;
	inset: 0;
	padding: 32px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #f6f7f7;
	z-index: 1;
}

.wuppi-preview-skeleton__bar {
	height: 14px;
	background: linear-gradient(90deg, #e7e7e9 25%, #f1f1f3 50%, #e7e7e9 75%);
	background-size: 200% 100%;
	animation: wuppi-shimmer 1.4s ease-in-out infinite;
	border-radius: 4px;
}

.wuppi-preview-skeleton__block {
	flex: 1;
	background: linear-gradient(90deg, #e7e7e9 25%, #f1f1f3 50%, #e7e7e9 75%);
	background-size: 200% 100%;
	animation: wuppi-shimmer 1.4s ease-in-out infinite;
	border-radius: 6px;
}

@keyframes wuppi-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

.wuppi-radius-preset-row {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.wuppi-radius-preset-button {
	flex: 1 1 60px;
}

.wuppi-radius-preset-row.is-disabled {
	opacity: 0.4;
	pointer-events: none;
}

.wuppi-save-bar {
	border-top: 1px solid #dcdcde;
	padding: 12px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #f6f7f7;
}

.wuppi-save-bar__inline-message {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 12px;
}

.wuppi-save-bar__inline-message svg {
	flex-shrink: 0;
}

.wuppi-save-bar__inline-message--warning {
	color: #78350f;
}

.wuppi-save-bar__inline-message--warning svg {
	fill: #b45309;
}

.wuppi-save-bar__inline-message--success {
	color: #14532d;
}

.wuppi-save-bar__inline-message--success svg {
	fill: #16a34a;
}

.wuppi-save-bar__inline-message--error {
	color: #7f1d1d;
}

.wuppi-save-bar__inline-message--error svg {
	fill: #dc2626;
}

.wuppi-save-bar__actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}

.wuppi-save-bar .wuppi-confirm-reset.components-button {
	background: #b45309;
	color: #fff;
}

.wuppi-save-bar .wuppi-confirm-reset.components-button:hover:not(:disabled) {
	background: #92400e;
	color: #fff;
}

