/**
 * menu.scss
 * Styles applied to dashboard menu items added via EverestForms.
 * Adds icons to top level menu items, etc.
 */

/**
 * Imports
 */
@import 'mixins/mixins';
@import 'variables/variables';
@import 'fonts';

/**
 * Styling begins.
 */
#evf-modal-wrap {
	display: none;
	background-color: #fff;
	-webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
	width: 500px;
	height: 250px;
	overflow: hidden;
	margin-left: -250px;
	margin-top: -125px;
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 100105;
	-webkit-transition: height 0.2s, margin-top 0.2s;
	transition: height 0.2s, margin-top 0.2s;

	#evf-modal {
		height: 100%;
		position: relative;

		#evf-modal-title {
			background: #fcfcfc;
			border-bottom: 1px solid #dfdfdf;
			height: 36px;
			font-size: 18px;
			font-weight: 600;
			line-height: 36px;
			padding: 0 36px 0 16px;
			top: 0;
			right: 0;
			left: 0;
		}

		#evf-modal-close {
			color: #666;
			padding: 0;
			position: absolute;
			top: 0;
			right: 0;
			width: 36px;
			height: 36px;
			text-align: center;
			background: 0 0;
			border: none;
			cursor: pointer;

			&:hover,
			&:focus {
				color: #2ea2cc;
			}

			&:focus {
				outline: 0;
				box-shadow: 0 0 0 1px #5b9dd9,
					0 0 2px 1px rgba(30, 140, 190, 0.8);
			}

			&::before {
				content: '\f158';
				font: normal 20px/36px dashicons;
				vertical-align: top;
				speak: none;
				width: 36px;
				height: 36px;
			}
		}

		#evf-modal-inner {
			padding: 0 16px 50px;

			#evf-modal-notice {
				padding: 10px;
				color: #31708f;
				background-color: #d9edf7;
				border: 1px solid #bce8f1;
			}

			#evf-modal-options {
				padding: 8px 0 12px;

				.evf-modal-inline {
					margin: 0;
					padding: 0 20px 0 0;
					display: inline-block;
				}

				#evf-modal-select-form {
					max-width: 100%;
					margin-bottom: 1em;
				}
			}
		}

		.submitbox {
			padding: 8px 16px;
			background: #fcfcfc;
			border-top: 1px solid #dfdfdf;
			position: absolute;
			bottom: 0;
			left: 0;
			right: 0;

			#evf-modal-cancel {
				float: left;
				line-height: 25px;
			}

			#evf-modal-update {
				float: right;
				line-height: 23px;

				#evf-modal-submit {
					float: right;
					margin-bottom: 0;
				}
			}
		}
	}
}

#evf-modal-backdrop {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	min-height: 360px;
	background: #000;
	opacity: 0.7;
	filter: alpha(opacity=70);
	z-index: 100100;
}

@media screen and (max-width: 782px) {
	#evf-modal-wrap {
		height: 280px;
		margin-top: -140px;
	}

	#evf-modal-inner {
		padding: 0 16px 60px;
	}

	#evf-modal-cancel {
		line-height: 32px;
	}
}

@media screen and (max-width: 520px) {
	#evf-modal-wrap {
		width: auto;
		margin-left: 0;
		left: 10px;
		right: 10px;
		max-width: 500px;
	}
}

@media screen and (max-height: 520px) {
	#evf-modal-wrap {
		-webkit-transition: none;
		transition: none;
	}
}

@media screen and (max-height: 290px) {
	#evf-modal-wrap {
		height: auto;
		margin-top: 0;
		top: 10px;
		bottom: 10px;
	}

	#evf-modal-inner {
		overflow: auto;
		height: -webkit-calc(100% - 92px);
		height: calc(100% - 92px);
		padding-bottom: 2px;
	}
}

