@import "../less/mixins";

.siteorigin-widget-form {

	margin: 15px 0;

	.siteorigin-widget-field {
		margin: 1em 0;

		label {
			display: block;
			margin-bottom: 3px;
		}

		&:last-child {
			margin-bottom: 0;
		}

		&:first-child {
			margin-top: 0;
		}

		.siteorigin-widget-field-description {
			font-size: 0.9em;
			margin-top: 0.2em;
			color: #999999;
			font-style: italic;
		}

		&.siteorigin-widget-field-separator {
			margin: 1.75em 0;
		}
	}

	.siteorigin-widget-field-repeater {

		.siteorigin-widget-field-repeater-top {
			background: #F0F0F0;
			border: 1px solid #D0D0D0;
			padding: 10px;
			position: relative;

			h3 {
				font-size: 13px;
				margin: 0;

			}
		}

		.siteorigin-widget-field-expand,
		.siteorigin-widget-field-remove {
			width: 14px;
			height: 14px;
			position: absolute;
			top: 50%;
			margin-top: -7px;
			cursor: pointer;
			font-size: 14px;
			line-height: 14px;
			text-align: center;

			&:before {
				font-family: dashicons;
				vertical-align: middle;
				color: #999999;
			}

		}

		.siteorigin-widget-field-expand {
			right: 12px;

			&:before {
				content: "\f140";
			}

			&:hover {
				background: #989fa5;

				&:before {
					color: #FFFFFF;
				}
			}
		}

		.siteorigin-widget-field-remove {
			right: 28px;

			&:before {
				content: '\f158';
			}

			&:hover {
				background: #ff0000;

				&:before {
					color: #FFFFFF;
				}
			}
		}

		.siteorigin-widget-field-repeater-items {
			background: #FCFCFC;
			border: 1px solid #EEEEEE;
			border-top: 0;
			border-bottom: 0;

			.siteorigin-widget-field-repeater-item {
				background: #FCFCFC;
				border-bottom: 1px solid #EEEEEE;

				.siteorigin-widget-field-repeater-item-top {
					padding: 10px;
					cursor: move;
					position: relative;
					background: #F6F6F6;

					h4 {
						font-size: 12px;
						margin: 0;
					}

				}

				h4 {
					font-size: 15px;
					margin: 0;
				}

				&:last-child {
					border-bottom: 0;
				}

				.siteorigin-widget-field-repeater-item-form {
					border-top: 1px solid #EEEEEE;
					display: none;
					padding: 10px;
				}
			}
		}

		.siteorigin-widget-field-repeater-add {
			padding: 7px 10px;
			background: #F0F0F0;
			border: 1px dashed #D0D0D0;
			font-size: 12px;
			line-height: 1em;
			text-align: center;
			cursor: pointer;

			&:hover {
				background: #F4F4F4;
			}
		}

		/* This is for sub level forms */

		.siteorigin-widget-field-repeater {

			.siteorigin-widget-field-repeater-top {
				background: #eaf2f6;
				border-color: #c9d0d4;

				h3 {
					color: #42484b;
				}
			}

			.siteorigin-widget-field-repeater-items {
				background: #f6fdff;
				border-color: #e8eff3;

				.siteorigin-widget-field-repeater-item {
					background: #f8fdff;
					border-bottom-color: #e8eff3;

					.siteorigin-widget-field-repeater-item-top {
						background: #f0f8fc;
					}

					.siteorigin-widget-field-repeater-item-form {
						border-top-color: #e8eff3;
					}
				}
			}

			.siteorigin-widget-field-repeater-add {
				background: #eaf2f6;
				border-color: #c9d0d4;
				color: #42484b;

				&:hover {
					background: #edf5f9;
				}
			}

		}
	}

	.media-field-wrapper {
		position: relative;
		display: block;
		float: left;
		background: #f4f4f4;
		background: -moz-linear-gradient(top,  #f9f9f9 0%, #f2f2f2 100%);
		background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#f2f2f2));
		background: -webkit-linear-gradient(top,  #f9f9f9 0%,#f2f2f2 100%);
		background: -o-linear-gradient(top,  #f9f9f9 0%,#f2f2f2 100%);
		background: -ms-linear-gradient(top,  #f9f9f9 0%,#f2f2f2 100%);
		background: linear-gradient(to bottom,  #f9f9f9 0%,#f2f2f2 100%);
		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#f2f2f2',GradientType=0 );
		border: 1px solid #bbbbbb;

		box-shadow: 0 1px 2px rgba(0,0,0,0.1);

		-webkit-border-radius: 3px;
		-moz-border-radius: 3px;
		border-radius: 3px;

		height: 32px;

		&:hover {
			background: #ffffff;
			background: -moz-linear-gradient(top,  #ffffff 0%, #f7f7f7 100%);
			background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f7f7f7));
			background: -webkit-linear-gradient(top,  #ffffff 0%,#f7f7f7 100%);
			background: -o-linear-gradient(top,  #ffffff 0%,#f7f7f7 100%);
			background: -ms-linear-gradient(top,  #ffffff 0%,#f7f7f7 100%);
			background: linear-gradient(to bottom,  #ffffff 0%,#f7f7f7 100%);
			filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f7f7f7',GradientType=0 );

			box-shadow: 0 1px 2px rgba(0,0,0,0.15);
		}

		> div {
			-moz-box-sizing: border-box;
			-webkit-box-sizing: border-box;
			box-sizing: border-box;
			float: left;
			height: 32px;
		}

		.current{
			padding: 4px;
			border-right: 1px solid #bbb;
			position: relative;

			box-shadow: 1px 0 0 #FFF;

			.title{
				display: none;
				position: absolute;
				bottom: 34px;
				left: 0;
				padding: 4px 12px;
				background: #333;
				color: #CCC;
				font-weight: bold;
				width: auto;
				white-space: nowrap;
			}
		}

		.thumbnail-wrapper{
			border: 1px solid #999;
			line-height: 0;
			box-shadow: 0px 1px 1px #FFF;
			width: 22px;
			height: 22px;

			background: #cfcfcf;
			background: -moz-linear-gradient(top,  #cfcfcf 0%, #dbdbdb 50%, #d1d1d1 51%, #cccccc 100%);
			background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cfcfcf), color-stop(50%,#dbdbdb), color-stop(51%,#d1d1d1), color-stop(100%,#cccccc));
			background: -webkit-linear-gradient(top,  #cfcfcf 0%,#dbdbdb 50%,#d1d1d1 51%,#cccccc 100%);
			background: -o-linear-gradient(top,  #cfcfcf 0%,#dbdbdb 50%,#d1d1d1 51%,#cccccc 100%);
			background: -ms-linear-gradient(top,  #cfcfcf 0%,#dbdbdb 50%,#d1d1d1 51%,#cccccc 100%);
			background: linear-gradient(to bottom,  #cfcfcf 0%,#dbdbdb 50%,#d1d1d1 51%,#cccccc 100%);
			filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cfcfcf', endColorstr='#cccccc',GradientType=0 );

			box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);

			img{
				height: 100%;
				width: 100%;
				box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
			}
		}

		.media-upload-button {
			display: inline-block;
			color: #666;
			text-decoration: none;
			text-shadow: 0 1px 0 #FFF;
			font-weight: 600;
			font-size: 11px;
			padding: 7px 8px 7px 6px;
			outline: none;
			cursor: pointer;
		}

		&:hover .media-upload-button{
			color: #707070;
		}

	}

	.media-remove-button{
		display: none;
		position: absolute;
		top: 0;
		left: 100%;
		text-decoration: none;
		color: #AAA;
		font-size: 11px;
		padding: 6px 0 6px 8px;

		&:hover {
			color: #BC0B0B;
		}
	}

	.sow-select-posts {
		margin-top: 6px;
		position: relative;

		.sow-current-count {
			position: absolute;
			top: -10px;
			right: -10px;
			border-radius: 9px;
			background: #f92700;
			border: 1px solid #da0900;
			display: block;
			line-height: 14px;
			font-size: 7px;
			width: 17px;
			height: 17px;
			text-align: center;
			vertical-align: middle;
			font-weight: bold;
			color: #FFFFFF;
			box-sizing: border-box;
			padding-top: 1px;
		}
	}

	.siteorigin-widget-field-type-widget,
	.siteorigin-widget-field-type-section {

		> label {
			background: #F0F0F0;
			border: 1px solid #D0D0D0;
			padding: 10px;
			display: block;
			margin-bottom: 0;
		}

		.siteorigin-widget-section {
			padding: 10px;
			background: #FCFCFC;
			border: 1px solid #EEEEEE;
			border-top: 0;

			&.siteorigin-widget-section-hide {
				display: none;
			}
		}
	}

	.siteorigin-widget-icon-selector {
		padding: 10px;
		border: 1px solid #D8D8D8;
		background: #FFFFFF;
		.box-shadow(~"0 1px 2px rgba(0,0,0,0.0275)");

		select.siteorigin-widget-icon-family {
			font-size: 11px;
		}

		.siteorigin-widget-icon-icons {

			height: 160px;
			overflow-y: scroll;
			margin-top: 10px;

			.siteorigin-widget-icon-icons-icon {
				.box-sizing(border-box);
				float: left;

				width: 58px;
				height: 48px;
				margin: 3px;
				padding: 4px 0;
				border:1px solid #D0D0D0;
				background: #FFFFFF;

				font-size: 40px;
				overflow: hidden;

				cursor: pointer;
				text-align: center;

				&.siteorigin-widget-active {
					background: #f6fafc;
					border: 1px solid #43aaec;
					color: #078dce;
					.box-shadow(~"0 1px 2px rgba(0,0,0,0.25)");
				}
			}

		}
	}
}

.siteorigin-widgets-query-builder {

	.query-builder-content {
		padding: 20px;

		.query-builder-form-field {
			label {
				span {
					display: block;
					font-size: 13px;
					line-height: 24px;
					color: #666;
				}
			}

			.sow-select-posts {
				margin-top: 2px;
			}

			input[type="text"] {
				width: 400px;
			}

			input[type="number"] {
				width: 150px;
			}

			.sow-order-button {
				display: inline-block;
				width: 19px;
				height: 19px;
				margin: 0 0 -6px 10px;
				cursor: pointer;
				background: url(./img/ordering-icons.png);

				&.sow-order-button-desc {
					background-position: left top;
				}

				&.sow-order-button-asc {
					background-position: left bottom;
				}
			}

			margin-bottom: 10px;
		}
	}

	.media-toolbar-secondary {

		.sow-post-count-message {
			margin-top: 21px;
		}

		.sow-post-selector-summary {
			margin-top: 10px;
			display: block;
			width: 41px;
			height: 41px;
			float: left;
			overflow: hidden;
			background: green;
			margin-right: 10px;

			&:last-child {
				margin-right: 0;
			}
		}
	}

	.sow-post-selector-summary {
		display: block;
		float: left;
		margin: 0 15px 15px 0;

		width: 130px;

		.sow-thumbnail {
			width: 130px;
			height: 130px;

			img {
				width: 100%;
				height: auto;
			}
			margin-bottom: 4px;
		}

		.sow-title {
			height: 2.5em;
			overflow: hidden;
			line-height: 1.2em;
			text-align: center;
		}

		&.sow-post-loading {
			.sow-thumbnail {
				background: url(./img/loading.gif) center center no-repeat #EEEEEE;

				img {
					display: none;
				}
			}
		}

		.sow-remove {
			display: none;
		}
	}

	#sow-post-selector {
		.sow-autocomplete-field {
			text-align: right;
			margin-bottom: 20px;

			input[type=text] {
				width: 320px;
				margin-left: 10px;
			}
		}

		.sow-posts-sortable {

			.ui-state-highlight {
				display: block;
				float: left;
				margin: 0 15px 15px 0;
				background: #F3F3F3;
			}

			.sow-post-selector-summary {
				cursor: move;
				position: relative;

				.sow-remove {
					position: absolute;
					top: -5px;
					right: -5px;
					width: 19px;
					height: 19px;
					z-index: 10;
					text-decoration: none;
					background: #333333;
					text-align: center;

					&:before {
						content: '\f158';
						font: 14px/1 dashicons;
						vertical-align: middle;
						color: #EEEEEE;
					}

					&:hover {

						background: #444444;

						&:before {
							color: #FFFFFF;
						}

					}
				}

				&:hover .sow-remove {
					display: block;
				}
			}

			&:after {
				content: "";
				display: table;
				clear: both;
			}
		}
	}

}

.siteorigin-widget-help-link {
	display: block;
	margin: 1em 0;
}