/**
 * admin.scss
 * General FlashToolkit admin styles.
 */

/**
 * Imports
 */
@import "mixins";
@import "variables";

/**
 * Styling begins
 */
#portfolio_options,
#flash-toolkit-portfolio-data {
	overflow: hidden;
}

#portfolio_options,
#flash-toolkit-portfolio-data,
.flash-toolkit {
	.panel-wrap {
		overflow: hidden;
	}

	ul.ft-tabs {
		margin: 0;
		width: 20%;
		float: left;
		line-height: 1em;
		padding: 0 0 10px;
		position: relative;
		background-color: #fafafa;
		border-right: 1px solid #eee;
		box-sizing: border-box;

		&:after {
			content: "";
			display: block;
			width: 100%;
			height: 9999em;
			position: absolute;
			bottom: -9999em;
			left: 0;
			background-color: #fafafa;
			border-right: 1px solid #eee;
		}

		li {
			margin: 0;
			padding: 0;
			display: block;
			position: relative;

			a {
				margin: 0;
				padding: 10px;
				display: block;
				box-shadow: none;
				text-decoration: none;
				line-height: 20px !important;
				border-bottom: 1px solid #eee;

				&:before {
					@include iconbeforedashicons( "\f107" );
				}
			}

			&.general_options {
				a:before {
					content: "\f107";
				}
			}

			&.description_options {
				a::before {
					content: '\f103';
				}
			}

			&.active {
				a {
					color: #555;
					position: relative;
					background-color: #eee;
				}
			}
		}
	}
}

#flash-toolkit-pageheader-data,
#flash-toolkit-portfolio-data {
	.inside {
		margin: 0;
		padding: 0;
	}
}

.flash_toolkit_options_panel,
.panel {
	padding: 0;
	color: #555;

	.form-field {
		.flash-toolkit-help-tip {
			font-size: 1.4em;
		}
	}
}

.flash_toolkit_options_panel p,
.flash_toolkit_options_panel fieldset.form-field {
	margin: 0 0 9px;
	font-size: 12px;
	padding: 5px 9px;
	line-height: 24px;

	&:after {
		content: ".";
		display: block;
		height: 0;
		clear: both;
		visibility: hidden;
	}
}

.flash_toolkit_options_panel .checkbox {
	width: auto;
	margin: 3px 0;
	vertical-align: middle;
}

.flash_toolkit_options_panel {
	min-height: 175px;
	box-sizing: border-box;

	p {
		margin: 9px 0;
	}

	p.form-field,
	fieldset.form-field {
		padding: 5px 20px 5px 162px !important; /** Padding for aligning labels left - 12px + 150 label width **/
	}

	label,
	legend {
		float: left;
		width: 150px;
		padding: 0;
		margin: 0 0 0 -150px;

		.req {
			font-weight: 700;
			font-style: normal;
			color: $red;
		}
	}

	.description {
		padding: 0;
		margin: 0 0 0 7px;
		clear: none;
		display: inline;
	}

	.description-block {
		margin-left: 0;
		display: block;
	}

	textarea,
	input,
	select {
		margin: 0;
	}

	textarea {
		height: 3.5em;
		line-height: 1.5em;
		vertical-align: top;
	}

	input[type="text"],
	input[type="email"],
	input[type="number"],
	input[type="password"] {
		width: 50%;
		float: left;
	}

	input.button {
		width: auto;
		margin-left: 8px;
	}

	select {
		float: left;
	}

	input[type="text"].short,
	input[type="email"].short,
	input[type="number"].short,
	input[type="password"].short,
	.short {
		width: 50%;
	}

	.sized {
		width: auto !important;
		margin-right: 6px;
	}

	.options_group {
		border-top: 1px solid white;
		border-bottom: 1px solid #eee;

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

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

		fieldset {
			margin: 9px 0;
			font-size: 12px;
			padding: 5px 9px;
			line-height: 24px;

			label {
				width: auto;
				float: none;
			}

			ul {
				float: left;
				width: 50%;
				margin: 0;
				padding: 0;

				li {
					margin: 0;
					width: auto;

					input {
						width: auto;
						float: none;
						margin-right: 4px;
					}
				}
			}

			ul.ft-radios {
				label {
					margin-left: 0;
				}
			}
		}
	}

	&.padded {
		padding: 1em;
	}

	.select2-container {
		float: left;
	}
}

#portfolio_options,
#flash-toolkit-portfolio-data {
	.panel-wrap {
		background: #fff;
	}

	.flash_toolkit_options_panel {
		float: left;
		width: 80%;

		.flash-toolkit-radios {
			display: block;
			float: left;
			margin: 0;

			li {
				display: block;
				padding: 0 0 10px 0;

				input {
					width: auto;
				}
			}
		}
	}
}

