@import 'mediawiki.mixins.animation';
@import 'mw.rcfilters.mixins';

@rcfilters-spinner-width: 70px;
@rcfilters-head-min-height: 200px;

// Corrections for the standard special page
.client-js {
	.cloptions {
		border: 0;
	}

	.rcfilters-head {
		min-height: @rcfilters-head-min-height;
	}
	body:not( .mw-rcfilters-ui-initialized ) .rcfilters-head {
		opacity: 0.5;
		pointer-events: none;

		.cloptions {
			display: none;
		}
	}

	.rcfilters-container {
		min-height: 100px;
		margin: 0;
	}

	.mw-changeslist {
		&-empty {
			// Hide the 'empty' message when we load rcfilters
			// since we replace it anyways with a specific
			// message of our own
			display: none;
		}
	}

	body.mw-rcfilters-ui-loading .mw-changeslist {
		opacity: 0.5;
	}

	.rcfilters-spinner {
		display: none;
		position: absolute;
		left: 50%;
		width: @rcfilters-spinner-width;
		// Make sure the middle of the spinner is centered, rather than its left edge
		margin-left: -@rcfilters-spinner-width/2;

		opacity: 0.8;
		white-space: nowrap;

		& .rcfilters-spinner-bounce,
		&:before,
		&:after {
			content: '';
			display: inline-block;
			width: 12px;
			height: 12px;
			background-color: #c8ccd1;
			border-radius: 100%;
			.animation( rcfiltersBouncedelay 1.5s ease-in-out -0.16s infinite both );
		}

		&:before {
			.animation-delay( -0.33s );
		}

		&:after {
			.animation-delay( 0s );
		}
	}
	body:not( .mw-rcfilters-ui-initialized ) .rcfilters-spinner {
		display: block;
		// When initializing, display the spinner on top of the area where the UI will appear
		margin-top: -@rcfilters-head-min-height/2;
	}
	body.mw-rcfilters-ui-loading .rcfilters-spinner {
		display: block;
		// When loading new results, display the spinner on top of the results area
		margin-top: 4em;
	}

	#contentSub,
	.watchlistDetails,
	form#mw-watchlist-resetbutton {
		display: none;
	}
}

.mw-rcfilters-staticfilters-selected {
	font-weight: bold;
}

@-webkit-keyframes rcfiltersBouncedelay {
	0%,
	80%,
	100% {
		-webkit-transform: scale( 0.7 );
		transform: scale( 0.7 );
	}
	40% {
		background-color: #a2a9b1;
		-webkit-transform: scale( 1 );
		transform: scale( 1 );
	}
}

@-moz-keyframes rcfiltersBouncedelay {
	0%,
	80%,
	100% {
		-moz-transform: scale( 0.7 );
		transform: scale( 0.7 );
	}
	40% {
		background-color: #a2a9b1;
		-moz-transform: scale( 0.7 );
		transform: scale( 1 );
	}
}

@keyframes rcfiltersBouncedelay {
	0%,
	80%,
	100% {
		transform: scale( 0.7 );
	}
	40% {
		background-color: #a2a9b1;
		transform: scale( 1 );
	}
}
