
//Colors
$wp_admin_color: #222;

//Editor Styles
@import 'tinymce.core';
@import 'tinymce.view';
@import 'link-modal';
@import 'fronted.tinymce';

//Libraries styles
@import '../bower_components/select2/dist/css/select2.min.css';
@import '../bower_components/tipso/src/tipso.min.css';
@import '../bower_components/toastr/toastr.scss';

//Basic
@import 'normalize';
@import 'toggle-switch';
@import 'fontawesome/font-awesome';
@import 'functions';

//jQuery UI
@import 'jquery-ui';
@import 'jquery-ui.structure';
@import 'jquery-ui.theme';

%clear {
	&:after {
        visibility: hidden;
        display: block;
        font-size: 0;
        content: " ";
        clear: both;
        height: 0;
    }
    * html & {
        zoom: 1;
    }
    *:first-child+html & {
        zoom: 1;
    }
}

%button {
	box-shadow: none !important;
	text-shadow: none !important;
	border-radius: 0;
	padding: 5px;
	min-width: 35px;
	height: 35px;
	border: 0;
	background: none $wp_admin_color;
	color: #fff;

	&.active,
	&:hover{
		background: #333;
  		color: #45bbe6;
	}
}

%wp_primary_button {
	background: #00a0d2;
    border-color: #0073aa;
    box-shadow: inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);
    color: #fff;
	display: inline-block;
    text-decoration: none;
    font-size: 13px;
    line-height: 26px;
    margin: 10px;
    padding: 5px 20px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    -webkit-appearance: none;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;

	i{
		vertical-align: middle;
		margin-top: -3px;
		margin-left: -5px;
	}

    &:hover{
		background: #0091cd;
	    border-color: #0073aa;
	    box-shadow: inset 0 1px 0 rgba(120,200,230,.6);
	    color: #fff;
	}

	&:active{
		background: #0073aa;
	    border-color: #005082;
	    color: rgba(255,255,255,.95);
	    box-shadow: inset 0 1px 0 rgba(0,0,0,.1);
	}
}

html,
body{
	&.wa-modal-open{
		overflow: hidden !important;
	}
}

.wa-fronted-selectmenu{
	position: absolute;
	display: none;
	margin-top: -42px;
	z-index: 99;
	font-family: 'Open Sans', sans-serif;

	&:after {
		top: 34px;
		border-color: $wp_admin_color transparent transparent;
		border-width: 8px 8px 0 8px;
		position: absolute;
		left: 50%;
		display: block;
		margin-left: -8px;
		width: 0;
		height: 0;
		border-style: solid;
		content: "";
	}

	&:hover{
		&:after {
			top: 34px;
			border-color: #333 transparent transparent;
		}
	}

	&.show{
		display: block;
		overflow: visible;
	}

	.csstransforms &{
		display: block;
		transition: all 0.2s ease;
		transform: translateY(50px);
		z-index: -1;
		opacity: 0;

		&.show{
			z-index: 1;
			transform: translateY(0px);
			opacity: 1;
		}
	}
}

.edit-acf-field{
	position: absolute;
	display: none;
	@extend %button;
	margin-top: -42px;
	z-index: 99;

	&:after {
		top: 35px;
		border-color: $wp_admin_color transparent transparent;
		border-width: 8px 8px 0 8px;
		position: absolute;
		left: 50%;
		display: block;
		margin-left: -8px;
		width: 0;
		height: 0;
		border-style: solid;
		content: "";
	}

	&:hover{
		&:after {
			top: 35px;
			border-color: #333 transparent transparent;
		}
	}

	&.show{
		display: block;
	}

	.csstransforms &{
		display: block;
		transition: all 0.2s ease;
		transform: translateY(50px);
		z-index: -1;
		opacity: 0;

		&.show{
			z-index: 1;
			transform: translateY(0px);
			opacity: 1;
		}
	}
}

.wa-shortcode-wrap{
	.gallery-item{
		a{
			cursor: pointer;
		}
	}

	&:hover{
		box-shadow: 0px 0px 3px rgba(0,0,0,0.2);
	}
}

.wa-fronted-editor{
	img{
		// -webkit-user-drag: none;
		// user-drag: none;

		&:hover{
			box-shadow: 0px 0px 3px rgba(0,0,0,0.2);
		}
	}

	img.wp-post-image,
	img[class*="wp-image"]{
		cursor: pointer;
	}
}

