/**
 * 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';
	}

	&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: '\e90f';
	}

	&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';
	}
}