/* WPJobster Post New/Edit pages SASS file */

// Layout
.post-new-wrapper {
	position: relative;
	z-index: 10;

	&.post-new-job-wrapper,
	&.post-new-request-wrapper {
		margin-top: -30px;
		margin-bottom: 50px;
	}
}

// Header
.ui.grid.gray-background-full {
	background-color: #f6f7fa;
	border-bottom: 1px solid $borderColor2;
	min-height: 90px;

	// Steps
	.unstackable.steps {
		margin: 0 auto;
		display: flex;
		border: none;

		.step {
			border-right: none;
			background-color: transparent;
			cursor: pointer;
			padding-left: 0;
			padding-right: 0;

			&:after {
				content: none;
			}

			.icon {
				color: $mainTextColor;
				font-size: 20px;
				margin-bottom: 11px;

				@include mobile {
					margin: 0;
				}
			}

			.content {
				@include mobile {
					display: none;
				}

				.title, .description {
					color: $mainTextColor;
				}
				.title {
					.tab-title {
						font-size: 18px;
					}
				}
			}

			&.active{
				.icon {
					color:$mainColor;
				}
				.content {
					.title {
						color: $headlinesColor;
					}
				}
			}

			.title {
				@include breakpoint-down(sm) {
					display: none;
				}
			}

		}
	}

	// Title
	.wpj-main-header.wpj-title-icon {
		margin-left: 14%;
		line-height: 86px;
		margin-bottom: 0;

		@include breakpoint-down(xl) {
			margin-left: 4%;
		}

		@include breakpoint-down(lg) {
			margin-left: 2%;
		}

		@include breakpoint-down(md) {
			margin: 0 auto;
		}

		.edit.icon {
			display: none;
		}
	}
}

// Instructions
.ui.segment.general-instruction-box {
	margin-left: 15%;
	width: 51% ;
	margin-top: 35px;
	border: 1px solid rgba(34,36,38,0.15);
	border-top: 5px solid $mainColor;
	box-shadow: -1px 20px 15px -27px rgb(0 0 0 / 75%);

	@include breakpoint-down(xxl) {
		width: 57%;
	}
	@include breakpoint-down(xl) {
		width: 67%;
		margin-left: 5%;
	}
	@include breakpoint-down(lg) {
		width: 70%;
	}
	@include breakpoint-down(md) {
		width: 90%;
	}
}

