@import 'mediawiki.skin.variables.less';

@keyframes ve-editCheck-bounce {
	0%,
	20%,
	50%,
	80%,
	100% {
		transform: translateX( -50% ) translateY( 0 );
	}

	40% {
		transform: translateX( -50% ) translateY( -6px );
	}

	60% {
		transform: translateX( -50% ) translateY( -3px );
	}
}

.ve-ui-editCheck-scrollIntoView {
	position: fixed;
	box-shadow: 0 2px 2px 0 rgba( 0, 0, 0, 0.2 );
	opacity: 0;
	transition-property: opacity, transform;
	transition-duration: @transition-duration-base;
	white-space: nowrap;

	&-attention&-visible {
		animation: ve-editCheck-bounce 1.5s ease-in-out infinite;

		@media ( prefers-reduced-motion: reduce ) {
			animation: none;
		}
	}

	&-top {
		top: @spacing-200;
		transform: translateX( -50% ) translateY( calc( -100% - @spacing-200 ) );

		&.ve-ui-editCheck-scrollIntoView-visible {
			opacity: @opacity-base;
			transform: translateX( -50% ) translateY( 0 );
		}
	}

	&-bottom {
		bottom: @spacing-200;
		transform: translateX( -50% ) translateY( calc( 100% + @spacing-200 ) );

		&.ve-ui-editCheck-scrollIntoView-visible {
			opacity: @opacity-base;
			transform: translateX( -50% ) translateY( 0 );
		}
	}

	.oo-ui-buttonElement-button {
		/* Fix height rounding error in Minerva, could be upstreamed to OOUI */
		min-height: 2.25em;
	}

	/**
	 * Same border-radius is applied to all these elements to ensure that the trimmed-off corner
	 * areas don't capture clicks
	 */
	&,
	.oo-ui-buttonElement-framed:first-child,
	.oo-ui-buttonElement-framed:first-child .oo-ui-buttonElement-button {
		border-bottom-left-radius: 1.6em;
		border-top-left-radius: 1.6em;
	}

	&,
	.oo-ui-buttonElement-framed:last-child,
	.oo-ui-buttonElement-framed:last-child .oo-ui-buttonElement-button {
		border-bottom-right-radius: 1.6em;
		border-top-right-radius: 1.6em;
	}

	/* Desktop */
	.ve-ui-editCheckDialog & {
		margin-left: 150px;
	}

	/* Mobile */
	.ve-ui-gutterSidebarEditCheckDialog & {
		left: 50%;
		margin-top: 48px;
	}
}
