@use '../../../../shared/utils/token/css/semantic-color';

@keyframes a-loader-loading {
	0% {
		opacity: 0;
		transform: translateX(-300px);
	}
	33% {
		opacity: 1;
		transform: translateX(0);
	}
	66% {
		opacity: 1;
		transform: translateX(0);
	}
	100% {
		opacity: 0;
		transform: translateX(300px);
	}
}

.a-loader {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 100%;
	user-select: none;
}

.a-loader__wrap {
	width: 100%;
	transform: translateY(-50%);
	top: 50%;
	position: absolute;
	text-align: center;
	overflow: hidden;
}

.a-loader__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	background-color: semantic-color.$color-solid-grey-5;
	opacity: 0;
	margin-right: 3px;

	animation: a-loader-loading 3s infinite ease-in-out;

	&:nth-child(5) {
		animation-delay: 100ms;
	}
	&:nth-child(4) {
		animation-delay: 200ms;
	}
	&:nth-child(3) {
		animation-delay: 300ms;
	}
	&:nth-child(2) {
		animation-delay: 400ms;
	}
	&:nth-child(1) {
		animation-delay: 500ms;
	}
}

.a-loader--white {
	.a-loader__dot {
		background-color: semantic-color.$color-solid-white;
	}
}