#wa-fronted-toolbar{
	position: fixed;
	bottom: 0;
	left: 0;
	display: block;
	width: 100%;
	text-align: center;
	font: 400 13px/32px "Open Sans",sans-serif;
	z-index: 159899;

	> button{
		@extend %button;
		background-color: $wp_admin_color;
		padding: 5px 10px;
		text-transform: uppercase;
		font-size: 14px;
		line-height: 2;
		
		i{
		    vertical-align: middle;
		    margin-top: -5px;
		}
	}

	#wa-fronted-save{
		display: none;
		font-weight: 600;
	}
}

.fronted-featured-image-toolbar{
	position: absolute;
	z-index: 99900;
	display: none;

	&.show{
		display: block;
	}

	button{
		@extend %button;
		background-color: $wp_admin_color;
		padding: 5px 10px;
		text-transform: uppercase;
		font-size: 14px;
		line-height: 2;
		display: none;
		
		i{
		    vertical-align: middle;
		    margin-top: -5px;
		}

		&.show{
			display: inline-block;
		}
	}
}

.featured-post-placeholder{
	display: block;
	text-align: center;
	padding: 20px;
	border: 3px dashed #eee;
	color: #eee;

	i{
		font-size: 40px;
		width: 40px;
		height: 40px;
	}
}

#wa-fronted-spinner{
	position: fixed;
	top: 0;
	left: 0;
	display: none;
	width: 100%;
	height: 100%;
	z-index: 999999;
	background-color: rgba(#000, 0.7);
	text-align: center;

	img{
		position: absolute;
		left: 50%;
		top: 50%;
		margin-left: -22px;
		margin-top: -22px;
		background-color: #fff;
		border-radius: 50%;
		padding: 2px;
		box-shadow: 0px 0px 3px rgba(0,0,0,0.2);
	}
}

#acf-dialog{
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	min-height: 360px;
	background: rgba(#000, 0.7);
	z-index: 159900;
	font-family: 'Open Sans', sans-serif !important;

	#close-acf-dialog{
		position: absolute;
		top: 30px;
		right: 30px;
		z-index: 160001;
		@extend %button;

		@include breakpoint(max, 1100px){
			top: 10px;
			right: 10px;
		}
	}

	#acf-dialog-inner{
		position: fixed;
		top: 30px;
		left: 30px;
		right: 30px;
		bottom: 30px;
		z-index: 160000;
		overflow-x: hidden;
		overflow-y: auto;
		box-shadow: 0 5px 15px rgba(#000,.7);
		background-color: #f3f3f3;
		padding-bottom: 60px;

		@include breakpoint(max, 1100px){
			left: 10px;
			right: 10px;
			top: 10px;
			bottom: 10px;
		}

		.acf-fields{
	  		background: #fcfcfc;
	  		border-bottom: 1px solid #ccc;
	  		
	  		.acf-label{
	  			border-bottom: 1px solid #ddd;
	  		}
  		}
	
		.acf-form-submit{
			position: absolute;
			left: 0;
			right: 0;
			bottom: 1px;
			width: 100%;
			display: block;
			background-color: #FCFCFC;
			height: 60px;
			z-index: 100;
			text-align: right;
  			border-top: 1px solid #ddd;

			input{
				margin: 15px;
				text-shadow: none !important;
			}

			.acf-spinner{
				vertical-align: middle;
  				margin-bottom: -25px;
  				margin-right: 10px;
			}
		}
	}
}

