@import './prefixer.less';

// Shortcodes list
.ns-shortcode-list {
	position: fixed;
	z-index: 100002;
	left: 0;
	right: 0;
	top: 10vh;
	max-height: 90vh;
	height: auto;
	width: 50%;
	margin-left: auto;
	margin-right: auto;
	background-color: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 3px 12px rgba(0, 0, 0, 0.1);
	padding: 20px;
	&-h {
	}
	&-title {
		line-height: 30px;
		margin: 0 0 20px;
	}
	&-closer {
		position: absolute;
		right: 10px;
		top: 10px;
		width: 40px;
		height: 40px;
		line-height: 40px;
		font-size: 30px;
		text-align: center;
		cursor: pointer;
		opacity: 0.5;
		transition: opacity 0.3s;
	}
	&-closer:hover {
		opacity: 1;
	}
	&-list {
		margin: 0;
		&:before,
		&:after {
			content: '';
			display: table;
		}
		&:after {
			clear: both;
		}
	}
	&-item {
		float: left;
		display: table;
		width: 50%;
		height: 80px;
		margin: 0;
		padding: 0 20px 0 62px;
		position: relative;
		overflow: hidden;
		cursor: pointer;
		background-color: #f5f5f5;
		border: 1px solid #fff;
		box-sizing: border-box;
		transition: border 0.3s;
		&-h {
			display: table-cell;
			vertical-align: middle;
		}
		&-icon {
			position: absolute;
			top: 24px;
			left: 18px;
		}
		&-title {
			font-size: 14px;
			font-weight: 600;
		}
		&-description {
			font-size: 12px;
			line-height: 16px;
			margin-top: 5px;
			color: #999;
		}
	}
	&-item:hover {
		border-color: #47BFA9;
	}
}

// Elements shortcode builder
.ns-builder {
	position: fixed;
	z-index: 100001;
	left: 50%;
	top: 10vh;
	max-height: 85%;
	overflow: auto;
	width: 600px;
	margin-left: -300px;
	background-color: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 3px 12px rgba(0, 0, 0, 0.1);
	&-header {
		padding: 15px 30px;
		background-color: #f5f5f5;
	}
	&-title {
		font-size: 20px;
		line-height: 30px;
		color: #222;
	}
	&-closer {
		position: absolute;
		right: 10px;
		top: 10px;
		width: 40px;
		height: 40px;
		line-height: 40px;
		font-size: 30px;
		text-align: center;
		cursor: pointer;
		opacity: 0.5;
		transition: opacity 0.3s;
	}
	&-closer:hover {
		opacity: 1;
	}
	&-footer {
		padding: 15px;
		background-color: #f5f5f5;
		border-top: 1px solid #e5e5e5;

		& .ns-builder-btn {
			padding: 0 20px;
			line-height: 34px;
			height: 36px;
			margin-right: 4px;
		}
	}
}

