/**
 * EduIA Neural Atmosphere — capa decorativa global (pointer-events: none).
 * Activar con body.eduia-ai-atmosphere-enabled.
 * Prioridad: claridad > efecto · rendimiento (blur moderado, animaciones lentas).
 */

:root {
	--eduia-ai-glow: rgba(24, 119, 242, 0.11);
	--eduia-ai-line: rgba(24, 119, 242, 0.065);
	--eduia-ai-node: rgba(77, 163, 255, 0.28);
	--eduia-ai-particle: rgba(24, 119, 242, 0.065);
}

html[data-theme="dark"],
html.eduia-dark,
body.dark {
	--eduia-ai-glow: rgba(45, 136, 255, 0.15);
	--eduia-ai-line: rgba(77, 163, 255, 0.11);
	--eduia-ai-node: rgba(77, 163, 255, 0.36);
	--eduia-ai-particle: rgba(77, 163, 255, 0.085);
}

.eduia-neural-atmosphere {
	position: fixed;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	z-index: 0;
	isolation: isolate;
	transform: translateZ(0);
}

.eduia-neural-atmosphere::before {
	content: "";
	position: absolute;
	inset: -18%;
	background:
		radial-gradient(circle at 22% 32%, var(--eduia-ai-glow), transparent 32%),
		radial-gradient(circle at 78% 22%, rgba(77, 163, 255, 0.06), transparent 30%),
		radial-gradient(circle at 48% 88%, rgba(24, 119, 242, 0.06), transparent 34%);
	filter: blur(16px);
	animation: eduia-ai-drift 26s ease-in-out infinite alternate;
}

/* Partículas mínimas (sin nodos DOM extra) */
.eduia-neural-atmosphere::after {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0.5;
	background-image:
		radial-gradient(circle at 14% 20%, var(--eduia-ai-particle) 0, transparent 2px),
		radial-gradient(circle at 86% 26%, var(--eduia-ai-particle) 0, transparent 2px),
		radial-gradient(circle at 46% 64%, var(--eduia-ai-particle) 0, transparent 1.5px),
		radial-gradient(circle at 74% 76%, var(--eduia-ai-particle) 0, transparent 2px),
		radial-gradient(circle at 28% 90%, rgba(77, 163, 255, 0.045) 0, transparent 2px);
	background-size: 100% 100%;
	animation: eduia-ai-drift 30s ease-in-out infinite alternate-reverse;
}

.eduia-node {
	position: absolute;
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--eduia-ai-node);
	box-shadow: 0 0 12px var(--eduia-ai-node);
	animation: eduia-node-float 15s ease-in-out infinite;
}

.eduia-node.node-1 {
	top: 18%;
	left: 12%;
}

.eduia-node.node-2 {
	top: 32%;
	right: 18%;
	animation-delay: 2s;
}

.eduia-node.node-3 {
	bottom: 22%;
	left: 28%;
	animation-delay: 3.4s;
}

.eduia-node.node-4 {
	bottom: 14%;
	right: 26%;
	animation-delay: 4.8s;
}

.eduia-line {
	position: absolute;
	height: 1px;
	width: 240px;
	background: linear-gradient(90deg, transparent, var(--eduia-ai-line), transparent);
	transform-origin: center;
	opacity: 0.55;
	animation: eduia-line-pulse 12s ease-in-out infinite;
}

.eduia-line.line-1 {
	top: 24%;
	left: 10%;
	transform: rotate(18deg);
}

.eduia-line.line-2 {
	top: 42%;
	right: 10%;
	transform: rotate(-22deg);
	animation-delay: 2.5s;
}

.eduia-line.line-3 {
	bottom: 24%;
	left: 36%;
	transform: rotate(8deg);
	animation-delay: 5s;
}

@keyframes eduia-ai-drift {
	from {
		transform: translate3d(-0.6%, -0.6%, 0) scale(1);
	}
	to {
		transform: translate3d(0.9%, 0.7%, 0) scale(1.022);
	}
}

@keyframes eduia-node-float {
	0%,
	100% {
		transform: translateY(0);
		opacity: 0.38;
	}
	50% {
		transform: translateY(-10px);
		opacity: 0.72;
	}
}

@keyframes eduia-line-pulse {
	0%,
	100% {
		opacity: 0.18;
	}
	50% {
		opacity: 0.48;
	}
}

/* Contenido por encima del ambiente (modales Bootstrap siguen por encima del shell). */
body.eduia-ai-atmosphere-enabled .wrapper,
body.eduia-ai-atmosphere-enabled .body-content,
body.eduia-ai-atmosphere-enabled .page-content,
body.eduia-ai-atmosphere-enabled .content-body,
body.eduia-ai-atmosphere-enabled .eduia-social-app,
body.eduia-ai-atmosphere-enabled .eduia-workspace,
body.eduia-ai-atmosphere-enabled section.body,
body.eduia-ai-atmosphere-enabled .inner-wrapper,
body.eduia-ai-atmosphere-enabled #eduia-feed {
	position: relative;
	z-index: 1;
}

/* Login: DEBAJO del vídeo (.eduia-login-video-layer z-index 4). Antes z-index:1 tapaba el vídeo. */
body.eduia-login-body.eduia-ai-atmosphere-enabled .eduia-neural-atmosphere {
	z-index: 0;
	opacity: 0.08;
}

body.eduia-login-body.eduia-ai-atmosphere-enabled .eduia-login-particles {
	z-index: 6;
}

/* Móvil: menos blur compuesto = menos presión en GPU */
@media (max-width: 767.98px) {
	.eduia-neural-atmosphere::before {
		filter: blur(11px);
		inset: -12%;
	}

	.eduia-neural-atmosphere::after {
		opacity: 0.38;
	}

	.eduia-node {
		width: 5px;
		height: 5px;
		box-shadow: 0 0 9px var(--eduia-ai-node);
	}
}

@media (prefers-reduced-motion: reduce) {
	.eduia-neural-atmosphere *,
	.eduia-neural-atmosphere::before,
	.eduia-neural-atmosphere::after {
		animation: none !important;
	}
}

@media print {
	.eduia-neural-atmosphere {
		display: none !important;
	}
}
