/* FLASHLIGHT OVERLAY */
#flashlight-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.85);
	pointer-events: none;
	z-index: 50 !important;
	display: none;
	mask-image: radial-gradient(
		circle at var(--flashlight-x, 50%) var(--flashlight-y, 50%),
		transparent 0px,
		black 0px
	);
	-webkit-mask-image: radial-gradient(
		circle at var(--flashlight-x, 50%) var(--flashlight-y, 50%),
		transparent 0px,
		black 0px
	);
	transition: mask-image 0.2s ease-in-out, mask-position 0.05s linear;
}

body.flashlight-on #flashlight-overlay {
	mask-image: radial-gradient(
		circle at var(--flashlight-x, 50%) var(--flashlight-y, 50%),
		transparent 100px,
		black 120px
	);
	-webkit-mask-image: radial-gradient(
		circle at var(--flashlight-x, 50%) var(--flashlight-y, 50%),
		transparent 100px,
		black 120px
	);
}

body.flashlight-on.flashlight-uv #flashlight-overlay {
	mask-image: radial-gradient(
		circle at var(--flashlight-x, 50%) var(--flashlight-y, 50%),
		transparent 90px,
		rgba(128, 0, 255, 0.8) 110px,
		/* Zwiększona intensywność fioletu */ black 130px
	);
	-webkit-mask-image: radial-gradient(
		circle at var(--flashlight-x, 50%) var(--flashlight-y, 50%),
		transparent 90px,
		rgba(128, 0, 255, 0.8) 110px,
		black 130px
	);
}
/* Elementy UV */
/* Elementy UV */
.uv-only {
	opacity: 0; /* Ukryte na starcie */
	color: rgba(128, 0, 255, 0.8);
	text-shadow: 0 0 5px rgba(128, 0, 255, 0.5);
	pointer-events: none;
	/* Domyślna maska - wszystko czarne */
	mask-image: radial-gradient(circle at 50% 50%, black 0px, black 100%);
	-webkit-mask-image: radial-gradient(circle at 50% 50%, black 0px, black 100%);
	transition: mask-image 0.1s ease-in-out, opacity 0.1s ease-in-out;
	display: fixed;
	z-index: 2000; /* Wyższy z-index dla pewności */
	will-change: opacity, mask-image;
}
.uv-only img {
	filter: brightness(1.2) contrast(1.1) hue-rotate(270deg); /* Podbija fiolet */
}

/* FLASHLIGHT EFFECT */
#flashlight-effect {
	position: fixed;
	width: 300px;
	height: 300px;
	background: radial-gradient(
		circle,
		rgba(255, 255, 245, 0.1) 10%,
		rgba(0, 0, 0, 0) 60%
	);
	border-radius: 50%;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease-in-out, background 0.2s ease-in-out;
	z-index: 999;
	display: none;
}

body.flashlight-on #flashlight-effect {
	display: block;
	opacity: 1;
}

body.flashlight-on.flashlight-uv #flashlight-effect {
	background: radial-gradient(
		circle,
		rgba(128, 0, 255, 0.5) 10%,
		/* Mocniejszy fiolet na środku */ rgba(128, 0, 255, 0.1) 60%,
		/* Rozmywa się w fiolet, zamiast w czerń */ rgba(0, 0, 0, 0) 80%
			/* Czerń dopiero na samym końcu */
	);
}

/* Reszta stylów (przyciski, animacje) pozostaje bez zmian */

/* ========================
   Przyciski i animacje 
======================== */
#flashlight-toggle {
	display: none;
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 35px;
	height: 35px;
	background: none;
	border: none;
	z-index: 120;
	cursor: pointer;
}

#flashlight-toggle img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.uv-button {
	display: none; /* Ukryj przycisk na początku */
	position: fixed;
	bottom: 75px; /* Nad przyciskiem latarki */
	right: 22px;
	width: 35px; /* Trochę większy dla lepszej widoczności */
	height: 35px;
	background: linear-gradient(
		135deg,
		rgba(128, 0, 255, 0.2),
		rgba(0, 0, 0, 0.8)
	); /* Subtelny gradient z fioletem */
	border: 2px solid rgba(128, 0, 255, 0.8); /* Fioletowa ramka pasująca do UV */
	border-radius: 50%;
	z-index: 120;
	cursor: pointer;
	font-size: 14px; /* Rozmiar czcionki */
	font-weight: bold;
	font-family: "Arial", sans-serif; /* Czysta, nowoczesna czcionka */
	color: rgba(255, 255, 255, 0.9); /* Lekko rozjaśniony biały */
	text-shadow: 0 0 5px rgba(128, 0, 255, 0.5); /* Delikatny fioletowy cień */
	opacity: 0; /* Startujemy z niewidocznym */
	transition: opacity 0.3s ease, transform 0.2s ease, border-color 0.3s ease; /* Płynne przejścia */
	box-shadow: 0 0 10px rgba(128, 0, 255, 0.3); /* Subtelny blask */
}

.uv-button:hover,
.uv-button:focus {
	opacity: 1; /* Pełna widoczność przy najechaniu */
	transform: scale(1.1); /* Lekkie powiększenie */
	border-color: rgba(128, 0, 255, 1); /* Mocniejszy fiolet */
	box-shadow: 0 0 15px rgba(128, 0, 255, 0.5); /* Wzmocniony blask */
}

@media (max-width: 1200px) {
	#flashlight-toggle {
		display: none;
	}
	.uv-button.active {
		display: flex; /* Flex dla lepszego wyśrodkowania tekstu */
		align-items: center;
		justify-content: center;
		opacity: 1; /* Pełna widoczność, gdy aktywny */
		animation: uvPopIn 0.4s ease forwards; /* Animacja pojawienia */
	}

	#flashlight-toggle.flashlight-available {
		display: block !important;
	}

	#flashlight-toggle.popIn {
		animation: popIn 0.8s ease forwards;
	}
}

@keyframes popIn {
	0% {
		transform: scale(0.3);
		opacity: 0;
	}
	60% {
		transform: scale(1.7);
		opacity: 1;
	}
	100% {
		transform: scale(1);
	}
}
