:root {
	--preloadify-bg: #ffffff;
	--preloadify-color: #E25D44;
	--preloadify-delay: 1500;
	--preloadify-logo-height: 80px;
	--preloadify-container-width: 100%;
}

#page-loader {
	background-color: var(--preloadify-bg) !important;
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
	visibility: visible;
	transition: opacity 0.3s ease;
}

html[data-preloadify-state="active"] #page-loader {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

body.loaded #page-loader,
html[data-preloadify-state="done"] #page-loader {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.loader-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: var(--preloadify-container-width);
	visibility: visible;
}

#page-loader * {
	visibility: visible !important;
}

.loader-logo img {
	max-height: var(--preloadify-logo-height);
	margin-bottom: 20px;
	visibility: visible;
}

.loader-dots {
	display: flex;
	gap: 0.4rem;
}

.loader-dots span {
	width: 10px;
	height: 10px;
	background-color: var(--preloadify-color);
	border-radius: 50%;
	display: inline-block;
	animation: bounce 1.2s infinite ease-in-out;
}

.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
	0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
	40% { transform: scale(1.2); opacity: 1; }
}

.loader-circle {
	width: 40px;
	height: 40px;
	border: 5px solid #ccc;
	border-top-color: var(--preloadify-color);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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

.loader-bar {
	width: 100px;
	height: 5px;
	background: #ccc;
	position: relative;
	overflow: hidden;
	border-radius: 3px;
}

.loader-bar::before {
	content: '';
	position: absolute;
	left: -40%;
	width: 40%;
	height: 100%;
	background: var(--preloadify-color);
	animation: loadbar 1s infinite;
}

@keyframes loadbar {
	0% { left: -40%; }
	100% { left: 100%; }
}

.loader-pulse {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: var(--preloadify-color);
	animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
	0%, 100% { transform: scale(1); opacity: 0.6; }
	50% { transform: scale(1.4); opacity: 1; }
}

.loader-logo.bounce {
	animation: bounceLogo 1s infinite ease-in-out;
}

@keyframes bounceLogo {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-10px); }
}

/* 🚨 EMERGENCY FIX: Force content display after 2 seconds if JS fails */
@keyframes force-show-content {
	0% { visibility: hidden; opacity: 0; }
	100% { visibility: visible !important; opacity: 1 !important; pointer-events: auto !important; }
}

body.preloadify-content-hidden > *:not(#page-loader) {
	animation: force-show-content 0.5s ease 2s forwards !important;
}

/* 🛡️ PROTECTION CACHE : Ces règles sont gérées par JavaScript pour éviter les conflits
   Le JavaScript détecte automatiquement si le loader devrait être actif selon la configuration
   et nettoie les résidus de cache si nécessaire. Voir loader.js:emergencyCleanup() */