#wa-fronted-settings-modal{
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	min-height: 360px;
	background: rgba(#000, 0.7);
	z-index: 159900;
	display: none;
	font-family: 'Open Sans', sans-serif !important;

	.close-wa-fronted-modal{
		position: absolute;
		top: 0;
		right: 0;
		z-index: 160001;
		@extend %button;

		i{
			vertical-align: middle;
    		margin-top: -8px;
		}
	}

	.wa-fronted-modal-inner{
		position: fixed;
		top: 30px;
		bottom: 30px;
		z-index: 160000;
		overflow-x: hidden;
		overflow-y: auto;
		box-shadow: 0 5px 15px rgba(#000,.7);
		background-color: #f3f3f3;
		padding-bottom: 60px;
		left: 30%;
		right: 30%;

		@include breakpoint(max, 1100px){
			left: 10px;
			right: 10px;
			top: 10px;
			bottom: 10px;
		}

		#wa-fronted-settings{
			font-family: 'Open Sans', sans-serif;
			color: #444;

			.fieldgroup{
				background: #fcfcfc;
	  			border-bottom: 1px solid #ccc;
				padding: 15px;
				display: block;
				clear: both;

				&.half{
					width: 50%;
					float: left;
					clear: none;
				}

				@include breakpoint(max, 700px){
					padding: 10px;
				}

				label{
					display: block;
					clear: both;
					margin-bottom: 5px;
					font-size: 14px;
				    line-height: 1.4;
				    font-weight: 600;
				}

				input{
					font-family: 'Open Sans', sans-serif;
					font-size: 14px;
				    line-height: 1.4;
				    border-radius: 0;
				    background-color: #f3f3f3;
				    border: 1px solid #eaeaea;
				    color: #707070;

				    &:focus{
				    	background-color: #fcfcfc;
				    	font-weight: 600;
				    }
				}

				&.checkbox-fieldgroup{
					> label {
						@include fontawesome('\f096', before);
						cursor: pointer;

						&:before{
							margin-right: 5px;
							color: grey;
						}
					}

					> input {
						display: none;

						&:checked + label{
							@include fontawesome('\f046', before);
							
							&:before{
								color: green;
							}
						}
					}
				}
			}
		}

		.wa-fronted-modal-footer{
			position: absolute;
			left: 0;
			right: 0;
			bottom: 1px;
			width: 100%;
			display: block;
			background-color: #FCFCFC;
			height: 60px;
			z-index: 100;
			text-align: right;
  			border-top: 1px solid #ddd;

			button{
				@extend %wp_primary_button;
			}
		}
	}
}

#wa-fronted-revisions-modal{
	position: fixed;
	bottom: 40px;
	z-index: 159900;
	display: none;
	font-family: 'Open Sans', sans-serif !important;
	width: 100%;

	.wa-fronted-revisions-modal-inner{
		@extend %clear;
		position: relative;
		background: none $wp_admin_color;
		padding: 10px;
		color: #fff;
		width: 100%;
		max-width: 360px;
		margin: 0 auto;

		.close-wa-fronted-modal{
			position: absolute;
			top: 0;
			right: 0;
			z-index: 160001;
			@extend %button;
			line-height: 30px;

			i{
				vertical-align: middle;
	    		margin-top: -8px;
			}
		}

		.revision-input-container{
			@extend %clear;

			h4{
				font-family: 'Open Sans', sans-serif !important;
				margin: 0 0 5px;
				font-weight: 400;
				font-size: 14px;
			}

			button{
				font-size: 14px;
				width: 15%;
				display: inline-block;
				padding: 0;
				line-height: 35px;
				height: 35px;
				text-align: center;

				&#wa-previous-revision{
					float: left;
				}
				
				&#wa-next-revision{
					float: right;
				}

				&.disabled{
					visibility: hidden;
				}
			}

			input{
				font-size: 14px;
				width: 70%;
				padding: 0;
				line-height: 35px;
				height: 35px;
				display: inline-block;
				float: left;
				font-family: 'Open Sans', sans-serif !important;
				border: 0;
				text-align: center;
				background: none transparent;
				color: #45bbe6;
				font-weight: 600;
			}
		}
	}
}

#wa-fronted-edit-shortcode{
	position: absolute;
	margin-top: -42px;
	display: none;
	top: 0;

	&.show{
		display: block;
	}

	.csstransforms &{
		display: block;
		transition: transform 0.2s ease, opacity 0.2s ease;
		transform: translateY(50px);
		z-index: -1;
		opacity: 0;

		&.show{
			z-index: 1;
			transform: translateY(0px);
			opacity: 1;
		}
	}

	&.arrow-under{
		&:after{
			top: 35px;
			border-color: $wp_admin_color transparent transparent;
			border-width: 8px 8px 0 8px;
			position: absolute;
			left: 50%;
			display: block;
			margin-left: -8px;
			width: 0;
			height: 0;
			border-style: solid;
			content: "";
		}
	}

	&.arrow-over{
		margin-top: -34px;

		&:before{
			top: -8px;
			border-color: transparent transparent $wp_admin_color;
			border-width: 0 8px 8px 8px;
			position: absolute;
			left: 50%;
			display: block;
			margin-left: -8px;
			width: 0;
			height: 0;
			border-style: solid;
			content: "";
		}
	}

	button{
		transition: background-color .2s ease-in,color .2s ease-in;
		@extend %button;
		background-color: $wp_admin_color;
		padding: 5px 10px;
		text-transform: uppercase;
		font-size: 14px;
		line-height: 2;

		i{
		    vertical-align: middle;
		    margin-top: -5px;
		}
	}
}

#wa-fronted-img-drag-ghost{
	position: fixed;
	z-index: 999;
	width: 75px;
	height: auto;
	opacity: 0.85;
	box-shadow: 0px 0px 10px rgba(#000, 0.2);
	filter: grayscale(100%);
}