.ui.form {

	// Structure
	.post-new-wrapper .tabs-wrapper .tab-wrapper,
	.post-new-no-tab-wrapper .tabs-wrapper {
		position: relative;
		margin: 1rem 0;
		margin-left: 15%;
		padding: 30px 40px;
		border-radius: 3px;
		border: 1px solid rgba(34,36,38,0.15);
		border-top: 5px solid $mainColor;
		box-shadow: 0px 17px 59px -34px rgba(0,0,0,0.75);
		width: 51%;

		@include breakpoint-down(xxl) {
			width: 57%;
		}

		@include breakpoint-down(xl) {
			width: 67%;
			margin-left: 5%;
		}

		@include breakpoint-down(lg) {
			width: 70%;
		}

		@include breakpoint-down(md) {
			width: 90%;
		}

		.tab {
			position: relative;
			display: none;

			&.active {
				display: block;
			}
		}

		.fields {
			position: relative;
			margin-bottom: 40px;

			&.one {
				flex-shrink: 0;

				.field {
					@include breakpoint-up(lg) {
						display: flex;
					}

					label {
						margin-right: 50px;
						white-space: nowrap;

						@include breakpoint-up(lg) {
							text-align: right;
						}

						&:first-of-type {
							display: block;
						}
					}
				}
			}

			&.two {
				flex-shrink: 0;

				.field {
					display: inline-block;
					width: 100%;

					@include breakpoint-up(lg) {
						display: flex;
						flex-basis: 48%;
					}

					&:first-of-type {
						@include breakpoint-up(lg) {
							flex-basis: 80%;
						}

						label {
							display: block;
						}

						.tooltip-handler {
							flex-basis: 78%;
						}

						@include breakpoint-down(lg) {
							display: inline-block;
							width: 100%;
						}
					}

					label {
						@include breakpoint-up(lg) {
							white-space: nowrap;
							margin-right: 50px;
							text-align: right;
						}
					}

				}
			}

			&.three {
				@include breakpoint-up (lg) {
					display: grid;
					grid-template-columns: 64% 36%;
				}

				.field {
					display: inline-block;

					@include breakpoint-up(lg) {
						display: flex;
						width: 100%;
					}

					&:first-of-type {
						@include breakpoint-up(lg) {
							width: 100%;
						}

						label {
							display: block;
							margin-right: 50px;
						}

						@include breakpoint-down(lg) {
							display: inline-block;
						}
					}

					&:last-of-type {
						@include breakpoint-up (lg) {
							margin-left: 212px;
						}
					}

					label {
						white-space: nowrap;
						margin-right: 50px;

						@include breakpoint-up(lg) {
							text-align: right;
						}
					}
				}
			}

			label {
				font-size: 16px;
				line-height: 20px;
				font-weight: 600;
				color: $headlinesColor3;

				@include breakpoint-up(lg) {
					display: none;
					margin-top: 13px;
					width: 161px;
					text-align: right;
					flex-grow: 0;
					flex-shrink: 0;
				}
			}
		}
	}

	// Structure elements
	.post-new-no-tab-wrapper,
	.post-new-wrapper {

		// Controls
		.tab-controls {
			width: 100%;
			height: 1px;
			position: static;

			a {
				font-size: 1rem;
				font-weight: 700;
				height: 2.571rem;
				line-height: 2.571rem;
				padding: 0 2.5rem 0 1.571rem;
				color: $whiteColor;
				position: absolute;
				bottom: -100px;

				&:before {
					content: "";
					position: absolute;
					width: 9px;
					height: 13px;
					top: 0.857rem;
				}
			}

			.prev-button {
				left: -40px;
				border: 2px solid $mainTextColor;
				@include default-shape;
				padding: 0 24px 0 36px;
				color: $mainTextColor !important;
				height: auto !important;

				&:before {
					background-image: url('../images/arrow/prev-arrow.svg') !important;
					background-position: center;
					background-repeat: no-repeat;
					left: 20px;
					top: 11px;
				}
			}

			.next-button {
				right: -40px;
				background: $mainColor;

				&:before {
					background: url('../images/arrow/next-tab-arrow.png');
					right: 19px;
				}
			}
		}

		// Corner image
		.tab-corner-image {
			position: unset;

			img {
				max-width: 253px;
				position: absolute;
				z-index: -1;
				top: auto;
				right: -333px !important;
				bottom: 0;
				left: auto;
			}
		}

		// Instructions popup
		.ui.popup {
			&.calendar {
				z-index: 99;
			}

			&:not([class*="ui popup calendar"]) {
				max-width: 253px;
				width: 253px;
				right: -313px !important;
				left: auto !important;
				top: 0 !important;
				border: 2px solid $mainColor;
				background-color: $mainColorBackground;
				min-height: 42px;
				text-align: left;
				padding: 30px;
				line-height: 28px;
				border-radius: 6px;

				&:before {
					top: 1.5em;
					background: $mainColorBackground;
					box-shadow: -2px 2px 0 0 $mainColor;
				}

				&:after {
					content: '';
					position: absolute;
					background-image: url("../images/misc/info.svg");
					background-position: center;
					background-size: cover;
					background-repeat: no-repeat;
					height: 36px;
					width: 36px;
					border-radius: 50%;
					top: -18px;
					left: calc( 50% - 18px );
				}

				@include breakpoint-down(lg) {
					max-width: 220px;
					right: -265px !important;
					padding: 15px !important;
				}

				@include tablet {
					order: 1;
					position: relative;
					left: unset !important;
					right: unset !important;
					max-width: 100%;
					width: 100%;
					margin-left: 0;
					margin-bottom: 20px;

					&:before, &:after {
						display: none;
					}
				}

				img {
					max-width: 100%;
				}
			}
		}

		// Rejected popup
		.rejected-input {
			border: 1px solid #ff6252;
			-webkit-appearance: none;
			outline: none;
			box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2), 0 0 5px rgba(223, 63, 63, 0.5);

			&.ui.popup:not([class*="ui popup calendar"]) {
				border: 2px solid #ff6252;
				color: #ff6252;

				&:before {
					box-shadow: -2px 2px 0 0 #ff6252;
				}
			}

			~ #rejected_tagsinput {
				border: 1px solid $redColor;
				border-radius: 4px;
				box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2), 0 0 5px rgba(223, 63, 63, 0.5);
			}
		}

		// Rejected border - media
		.rejected-border {
			padding: 0 0;
			border-radius: 3px;
			border: 1px solid #ff6252;
			box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2), 0 0 5px rgba(223, 63, 63, 0.5);

			&.rejected-border-uploader {
				height: 40px;
				border-radius: 6px;
			}
		}

	}

	// Content elements
	.post-new-no-tab-wrapper,
	.post-new-wrapper {
		.tooltip-handler {
			width: 100%;

			@include tablet {
				order: 2;
			}

			.ui.labeled.input {
				.ui.label {
					background: transparent;
					border: 1px solid $grayBackground2;
					padding: 13px;
				}
			}

			// Title
			.job-title {
				font-size: 2em;
				line-height: 1em;
				height: calc(3em + 2px);
				min-height: calc(3em + 2px);
				max-width: 100%;
				padding: 0.5em;
				color: #555657;
				background: transparent;
				border-radius: 6px;

				&::-webkit-input-placeholder {
					font-size: 28px;
				}

				@include breakpoint-down(sm) {
					font-size: 1.5em;

					&::-webkit-input-placeholder {
						font-size: 1em;
					}
				}
			}

			// Price
			.job-fixed-price {
				margin: 0;
				outline: none;
				-webkit-appearance: none;
				-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
				line-height: 1.21428571em;
				padding: 0.67857143em 1em;
				font-size: 1em;
				background: $whiteColor;
				border: 1px solid;
				border-color: rgba(34, 36, 38, 0.15);
				color: rgba(0, 0, 0, 0.87);
				border-radius: 0.28571429rem;
				box-shadow: 0 0 0 0 transparent inset;
				transition: color 0.1s ease, border-color 0.1s ease;
			}

			// Package
			&.post-new-packages-wrapper {
				.packages-table {
					@include default-shape;
					border-top: 0;
					border-left: 0;

					@include breakpoint-down(sm) {
						border: none;
					}

					input {
						font-size: 14px;
					}

					tr {
						text-align: center;
					}

					.ui.field.input.tooltip-handler {
						margin-bottom: 0;
					}

					.empty-package-title {
						border-bottom: none;
					}

					.first-package-title,
					.second-package-title,
					.third-package-title {
						border-top: 1px solid $borderColor2;

						@include breakpoint-down(sm) {
							border: 1px solid $borderColor;
							@include default-shape;
							margin-bottom: 5px;
							background-color: $grayBackground3;
						}
					}

					.first-package-title {
						border-top-left-radius: 6px;
					}

					.third-package-title {
						border-top-right-radius: 6px;
					}

					.package-table-body {
						@include default-shape;

						.package-name-td {
							border-top-left-radius: 6px;
							border-top: 1px solid $borderColor2;
						}

						tr {
							td {
								@include breakpoint-down(sm) {
									border: 1px solid $borderColor;
									background-color: $grayBackground3;
									text-align: left !important;
									@include default-shape;
									margin-bottom: 5px;
								}

								&:first-of-type {
									max-width: 209px;
									text-align: right;
									border-left: 1px solid $borderColor2;
								}

								&:not(:first-child) {
									padding: 0;
								}

								.ui.input input,
								.ui.input input:focus,
								textarea,
								textarea:focus,
								.ui.dropdown {
									border: 0 !important;
									outline: none;
									resize: none;
								}
							}
						}

						.pck-padd-left {
							.ui.labeled.field.input {
								margin-bottom: 0;
							}
							.ui.label {
								background-color: $grayBackground3;
								border-radius: 20px;
								width: 35px;
								height: 35px;
								margin-left: 2px;
								margin-top: 2px;
							}
							.package_price {
								padding-left: 10px;
								padding-right: 0;
							}
						}
					}

					.pck-repeater {
						td {
							.pck-icon-rem {
								cursor: pointer;
								pointer-events: initial;
								color: $redColor;

								&:hover {
									color: #ff0000;
									opacity: 1;
								}
							}

							&:first-of-type {
								border-bottom-left-radius: 6px;
							}
						}
						.pck-center {
							.ui.checkbox {
								width: 17px;
								height: 17px;
							}

							label {
								margin-top: 2px;
							}
						}
						.pck-inp-custom-name {
							font-size: 14px;
							text-align: right;
							font-weight: 600;
							padding-right: 20px;

							@include mobile {
								text-align: left;
							}

							&::placeholder {
								font-size: 14px;
							}
						}
					}
				}

				#add_pck_custom_field {
					color: $mainColor;
					font-weight: 500;
				}
			}

			// Description
			#wp-job_description-editor-container {
				border-right: 2px solid #e5e5e5;
			}

			// Instructions to Buyer
			.post-job-buyer-instructions {
				.buyer-instructions-checkbox {
					width: 100%;
					margin: 10px 0;

					label {
						padding-top: 0;
						line-height: 20px;
					}
				}
			}

			// FAQ
			.faq-wrapper {
				margin-bottom: 40px;

				.title {
					font-weight: 400;

					.icon {
						float: right;
						margin-top: 4px;
					}
				}
			}

			// Video
			.post-job-video-as-first-image {
				.post-job-video-as-first-image-checkbox {
					width: 100%;
					margin: 10px 0;

					label {
						padding-top: 0;
						line-height: 20px;
					}
				}
			}

			// Audio
			.audio-uploader-wrapper {
				.audio-wrapper {
					.audio-new-file-wrapper {
						background-image: url("../images/media/music.svg");
						cursor: pointer;
					}

					.audio-new-file-wrapper.uploading:after {
						content: "";
						background: url("../images/loader/loader-green.svg") no-repeat;
						position: absolute;
						display: block;
						width: 30px;
						height: 30px;
						top: 0;
						right: 0;
					}

					.audio-file-wrapper {
						background-image: url("../images/media/download-file.svg");
					}

					.audio-new-file-wrapper, .audio-file-wrapper {
						position: relative;
						border: 1px solid #dbdeeb;
						border-radius: 6px;
						background-repeat: no-repeat;
						background-position: 50% 30%;
						background-size: 60px 60px;
						height: 180px;
						width: 180px;
						background-color: #f7f8f9;
						padding: 108px 10px 10px;
						font-size: 13px;
						color: $mainTextColor;
						text-align: center;
						display: inline-block;
						margin-right: 20px;
						margin-bottom: 20px;
						overflow: hidden;

						span {
							color: $mainColor;
							font-weight: 600;
						}

						p {
							display: -webkit-box;
							-webkit-line-clamp: 3;
							-webkit-box-orient: vertical;
							overflow: hidden;
							text-overflow: ellipsis;
						}

						&::after {
							display: none;
						}
					}

					.audio-file-wrapper {
						.delete-file.delete-audio {
							display: none;
						}

						&:hover {
							.delete-file.delete-audio {
								display: block;
								color: red;
								font-size: 20px;
								position: absolute;
								top: 7px;
								left: 5px;
								width: 25px;
								height: 25px;
								line-height: 25px;
								cursor: pointer;
								border-radius: 50%;
								background: $whiteColor;
								text-align: center;
							}
						}
					}
				}
			}

			// Attachments
			.uploadifive-button {
				width: 100% !important;
			}

			// Add / Delete
			.add-video, .add-faq {
				float: left;
				color: $mainColor;
				font-weight: 500;
			}

			.add-video {
				margin-top: 5px;
			}

			.add-faq {
				margin-top: -35px;
			}

			.delete-extra, .delete-faq, .delete-video {
				font-size: 14px;
				font-weight: 500;
				color: $secondaryColor;
				float: right;
				margin-bottom: 10px;
				margin-top: 5px;
			}

			.delete-extra-wrapper {
				position: absolute;
				right: 8px;
				bottom: -10px;
			}

			// Extra
			&.extra-fields {
				display: flex;
			}

			// Terms
			.terms-of-services-box {
				background: transparent;
				height: 300px;
				width: 100%;
				overflow: auto;
				padding: 15px;
				font-weight: normal;
				box-sizing: border-box;
				margin-bottom: 10px;

				~ .ui.checkbox {
					padding: 15px;
				}
			}
		}

		// Extra
		&.post-new-job-wrapper {
			.multiple-box {
				margin-left: 212px;

				@include breakpoint-down(lg) {
					margin-left: 0;
				}

				label {
					text-align: left !important;
				}
			}

			.add-extra {
				color: $mainColor;
				font-weight: 500;
			}
		}
	}

}