/* ── Compile Progress Overlay ──────────────────────────────── */
/* Shown when WASM TeX engine is loading or compiling          */

.compile-progress-overlay {
	position: fixed;
	inset: 0;
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(var(--theme-bg-primary-rgb), 0.45);
	backdrop-filter: blur(4px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.compile-progress-overlay.active {
	opacity: 1;
	pointer-events: auto;
}

.compile-progress-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 32px 48px;
	border-radius: 12px;
	background: var(--bg-primary, var(--theme-bg-tertiary));
	border: 1px solid var(--border-color, var(--theme-border-primary));
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	min-width: 280px;
}

.compile-progress-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid rgba(var(--theme-overlay-rgb), 0.15);
	border-top-color: var(--theme-primary);
	border-radius: 50%;
}

/* Only while the overlay is shown: an animation on the hidden overlay
   (opacity 0) still makes the browser draw 60 frames per second. */
.compile-progress-overlay.active .compile-progress-spinner {
	animation: cp-spin 0.8s linear infinite;
}

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

.compile-progress-label {
	font-size: 14px;
	color: var(--text-secondary, var(--theme-text-secondary));
	text-align: center;
}

.compile-progress-bar {
	width: 100%;
	height: 4px;
	border-radius: 2px;
	background: rgba(var(--theme-overlay-rgb), 0.08);
	overflow: hidden;
}

.compile-progress-bar-fill {
	height: 100%;
	border-radius: 2px;
	background: var(--theme-primary);
	color: var(--theme-on-primary);
	transition: width 0.3s ease;
}