#toplevel_page_everest-forms ul li {
	&:not(.is-sub-menu) {
		a[href="admin.php?page=evf-builder"] {
			border-top: 1px solid hsla(0, 0%, 100%, 0.2);
			margin-top: 5px;
			padding-top: 8px;
		}

		a[href="admin.php?page=evf-entries"] {
			border-bottom: 1px solid hsla(0, 0%, 100%, 0.2);
			margin-bottom: 5px;
			padding-bottom: 8px;
		}

		a[href="admin.php?page=evf-settings"] {
			border-top: 1px solid hsla(0, 0%, 100%, 0.2);
			margin-top: 5px;
			padding-top: 8px;
		}

		/* If the previous sibling li contains the entries link, remove the top border / spacing on settings */
		&:has(> a[href="admin.php?page=evf-entries"])+li>a[href="admin.php?page=evf-settings"] {
			border-top: none;
			margin-top: 0;
			padding-top: 0;
		}

		a[href="admin.php?page=evf-smart-smtp"] {
			border-top: 1px solid hsla(0, 0%, 100%, 0.2);
			margin-top: 5px;
			padding-top: 8px;
		}

	}
}

/**
 * Fonts icons.
 */
[class^='evf-icon-'],
[class*=' evf-icon-'] {
	/* use !important to prevent issues with browser extensions that change fonts */
	font-family: EverestForms !important;
	speak: none;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;

	/* Enable Ligatures ================ */
	letter-spacing: 0;
	-webkit-font-feature-settings: 'liga';
	-moz-font-feature-settings: 'liga=1';
	-moz-font-feature-settings: 'liga';
	-ms-font-feature-settings: 'liga' 1;
	font-feature-settings: 'liga';
	-webkit-font-variant-ligatures: discretionary-ligatures;
	font-variant-ligatures: discretionary-ligatures;

	/* Better Font Rendering =========== */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.evf-icon- {
	&captcha::before {
		content: '\e928';
	}

	&password::before {
		content: '\e911';
	}

	&email::before {
		content: '\e914';
	}

	&map-marker::before {
		content: '\e917';
	}

	&flag::before {
		content: '\e915';
	}

	&first-name::before {
		content: '\e91f';
	}

	&last-name::before {
		content: '\e91c';
	}

	&text::before {
		content: '\e906';
	}

	&paragraph::before {
		content: '\e912';
	}

	&dropdown::before {
		content: '\e921';
	}

	&checkbox::before {
		content: '\e927';
	}

	&multiple-choices::before {
		content: '\e919';
	}

	&multiple-choices-radio::before {
		content: '\e919';
	}

	&number::before {
		content: '\e918';
	}

	&website::before {
		content: '\e903';
	}

	&calendar::before {
		content: '\e916';
	}

	&single-item::before {
		content: '\e907';
	}

	&file-upload::before {
		content: '\e920';
	}

	&hidden::before {
		content: '\e91e';
	}

	&phone::before {
		content: '\e900';
	}

	&custom-html::before {
		content: '\e923';
	}

	&section-divider::before {
		content: '\e908';
	}

	&payment::before {
		content: '\e924';
	}

	&payment-summary {
		&::before {
			content: "" !important;
			display: block !important;
			width: 24px;
			height: 24px;
			background-color: #6b6b6b;
			mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="black" d="M20.25 4.223a1.46 1.46 0 0 0-.436-1.038 1.51 1.51 0 0 0-1.064-.435H5.25c-.4 0-.783.158-1.063.435a1.46 1.46 0 0 0-.437 1.038v15.554c0 .388.156.762.437 1.038.28.277.662.435 1.063.435h13.5c.4 0 .783-.158 1.064-.435.28-.276.436-.65.436-1.038zm1.5 15.554a2.96 2.96 0 0 1-.882 2.106 3.01 3.01 0 0 1-2.118.867H5.25c-.793 0-1.555-.31-2.118-.867a2.96 2.96 0 0 1-.882-2.106V4.223c0-.792.318-1.55.882-2.106A3.02 3.02 0 0 1 5.25 1.25h13.5c.793 0 1.555.31 2.118.867a2.96 2.96 0 0 1 .882 2.106z"/><path fill="black" d="M18 6.75a.75.75 0 0 1 0 1.5h-5a.75.75 0 0 1 0-1.5zM18 9.75a.75.75 0 0 1 0 1.5h-5a.75.75 0 0 1 0-1.5zM18 14.25a.75.75 0 0 1 0 1.5H6a.75.75 0 0 1 0-1.5zM18 17.45a.75.75 0 0 1 0 1.5H6a.75.75 0 0 1 0-1.5zM8.75 9.844a.47.47 0 0 0-.469-.469h-.156v.938h.156a.47.47 0 0 0 .469-.47m1.25 0a1.72 1.72 0 0 1-1.719 1.719h-.156v.312a.625.625 0 1 1-1.25 0v-.312h-1.25a.625.625 0 1 1 0-1.25h1.25v-.938h-.156a1.72 1.72 0 1 1 0-3.437h.156v-.313a.625.625 0 1 1 1.25 0v.313h.938a.625.625 0 1 1 0 1.25h-.938v.937h.156A1.72 1.72 0 0 1 10 9.844M6.25 7.656a.47.47 0 0 0 .469.469h.156v-.937h-.156a.47.47 0 0 0-.469.468"/></svg>');
			-webkit-mask-size: contain;
			mask-size: contain;
			-webkit-mask-repeat: no-repeat;
			mask-repeat: no-repeat;
			-webkit-mask-position: center;
			mask-position: center;
			margin: 0 auto 8px;
		}
	}

	&total::before {
		content: '\e904';
	}

	&subtotal::before {
		content: '\e904';
	}

	&img-upload::before {
		content: '\e91d';
	}

	&star::before {
		content: '\e90c';
	}

	&likert::before {
		content: '\e91b';
	}

	&scale-rating::before {
		content: '\e909';
	}

	&signature::before {
		content: '\e913';
	}

	&privacy-policy::before {
		content: '\e910';
	}

	&repeater::before {
		content: '\e90b';
	}

	&range-slider::before {
		content: '\e90d';
	}

	&divider::before {
		content: '\e922';
	}

	&wysiwyg::before {
		content: '\e902';
	}

	&eye::before {
		content: '\e903';
	}

	&coupon::before {
		content: '\e925';
	}

	&yes-no::before {
		content: '\e901';
	}

	&reset::before {
		content: '\e90a';
	}

	&progress {
		&::before {
			content: "" !important;
			display: block !important;
			width: 24px;
			height: 24px;
			background-color: currentColor;
			-webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 2v4"/><path d="M12 18v4"/><path d="M4.93 4.93l2.83 2.83"/><path d="M16.24 16.24l2.83 2.83"/><path d="M2 12h4"/><path d="M18 12h4"/><path d="M4.93 19.07l2.83-2.83"/><path d="M16.24 7.76l2.83-2.83"/></svg>');
			mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 2v4"/><path d="M12 18v4"/><path d="M4.93 4.93l2.83 2.83"/><path d="M16.24 16.24l2.83 2.83"/><path d="M2 12h4"/><path d="M18 12h4"/><path d="M4.93 19.07l2.83-2.83"/><path d="M16.24 7.76l2.83-2.83"/></svg>');
			-webkit-mask-size: contain;
			mask-size: contain;
			-webkit-mask-repeat: no-repeat;
			mask-repeat: no-repeat;
			-webkit-mask-position: center;
			mask-position: center;
			margin: 0 auto 8px;
		}
	}

	&color::before {
		content: '\e926';
	}

	&ai::before {
		content: '\e913';
	}

	&lookup::before {
		content: '\e91a';
	}

	&turnstile,
	&recaptcha,
	&hcaptcha {
		&::before {
			content: '\e917';
		}
	}

	&builder::before {
		content: '\e904';
	}

	&subscription-plan::before {
		content: '\e905';
	}

	&private-note::before {
		content: '\e92d';
	}
}