#wa-fronted-edit-shortcode{
	.wa-fronted-edit-shortcode-inner{
		@extend %clear;

		#wa-fronted-edit-shortcode-button{
			display: none;
			float: left;

			&.show{
				display: inline-block;
			}
		}

		.shortcode-input-wrapper{
			@extend %clear;
			width: 0px;
			overflow: hidden;
			display: inline-block;
			float: left;

			input{
				display: inline-block;
				float: left;
				width: 80%;
				padding: 5px 10px;
				line-height: 1.7;
				font-size: 14px;
				border: 0;
				background-color: #333;
				color: #fff;
				font-family: 'Open Sans', sans-serif;
			}

			button{
				display: inline-block;
				float: left;
				width: 20%;
			}

			&.show{
				width: 300px;
			}
		}
	}
}

.media-modal.wp-core-ui{
	ul{
		list-style: none;
	}
}
#wa-fronted-settings .select2-container,
.select2-container.wa_fronted_select{
	.select2-choice{
		@extend %button;
  		padding: 0.4em 2.1em 0.4em 1em !important;
		min-width: 200px;
		font-size: 1.5rem;
		line-height: 1.5;
		height: auto;

		.select2-arrow{
			border: 0;
			border-radius: 0;
			background: none transparent;
			width: auto;

			b{
				background: none transparent;
				@include icon('\f347', before);
				padding: 5px;
			    width: auto;
			    text-align: center;
			    margin-right: 2px;
			}
		}
	}

	&.select2-container-multi{
		.select2-choices{
			margin: 0;
			border: 0;
			padding: 0;
			box-shadow: none !important;
			background: none $wp_admin_color !important;

			input{
		  		padding: 0.4em 2.1em 0.4em 1em !important;
				min-width: 200px;
				font-size: 1.5rem;
				margin: 0 !important;
				border: 0 !important;
				line-height: 1.5;
				box-shadow: none !important;
				text-shadow: none !important;
				border-radius: 0;
				height: 35px;
				border: 0;
				background: none $wp_admin_color !important;
				color: #fff;
			}

			.select2-search-choice{
				line-height: 1.5;
				border: 0;
				box-shadow: none;
  				background: none lighten(#333, 10%);
  				color: #45bbe6;
  				font-size: 15px;

  				.select2-search-choice-close{
  					background: none transparent;
					font-size: 1.5rem;
					line-height: 1.5;
					top: 1px;
					height: auto;
					color: #fff;
  					@include icon('\f335', before);

  					&:hover{
  						color: #45bbe6;
  					}
  				}
			}
		}
	}

	&.select2-dropdown-open{
		.select2-choice{
			.select2-arrow{
				b{
					@include icon('\f343', before);
				}
			}
		}
	}
}

.select2-drop-mask{
	z-index: 160000;
}

.select2-drop.wa-fronted-select2{
	border: 0;
	background: none #333;
	font-size: 1.4rem;
	border-radius: 0;
  	color: #fff;
  	padding: 0;
  	font-family: 'Open Sans', sans-serif;
	z-index: 160001;

	.select2-search{
		padding: 0;

		input{
			border: 0;
			background: lighten(#333, 10%);
  			color: #45bbe6;
  			padding: 0.4em 2.1em 0.4em 1em !important;
  			height: auto;
			font-size: 1.5rem;
  			line-height: 1.5;
		}
	}

	ul{
		padding: 0;
		margin: 0;

  		li{
  			border: 0 !important;
  			margin: 0 !important;
  			padding: 0.4em 2.1em 0.4em 1em !important;

  			&:hover,
  			&.select2-highlighted{
  				background: lighten(#333, 10%);
  				color: #45bbe6;
  			}

  			&.select2-no-results{
				background: none #333;
				color: #fff;
				font-style: italic;
				padding-right: 0.4em !important;

				.wa-add-tax-btn{
					font-style: normal;
					padding: 5px 10px;
				    background: #00a0d2;
				    border-color: #0073aa;
				    box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.5), 0 1px 0 rgba(0, 0, 0, 0.15);
				    color: #fff;
				    display: inline-block;
				    text-decoration: none;
				    font-size: 13px;
				    line-height: 13px;
				    margin-left: 5px;
				    border-width: 1px;
				    border-style: solid;
				    -webkit-appearance: none;
				    border-radius: 3px;
				    white-space: nowrap;
				    box-sizing: border-box;

				    i{
				    	width: auto;
				    	height: auto;
				    	font-size: 13px;
				    	line-height: 13px;
				    	margin: 0;
				    }

					&:hover{
					    background: #0091cd;
					    border-color: #0073aa;
					    box-shadow: inset 0 1px 0 rgba(120, 200, 230, 0.6);
					    color: #fff;
				    }

				    &:active{
				    	background: #0073aa;
					    border-color: #005082;
					    color: rgba(255, 255, 255, 0.95);
					    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
				    }
				}
  			}
		}
	}
}

#ui-datepicker-div.wa-fronted-datepicker{
	border-radius: 3px;
	border: 0;
	box-shadow: 0 1px 5px rgba(#000, 0.2);
	padding: 0;
	overflow: hidden;

	.ui-datepicker-header{
		border-radius: 0;
		background: $wp_admin_color;
		color: #fff;
		border: 0;
		font-weight: normal;
		padding: 0;
		line-height: 2;

		.ui-datepicker-prev,
		.ui-datepicker-next{
			@extend %button;
			cursor: pointer;
			top: 0;
			text-align: center;
			height: auto;
			line-height: 2;
			padding: 0px 5px;

			> .ui-icon{
				display: none;
			}

			&:before{
				margin-top: -3px;
				text-align: center;
			}
		}

		.ui-datepicker-prev{
			left: 0;
			@include icon('\f341', before);
		}
		.ui-datepicker-next{
			right: 0;
			@include icon('\f345', before);
		}

		.ui-datepicker-title{
			line-height: 2;
		}
	}

	.ui-datepicker-calendar{
		border: 0;
		margin-bottom: 0;

		thead{
			background: #fcfcfc;
  			border-bottom: 1px solid #ddd;
		
			th{
				font-weight: normal;
				padding: 0.3em 0.3em;
			}
		}

		tbody{
			background-color: #f3f3f3;

			tr{
				td{
					border: 0;

					a{
						border: 0;
						background: transparent none;
						color: #707070;

						&.ui-state-highlight{
							color: $wp_admin_color;
							background-color: #E6E6E6;
						}

						&.ui-state-active{
							font-weight: bold;
							color: $wp_admin_color;
							background-color: #E6E6E6;
						}

						&:hover{
							background-color: #ECECEC;
						}
					}
				}
			}
		}
	}

	.ui-timepicker-div{
		border-top: 1px solid #ddd;
		font-size: 15px;
		
		dt{
			font-weight: normal;
			
			&.ui_tpicker_time_label{
				padding-top: 7px;	
			}
		}

		.ui_tpicker_time{
			font-weight: bold;
		}

		dl{
			dt{
				padding-left: 10px;
			}

			dd{
				padding-top: 7px;
			}
		}

		.ui-slider{
			border-radius: 3px;
			background: #f3f3f3 none;
    		border: 1px solid #eaeaea;

    		.ui-slider-handle{
    			border-radius: 3px;
    			cursor: grab;
    			background:	$wp_admin_color none;
    			border: 0;

    			&:active{
    				cursor: grabbing;
    				background:	#333;
    			}
    		}
		}
	}

	.ui-datepicker-buttonpane{
		background: #fcfcfc none;
		border-top: 1px solid #eaeaea;
		padding: 0;

		button{
			@extend %wp_primary_button;
			margin: 5px;

			&.ui-datepicker-current{
				background:	#E0E0E0;
				border-color: #B5B5B5;
				box-shadow: inset 0 1px 0 rgba(#fcfcfc, 0.5), 0 1px 0 rgba(#000, 0.15);
				color: $wp_admin_color;

				&:hover{
					background:	#D2D2D2;
				}

				&:active{
					background-color: #B5B5B5;
					border-color: #9A9A9A;
					box-shadow: inset 0 1px 0 rgba(#000, 0.5), 0 1px 0 rgba(#000, 0);
				}
			}
		}
	}
}

.toast,
.tipso_bubble{
	border-radius: 0 !important;
	font-family: 'Open Sans', sans-serif !important;

	.toast-title{
		line-height: 1.2;
		font-weight: 600;
		font-size: 15px;
	}

	.toast-message{
		line-height: 1.2;
		font-weight: 300;
		font-style: italic;
		font-size: 13px;
	}

	.toast-close-button:hover, 
	.toast-close-button:focus {
		background: none transparent !important;
	}
}

#toast-container{
	> div {
		box-shadow: 0 0 12px rgba(#000, 0.4);
		
		&:hover{
			box-shadow: 0 0 12px rgba(#000, 0.8);
		}
	}
}