/* Loader
----------------------------------------------------------*/

/* Loader */

#page-loader {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	z-index: 10000;
	background: $color-white;

	> * {
		position: absolute;
		top: 50%;
		left: 50%;
	}

	.loader-1 {
		margin-top: -32px;
		margin-left: -32px;
	}

	.loader-2 {
		@include translate3d(-50%,-50%,0);
	}
}

/* Loader #1 */

.loader-1 { 
	stroke: $color-grey-3;
	@include animation(loaderRotate 1.4s linear infinite);

	.circle {
		stroke-dasharray: 187;
		stroke-dashoffset: 0;
		@include transform-origin(center);
		@include animation(loaderTurn 1.4s ease-in-out infinite);
	}

	&.loader-primary {
		stroke: $color-primary;
	}
}

@include keyframes(loaderRotate) {
	0% {
		@include rotate(0deg);
	}
	100% {
		@include rotate(270deg);
	}
}

@include keyframes(loaderTurn) {
	0% {
		stroke-dashoffset: 187;
	}
	50% {
		stroke-dashoffset: 46.75;
		@include rotate(135deg);
	}
	100% {
		stroke-dashoffset: 187;
		@include rotate(450deg);
	}
};

/* Loader #2 */

.loader-2{
	position: relative;
	width: 48px;
	height: 48px;
	display: inline-block;
	@include opacity(0.75);

	&:before {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		content: ' ';
		@include border-radius(50%);
		@include animation(loader2 1.5s both infinite);
		@include background-image(radial-gradient(center, rgba($color-grey-4,0) 0%, $color-grey-4 100%));
	}
	&.loader-primary:before { @include background-image(radial-gradient(center, rgba($color-primary,0) 0%, $color-primary 100%)); }
	&.loader-light:before { @include background-image(radial-gradient(center, rgba($color-white,0) 0%, $color-white 100%)); }
}

@include keyframes(loader2) {
	0% { @include scale(0); @include opacity(1); }
	100% { @include scale(3); @include opacity(0); }
}