@import '../less/variables/colors.less';
@import '../less/variables/typography.less';
@import '../less/variables/z-index.less';

@modal-padding: 15px;
@bounce-easing-curve: cubic-bezier(0.75, 0.7, 0.3, 1.75);

.c-modal__backdrop {
	background-color: rgba(0, 0, 0, 0.35);
	bottom: 0;
	left: 0;
	opacity: 0;
	overflow: auto;
	position: fixed;
	right: 0;
	top: 0;
	transition: opacity 0.25s;
	z-index: @z-index-modal-backdrop;

	&.is-visible {
		opacity: 1;
	}
}

.c-modal {
	background-color: #fff;
	border-radius: 3px;
	box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
	left: 50%;
	max-width: 600px;
	padding: 10px;
	position: relative;
	top: 10vh;
	transform: translateX(-50%);
	z-index: @z-index-modal;

	.c-modal__backdrop > & {
		transform: translateX(-50%) scale(0.9);
		transition: transform 0.25s @bounce-easing-curve;
	}

	// Not sure why, but we need the translate in all three selectors here in
	// order to have a smooth transition.
	.c-modal__backdrop.is-visible > & {
		transform: translateX(-50%) scale(1);
	}

	&.is-large {
		max-width: 900px;
	}

	&.is-full {
		border-radius: 0;
		box-shadow: none;
		height: 100%;
		left: 0;
		max-width: none;
		overflow-y: auto;
		padding-top: 30px;
		top: 0;
		transform: none;
		width: 100%;
	}
}

.c-modal__backdrop > .c-modal.is-full {
	transform: none;
	transition: none;
}

.c-modal__header {
	font-size: 24px;
	font-weight: @font-weight-bold;
	padding: @modal-padding;

	.is-full & {
		border-bottom: none;
	}
}

.c-modal__body {
	padding: 0 15px;
}

.c-modal__footer {
	padding: @modal-padding;
	text-align: right;
}

.c-modal__document-body-no-scroll {
	height: 100vh;
	overflow-y: hidden;
	width: 100%;
}

.c-modal__close {
	background-color: #fff;
	border: none;
	border-radius: 25px;
	cursor: pointer;
	height: 50px;
	padding-top: 9px;
	position: absolute;
	right: 20px;
	top: 20px;
	width: 50px;

	&:hover {
		background-color: @color-gray-xx-light;
	}
}

.c-modal__close__x::before,
.c-modal__close__x::after {
	background-color: #333;
	border: none;
	content: '';
	height: 33px;
	left: 24px;
	position: absolute;
	top: 9px;
	width: 2px;
}

.c-modal__close__x::before {
	transform: rotate(45deg);
}

.c-modal__close__x::after {
	transform: rotate(-45deg);
}

.c-modal__dismiss_confirmation {
	max-width: calc(100% - 50px);
	width: 600px;
}