img.help_tip {
	margin: 0 0 0 9px;
	vertical-align: middle;
}

.postbox img.help_tip {
	margin-top: 0;
}

.postbox .flash-toolkit-help-tip {
	margin: 0 0 0 9px;
}

/**
 * Tooltips
 */
.tips {
	cursor: help;
	text-decoration: none;
}

img.tips {
	padding: 5px 0 0 0;
}

#tiptip_holder {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	z-index: 9999999;
}

#tiptip_holder {
	&.tip_top {
		padding-bottom: 5px;

		#tiptip_arrow_inner {
			margin-top: -7px;
			margin-left: -6px;
			border-top-color: #333;
		}
	}

	&.tip_bottom {
		padding-top: 5px;

		#tiptip_arrow_inner {
			margin-top: -5px;
			margin-left: -6px;
			border-bottom-color: #333;
		}
	}

	&.tip_right {
		padding-left: 5px;

		#tiptip_arrow_inner {
			margin-top: -6px;
			margin-left: -5px;
			border-right-color: #333;
		}
	}

	&.tip_left {
		padding-right: 5px;

		#tiptip_arrow_inner {
			margin-top: -6px;
			margin-left: -7px;
			border-left-color: #333;
		}
	}
}

#tiptip_content,
.ft_error_tip {
	color: #fff;
	font-size: .8em;
	max-width: 150px;
	background: #333;
	text-align: center;
	border-radius: 3px;
	padding: .618em 1em;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);

	code {
		padding: 1px;
		background: #888;
	}
}

#tiptip_arrow,
#tiptip_arrow_inner {
	position: absolute;
	border-color: transparent;
	border-style: solid;
	border-width: 6px;
	height: 0;
	width: 0;
}

.ft_error_tip {
	max-width: 20em;
	line-height: 1.8em;
	position: absolute;
	white-space: normal;
	background: #d82223;
	margin: 1.5em 1px 0 -1em;
	z-index: 9999999;

	&::after {
		content: '';
		display: block;
		border: 8px solid #d82223;
		border-right-color: transparent;
		border-left-color: transparent;
		border-top-color: transparent;
		position: absolute;
		top: -3px;
		left: 50%;
		margin: -1em 0 0 -3px;
	}
}

/**
 * Help Tip
 */
.flash-toolkit-help-tip {
	color: #666;
	display: inline-block;
	font-size: 1.1em;
	font-style: normal;
	height: 16px;
	line-height: 16px;
	position: relative;
	vertical-align: middle;
	width: 16px;

	&:after {
		@include icon_dashicons( "\f223" );
		cursor: help;
	}
}

/**
 * Small screen optimisation
 */
@media only screen and (max-width: 1280px) {
	.flash_toolkit_options_panel {
		.description {
			display: block;
			clear: both;
			margin-left: 0;
		}

		.short,
		input[type=text].short,
		input[type=email].short,
		input[type=number].short,
		input[type="password"].short,
		.dimensions_field .wrap {
			width: 80%;
		}
	}
}

/**
 * Optimisation for screens 900px and smaller
 */
@media only screen and (max-width: 900px) {
	#portfolio_options ul.portfolio_data_tabs,
	#flash-toolkit-portfolio-data ul.portfolio_data_tabs {
		width: 10%;
	}

	#portfolio_options .flash_toolkit_options_panel,
	#flash-toolkit-portfolio-data .flash_toolkit_options_panel {
		width: 90%;
	}

	#portfolio_options ul.portfolio_data_tabs li a,
	#flash-toolkit-portfolio-data ul.portfolio_data_tabs li a {
		position: relative;
		text-indent: -999px;
		padding: 10px;

		&:before {
			position: absolute;
			top: 0;
			right: 0;
			bottom: 0;
			left: 0;
			text-indent: 0;
			text-align: center;
			line-height: 40px;
			width: 100%;
			height: 40px;
		}
	}
}

/**
 * Optimisation for screens 782px and smaller
 */
@media only screen and (max-width: 782px) {
	#portfolio_options .checkbox,
	#flash-toolkit-portfolio-data .checkbox {
		width: 25px;
	}
}

@media only screen and (max-width: 500px) {
	.flash_toolkit_options_panel label,
	.flash_toolkit_options_panel legend {
		float: none;
		width: auto;
		display: block;
		margin: 0;
	}

	.flash_toolkit_options_panel fieldset.form-field,
	.flash_toolkit_options_panel p.form-field {
		padding: 5px 20px 5px 20px !important;
	}
}

/**
 * Select2
 */
.select2-drop {
	z-index: 999999 !important;
}
.select2-container-multi .select2-choices .select2-search-field input {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	padding: 3px 5px;
	width: 100% !important;
}
.select2-container {
	line-height: 1.85em;
	font-size: 14px;
}
