/* Two-column layout ratio: settings (left) 2 parts, preview (right) 3 parts = 40% / 60%.
   Keep both flex-grow values here, next to each other (the preview one is in .loader-preview below). */
.loader-settings {
	flex: 2 1 0;
	/* Lets the column shrink below its content width */
	min-width: 0;
	/* Vertical flex so the Card can fill the full column height */
	display: flex;
	flex-direction: column;
}

/* Preview zone: fills all the space left of the settings column */
.loader-preview {
	flex: 3 1 0;
	min-width: 0;
	min-height: 480px;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Variables are set inline by loader-preview.js; fallbacks = original loader values */
	background-color: var(--loader-bg, #dbdbdb);
	transition: 0.5s all;
}

/* Spinning ring: conic gradient (moving arc + fixed track) cut into a ring by a mask */
.loader-preview__spinner {
	box-sizing: border-box;
	width: var(--loader-size, 3rem);
	height: var(--loader-size, 3rem);
	border-radius: 50%;
	/* Arc covers --loader-arc of the circle, the rest is the fixed track */
	background: conic-gradient(
		var(--loader-spinner, grey) 0 var(--loader-arc, 25%),
		var(--loader-track, white) 0
	);
	/* Transparent center, opaque ring of --loader-thickness (replaces the old border-width) */
	-webkit-mask: radial-gradient(
		farthest-side,
		transparent calc(100% - var(--loader-thickness, 0.3rem)),
		#000 calc(100% - var(--loader-thickness, 0.3rem))
	);
	mask: radial-gradient(
		farthest-side,
		transparent calc(100% - var(--loader-thickness, 0.3rem)),
		#000 calc(100% - var(--loader-thickness, 0.3rem))
	);
	animation: 1.7s loader-preview-spin infinite linear;
}

/* Prefixed keyframes name to avoid clashes with WP admin styles */
@keyframes loader-preview-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}