// Elements forms
.ns-form {

	&:before,
	&:after {
		content: '';
		display: table;
	}
	&:after {
		clear: both;
	}

	&-control {
		width: 100%;
		padding: 0 15px 15px;
		box-sizing: border-box;
		float: left;

		&-title {
			font-size: 14px;
			font-weight: 600;
			margin-bottom: 4px;
		}
		&-description {
			font-size: 12px;
			line-height: 16px;
			margin-top: 3px;
			color: #999;
		}

		&-field {
			input[type="text"],
			select {
				width: 100%;
			}
			textarea {
				width: 100%;
				resize: vertical;
			}
		}

		&.type_attach_image,
		&.type_attach_images {
			.ns-imgattach {
				&:before,
				&:after {
					content: '';
					display: table;
				}
				&:after {
					clear: both;
				}
				&-list {
					margin: 0;
					li {
						position: relative;
						display: block;
						float: left;
						overflow: hidden;
						width: 80px;
						height: 80px;
						margin: 0 6px 6px 0;
						border: 1px solid #ddd;
						background: #fff;

						.ns-imgattach-delete {
							cursor: pointer;
							position: absolute;
							right: 25px;
							top: 25px;
							width: 30px;
							height: 30px;
							line-height: 30px;
							font-size: 24px;
							text-align: center;
							text-decoration: none;
							background: rgba(0, 0, 0, 0.7);
							color: #fff;
							opacity: 0;
							transition: opacity 0.3s;
						}
						&:hover .ns-imgattach-delete {
							opacity: 1;
						}

						img {
							width: 100%;
							height: 100%;
						}
					}
				}
				&-add {
					display: block;
					float: left;
					text-align: center;
					text-decoration: none;
					font-size: 30px;
					line-height: 80px;
					height: 80px;
					width: 80px;
					background-color: #f5f5f5;
					border: 1px solid #ddd;
					color: #999;
					transition: border 0.3s, color 0.3s;
				}
				&-add:hover {
					border-color: #00a0d2;
					color: #00a0d2;
				}
			}
		}
		&.type_colorpicker {
			width: 50%;
			& .wp-picker-active {
				// Fixing wp-color-picker-alpha visual changes
				white-space: nowrap;
				a {
					width: 0;
				}
			}
		}
		&.type_vc_link {
			textarea {
				display: none;
			}
			.ns-linkdialog {
				line-height: 30px;

				strong {
					margin-left: 10px;
				}
				span {
					margin-left: 5px;
				}
			}
		}
		&.type_ui_slider {

			.ui_slider_field {
				display: inline-block;
				width: 20%;
			}

			.ui-slider {
				display: inline-block;
				width: 75%;
				margin-left: 3%;
				border: none;
				position: relative;
				text-align: left;
				border-radius: 4px;
				height: 0.8em;
			}
			.ui-slider .ui-slider-handle {
				position: absolute;
				z-index: 2;
				width: 1.2em;
				height: 1.2em;
				cursor: default;
				top: -.3em;
				margin-left: -.6em;
				outline: 0;
				border-radius: 4px;
			}
			.ui-slider .ui-slider-range {
				position: absolute;
				z-index: 1;
				font-size: .7em;
				display: block;
				border: 0;
				background-position: 0 0;
				top: 0;
				height: 100%;
				outline: 0;
				border-radius: 4px;
			}

			.ui-slider.ui-widget-content {
				background: #eeeeee;
			}
			.ui-slider.ui-widget-content .ui-widget-header {
				background: #47bfa9 !important;
				color: #ffffff;
				font-weight: bold;
			}

			.ui-state-default,
			.ui-widget-content .ui-state-default,
			.ui-widget-header .ui-state-default {
				border: 1px solid #cccccc;
				background: #f6f6f6;
			}
			.ui-state-hover,
			.ui-widget-content .ui-state-hover,
			.ui-widget-header .ui-state-hover,
			.ui-state-focus,
			.ui-widget-content .ui-state-focus,
			.ui-widget-header .ui-state-focus {
				border: 1px solid #47bfa9;
				background: #def4f0;
				font-weight: bold;
				color: #369d8a;
			}
			.ui-state-active,
			.ui-widget-content .ui-state-active,
			.ui-widget-header .ui-state-active {
				border: 1px solid #47bfa9;
				background: #def4f0;
				font-weight: bold;
				color: #369d8a;
			}
		}
		&.type_dropdown {
		}
		&.type_checkboxes {
		}
		&.type_textarea {
		}
		&.type_html {
		}
		&.type_textfield {
		}
	}

	// Hiding "NooTheme" button. Need to rework architecture to allow nested editors.
	input[id*="_content_nootheme"] {
		display: none;
	}
}

.ns-tabs {
	&-list {
		font-size: 14px;
		line-height: 19px;
		padding: 0 15px;
		background-color: #f5f5f5;
		box-shadow: 0 -1px 0 #e5e5e5 inset;
		&:before,
		&:after {
			content: '';
			display: table;
		}
		&:after {
			clear: both;
		}
	}
	&-item {
		float: left;
		white-space: nowrap;
		padding: 12px 15px;
		cursor: pointer;
		border-radius: 3px 3px 0 0;
		transition: background 0.3s, color 0.3s;
		&:hover {
			background-color: rgba(0, 0, 0, 0.04);
		}
		&.active {
			cursor: default;
			background-color: #fff;
		}
	}
	&-sections {
		max-height: 550px;
		overflow-x: hidden;
		overflow-y: auto;
	}
	&-section {
		padding: 20px 15px 10px;
		overflow: hidden;
	}
	&-section-h {
		display: flex;
		flex-wrap: wrap;
	}
}

// TinyMCE Extensions

// Quicktags
#qt_content_nootheme {
	width: 30px;
	text-indent: -10000px;
	background: url(../../buttons/icon.png) 50% 50% no-repeat;
	background-size: 20px 20px;
}

@media (max-width: 1300px) {
	.ns-shortcode-list {
		width: 80%;
	}
}

@media (max-width: 700px) {
	.ns-builder {
		left: 20px;
		right: 20px;
		width: auto;
		margin-left: 0;
	}

	.ns-form-control {
		width: 100% !important;
	}
}

// Some style need to have effect in VC's panel so we left it here instead of in one of above groups.
.ns-checkbox,
.ns-radio {
	display: inline-block;
	margin-right: 10px;
}

.ns-item-icon {
	width: 32px;
	height: 32px;
	display: inline-block;
	background-color: transparent;
}
.vc_element-icon[class*="fa-"] {
	background-color: #47BFA9;
	background-image: none !important;
	color: #fff;
	border-radius: 4px;
}
.ns-item-icon[class*="fa-"],
.vc_element-icon[class*="fa-"] {
	text-align: center;
	transition: background-color 0.3s ease 0s;
	text-rendering: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	&:before {
		font-family: "fontawesome";
		font-size: 20px;
		font-style: normal;
		font-weight: normal;
		line-height: 32px;
	}
}
