/* =========================================================================
   Logo Preloader Pro – front CSS
   Sve boje/dimenzije/brzine dolaze kroz CSS varijable (postavlja ih PHP).
   ========================================================================= */

.lp-overlay {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--lp-bg, #1c1c1c);
	transition: opacity var(--lp-fade, 500ms) ease, visibility var(--lp-fade, 500ms) ease;
}

.lp-overlay.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.lp-stack {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

.lp-logo-wrap {
	position: relative;
	width: var(--lp-width, 160px);
	line-height: 0;
}

.lp-logo {
	display: block;
	width: 100%;
	height: auto;
	user-select: none;
	-webkit-user-drag: none;
}

/* ----------------------------- Stil: pulse_bar -------------------------- */
.lp-style-pulse_bar .lp-logo {
	animation: lp-pulse var(--lp-speed, 1.6s) ease-in-out infinite;
}

.lp-track {
	position: relative;
	width: var(--lp-width, 160px);
	height: 3px;
	border-radius: 99px;
	background: var(--lp-accent-soft, rgba(255, 255, 255, 0.22));
	overflow: hidden;
}

.lp-track__fill {
	position: absolute;
	inset: 0;
	border-radius: 99px;
	background: var(--lp-accent, #fff);
	transform: scaleX(0);
	transform-origin: left center;
	animation: lp-bar var(--lp-speed, 1.6s) ease-in-out infinite;
}

/* ----------------------------- Stil: fill ------------------------------- */
.lp-style-fill .lp-logo--gray {
	filter: grayscale(var(--lp-gray, 100%));
	opacity: 0.28;
}

.lp-style-fill .lp-logo--color {
	position: absolute;
	inset: 0;
	clip-path: inset(0 100% 0 0); /* default sakriven – siguran fallback */
	animation: lp-fill var(--lp-speed, 1.6s) ease-in-out infinite;
}

/* ----------------------------- Stil: ring (spinner) --------------------- */
.lp-ring {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 3px solid var(--lp-accent-soft, rgba(255, 255, 255, 0.22));
	border-top-color: var(--lp-accent, #fff);
	animation: lp-spin var(--lp-speed, 1.6s) linear infinite;
}

/* ----------------------------- Stil: dots ------------------------------- */
.lp-dots {
	display: flex;
	gap: 9px;
}

.lp-dots span {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--lp-accent, #fff);
	animation: lp-dots var(--lp-speed, 1.6s) ease-in-out infinite;
}

.lp-dots span:nth-child(2) {
	animation-delay: calc(var(--lp-speed, 1.6s) * 0.12);
}

.lp-dots span:nth-child(3) {
	animation-delay: calc(var(--lp-speed, 1.6s) * 0.24);
}

/* ----------------------------- Keyframes -------------------------------- */
@keyframes lp-pulse {
	0%, 100% { opacity: 0.42; transform: scale(0.97); }
	50%      { opacity: 1;    transform: scale(1); }
}

@keyframes lp-bar {
	0%     { transform: scaleX(0); transform-origin: left center; }
	50%    { transform: scaleX(1); transform-origin: left center; }
	50.01% { transform-origin: right center; }
	100%   { transform: scaleX(0); transform-origin: right center; }
}

@keyframes lp-fill {
	0%   { clip-path: inset(0 100% 0 0); }
	45%  { clip-path: inset(0 0 0 0); }
	55%  { clip-path: inset(0 0 0 0); }
	100% { clip-path: inset(0 100% 0 0); }
}

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

@keyframes lp-dots {
	0%, 100% { transform: translateY(0);    opacity: 0.5; }
	50%      { transform: translateY(-8px); opacity: 1; }
}

/* ----------------------------- Pristupačnost ---------------------------- */
/* Poštujemo "smanji animacije" SAMO ako overlay nema klasu lp-force-motion.
   Umesto potpunog zamrzavanja, koristimo nežno pulsiranje providnosti
   (ne izaziva mučninu, a korisnik vidi da se nešto dešava). */
@media (prefers-reduced-motion: reduce) {
	.lp-overlay:not(.lp-force-motion) .lp-logo,
	.lp-overlay:not(.lp-force-motion) .lp-ring,
	.lp-overlay:not(.lp-force-motion) .lp-dots,
	.lp-overlay:not(.lp-force-motion) .lp-track {
		animation: lp-soft 1.8s ease-in-out infinite;
	}
	.lp-overlay:not(.lp-force-motion) .lp-dots span,
	.lp-overlay:not(.lp-force-motion) .lp-track__fill {
		animation: none;
	}
	.lp-overlay:not(.lp-force-motion) .lp-track__fill {
		transform: scaleX(0.5);
		transform-origin: left center;
	}
	.lp-overlay:not(.lp-force-motion) .lp-style-fill .lp-logo--color {
		animation: none;
		clip-path: inset(0 0 0 0);
	}
}

@keyframes lp-soft {
	0%, 100% { opacity: 0.4; }
	50%      { opacity: 1; }
}
