@import "../../../../css/partials/base";

$color-lima: #2ED022;

$media-size-small: "(max-width : 736px)";
$media-size-medium: "(max-width : 980px)";

@mixin media-small {
	@media all and (#{$media-size-small})  {
		@content;
	}
}

@mixin media-medium-or-print {
	@media all and (#{$media-size-medium}), print  {
		@content;
	}
}

#navigation_wizard_wrapper {

	/************************************************************/
	/*********************** WIZARD FRAME ***********************/
	/************************************************************/

	background-color: $white;

	.iconography {
		&-small {
			margin-top: -3px;	// To not to alter container's height
			font-size: 14px;
			width: 14px;
			height: 14px;
		}

		&-medium {
			font-size: 1rem;
			width: 1rem;
			height: 1rem;
		}

		&-large {
			font-size: 1.25rem;
			width: 1.25rem;
			height: 1.25rem;
		}

		&-xlarge {
			font-size: 2.5rem;
			width: 2.5rem;
			height: 2.5rem;
		}

		&-help {
			color: $manatee;

			&:hover {
				color: $shark2;
			}
		}

		&-button-left {
			margin-right: 0.5rem;
		}
	}

	.flex-main-container {
		display: flex;
		min-height: calc(100vh - 204px);
	}

	.navigation-header {
		height: 64px;
		display: flex;
		position: relative;
		justify-content: space-between;
		box-shadow: inset 0 -1px 0 0 $french-gray2,
			0 1px 4px 0 rgba($woodsmoke, 0.24);

		.nav-title h4 {
			font-size: 18px;
			font-weight: normal;
			color: $woodsmoke;
			margin: 23px 0 0 24px;;
		}

		.actions .monster-button {
			min-width: 74px;
		}
	}

	.left-content {
		width: 280px;
		flex: 0 0  auto;

		.nav {
			margin: 33px 0 22px 1.5rem;

			ol {
				margin-left: 1rem;
			}

			.fa {
				float: left;
				position: relative;
				top: 2px;
			}

			.fa-circle {
				top: 5px;
				font-size: 9px !important;
				height: 8px;
				width: 10px;
				right: 20px;
				margin: 0 3px 3px 0;
			}

			.fa-check-circle,
			.fa-exclamation-triangle {
				height: 1rem;
				font-size: 1rem;
			}

			.fa-check-circle {
				color: $color-lima;
				right: 22px;
			}

			.fa-exclamation-triangle {
				right: 23px;
			}

			.description {
				color: $midgray2;
				font-size: 12px;
				line-height: 18px;
				position: relative;
				right: 1px;
				width: 208px;
				margin-top: 12px;
			}

			.step {
				margin-bottom: 24px;
				cursor: not-allowed;

				.fa,
				.description {
					display: none;
				}

				&.completed .fa-check-circle,
				&.visited .fa-circle,
				&.selected:not(.invalid) .fa-circle,
				&.invalid .fa-exclamation-triangle,
				&.selected .description {
					display: block;
				}

				&.visited,
				&.completed,
				&.selected,
				&.invalid {
					padding-left: 6px;
				}

				&.visited,
				&.completed {
					cursor: pointer;
				}

				&.selected {
					cursor: default;

					li {
						font-weight: bold !important;
					}

					.fa-circle {
						color: $primary-color;
					}
				}

				&.visited {
					li {
						font-style: italic;
					}

					.fa-circle {
						color: $warning-color;
					}
				}

				&.invalid .fa-exclamation-triangle {
					color: $warning-color;
				}
			}
		}
	}

	.right-content {
		background-color: $athens-gray;
		border-bottom: 1px solid $input-border-color;
		border-left: 1px solid $input-border-color;
		flex-grow: 1;
		min-height: calc(100vh - 204px);

		.monster-loading-view.no-background {
			margin-top: 0;
		}
	}

	.footer {
		margin-left: 280px;
		border-left: 1px solid $input-border-color;
		height: 70px;

		.actions {
			float: right;
			margin-top: 16px;
		}

		.fa {
			margin-left: 8px;
		}
	}

	.actions {
		margin: 0.75rem 1.5rem 0.75rem 0;

		.monster-button {
			background: linear-gradient(-180deg, $white 0%, $athens-gray 100%);
			border: 1px solid $french-gray2;
			color: $midgray2;
			min-width: 74px;
			margin-left: 0.75rem;
		}
	}

	#next {
		background: $primary-color;
		border: 1px solid #006bca;
		height: 38px;
		color: $woodsmoke;
	}

	#next,
	.back {
		min-width: 62px;
	}

	#clear {
		padding: 30px 20px;
		color: $midgray2;
	}

	#done {
		background: $color-lima;
		color: #071F05;
	}

	#navigation_wizard_save .iconography-button-left {
		color: $color-lima;
	}

	.monster-button {
		border-radius: 2px;
		font-size: 14px;
	}

	@media print {
		.navigation-header {
			display: none;
		}

		.left-content {
			display: none;
		}

		.right-content {
			margin: 0;
			border: none;
		}

		.footer {
			display: none;
		}
	}

	/************************************************************/
	/*********************** WIZARD STEPS ***********************/
	/************************************************************/
	.wizard-step {
		color: $woodsmoke;
		padding: 2rem 1.5rem;

		.input-hidden {
			display: none;
		}

		.help-tip {
			display: inline-block;
			margin-left: 0.5rem;

			&.help-tip-section, &.help-tip-button {
				margin-left: 0.75rem;
			}

			&.help-tip-button {
				margin-top: 9px;
			}
		}

		.text-success, .text-danger {
			.iconography-medium {
				margin-top: -2px;
			}
		}

		.text-success {
			color: $success-color;
		}

		.text-danger {
			color: $danger-color;
		}

		.text-block {
			margin-bottom: 1rem;
		}

		.monster-button {
			background: linear-gradient(-180deg, $foreground-primary-color 0%, $athens-gray 100%);

			&:hover {
				background: linear-gradient(-180deg, $athens-gray 0%, $white-lilac 100%);
			}

			&.step-action {
				min-width: 2.375rem;	// To override monster-button's default min-width
				height: 2.375rem;
				margin-left: 0.75rem;
				padding: 0.5rem;
			}
		}

		.remove-item-button {
			width: 38px;
			height: 38px;
			padding: 0;
			margin-left: 0.5rem;
			color: $midgray2;

			.iconography-medium {
				margin-left: -6px;
				margin-top: -3px;
			}

			&:hover:not([disabled]) {
				color: $danger-color;
			}
		}

		.btn-group {
			height: 38px;

			.monster-button {
				border-radius: 0;

				&:first-of-type {
					border-top-left-radius: 2px;
					border-bottom-left-radius: 2px;
				}

				&:last-of-type {
					border-top-right-radius: 2px;
					border-bottom-right-radius: 2px;
				}
			}

			label.monster-button {
				margin-bottom: 0;
				display: inline-block;
			}
		}

		.radio-button:checked + .monster-button {
			background: #dbdbde;
			color: $woodsmoke;
		}

		.input-box.iconography-input-left {
			position: relative;
			width: 100%;

			input {
				box-sizing: border-box;
				width: 100%;
				padding: 0.75rem 2.5rem 0.75rem 0.75rem;
				font-size: 0.875rem;
				line-height: 0.875rem;
			}

			.iconography {
				position: absolute;
				top: 11px;
				right: 0.75rem;
				color: $manatee;
			}
		}

		.step-title {
			padding-bottom: 1.5rem;
			font-size: 23px;
			line-height: 1.875rem;
			color: $woodsmoke;
		}

		.monster-button.step-action {
			min-width: 2.375rem;	// To override monster-button's default min-width
			height: 2.375rem;
			margin-left: 0.75rem;
			padding: 0.5rem;
		}

		.step-section {
			margin-top: 1rem;

			.section-title {
				margin-top: 0;
			}
		}

		.section-title {
			margin-top: 1rem;
			margin-bottom: 1.5rem;
			padding-bottom: 0.75rem;
			border-bottom: solid 1px $french-gray2;
			line-height: 1rem;
			font-size: 1rem;
			font-weight: 600;
			color: $woodsmoke;

			&.section-title-numbered {
				counter-increment: section_title_counter;

				&:before {
					content: counter(section_title_counter) ".\0000a0";
				}
			}

			.help-tip {
				color: $midgray2;
				cursor: pointer;

				&:hover {
					color: $woodsmoke;
				}

				.iconography-medium {
					margin-top: -0.25rem;
				}
			}

			.tooltip {
				font-weight: normal;
			}
		}

		.section-subtitle {
			margin-top: 0.5rem;
			font-weight: 600;
		}

		.flex-container {
			display: flex;

			&.flex-justify-end {
				justify-content: flex-end;
			}

			.flex-initial {
				flex: 0 0 initial;

				&:not(.flex-container):not(.flex-row-container) {
					display: block;
				}
			}

			.flex-fit {
				display: block;
				flex: 1;

				&:not(.flex-container):not(.flex-row-container) {
					display: block;
				}
			}
		}

		.flex-row-container {
			@extend .flex-container;

			flex-wrap: wrap;
			margin-left: -0.75rem;
			margin-right: -0.75rem;

			&.flex-align-top {
				// Align items to top, to not stretch to the row's height
				align-items: flex-start;
			}

			&.flex-align-bottom {
				// Align items to bottom, to not stretch to the row's height
				align-items: flex-end;
			}

			[class^="flex-item"],
			[class*=" flex-item"] {
				flex: 0 0 auto;
				box-sizing: border-box;
				padding: 0 0.75rem 1.5rem 0.75rem;
			}

			.flex-item-1 {
				width: 100%;
			}

			.flex-item-2 {
				width: 50%;
			}

			.flex-item-3 {
				width: 33.3333%;
			}

			.flex-item-3-2 {
				width: 66.6667%;
			}

			.flex-item-4 {
				width: 25%;
			}

			.flex-item-4-3 {
				width: 75%;
			}

			.flex-item-5 {
				width: 20%;
			}

			.flex-item-6 {
				width: 16.6666%;
			}

			@include media-medium-or-print {
				.flex-item-2 {
					width: 100%;
				}

				.flex-item-3, .flex-item-4 {
					width: 50%;
				}

				.flex-item-3-2, .flex-item-4-3 {
					width: 100%;
				}

				.flex-item-5 {
					width: 33.3333%;
				}
			}

			@include media-small {
				.flex-item-3 {
					width: 100%;
				}

				.flex-item-5 {
					width: 50%;
				}
			}
		}

		.step-body {
			counter-reset: section_title_counter;

			label {
				// Keep all the pseudo-classes together, or they will be interpreted as descendants if any whitespace is between them
				&:not(.monster-checkbox):not(.monster-checkbox-large):not(.monster-switch):not(.monster-button):not(.label-button):not(.field-foot-notice):not(.form-field):not(.monster-invalid) {
					margin-bottom: 0.5rem;
					line-height: 14px;
				}

				&.monster-checkbox-large.prepend-label > span {
					padding-right: 1rem;
					margin-right: 1.25rem;
				}

				&.label-button {
					align-self: center;
					margin-right: 1rem;
					margin-bottom: 0;
				}

				&.field-foot-notice {
					margin-top: 0.25rem;
					margin-bottom: 0;
					line-height: 1.25rem;
					font-size: 0.75rem;
					color: $midgray2;
				}

				&.form-field {
					margin-bottom: 0;
					line-height: 14px;

					> input,
					> select,
					> textarea,
					> .chosen-container,
					> .file-selector,
					> .input-box {
						margin-top: 0.5rem;
					}

					> select {
						display: block;
						width: 100%;
					}
				}
			}

			input, select {
				box-sizing: border-box;
				margin-bottom: 0;
				min-height: 38px;
				height: 38px;
			}

			textarea {
				display: block;
				box-sizing: border-box;
				width: 100%;
				margin-bottom: 0;
				padding: 0.75rem;
			}

			.chosen-container.chosen-container-single {
				// Make chosen dropdown to fill container width
				width: auto !important;
				display: block;

				.chosen-single {
					height: 38px;

					span {
						font-size: 14px;
						line-height: 38px;
					}
				}

				.chosen-drop {
					min-width: 100%;

					.chosen-search input[type="text"] {
						height: auto;
					}
				}

				.monster-country-item-flag {
					margin-right: 0.75rem;
					width: 18px;
					max-height: 20px;
				}
			}

			.file-selector {
				display: flex;
				position: relative;	// To display error messages properly

				input {
					&[type="text"] {
						display: block;
						flex: 1;
						width: auto;
						min-width: 80px;
						padding-left: 0.75rem;
						padding-right: 0.75rem;
						border-right: none;
						border-top-right-radius: 0;
						border-bottom-right-radius: 0;
						cursor: pointer;
						white-space: nowrap;
						text-overflow: ellipsis;
					}
					&[type="file"] {
						// If display: none is used, Safari might disable this input
						display: block;
						width: 0;
						height: 0;
					}
				}

				button {
					flex: initial;
					border-top-left-radius: 0;
					border-bottom-left-radius: 0;
					white-space: nowrap;
					text-overflow: ellipsis;
				}

				.monster-invalid {
					top: 38px;
				}
			}

			.input-append.input-block-level {
				display: flex;

				button:first-child {
					flex: initial;
					border-right: none;
					border-top-right-radius: 0;
					border-bottom-right-radius: 0;
					font-weight: 600;

					&:disabled,
					&[disabled=disabled] {
						border-color: $french-gray2;
						color: $midgray2;
					}
				}

				input:not(:first-child) {
					flex: 1;
					border-top-left-radius: 0;
					border-bottom-left-radius: 0;
				}
			}

			.ui-widget {
				display: block;
				height: 38px;

				input {
					display: block;
					width: 100%;
					height: 30px;
					margin-top: 0.25rem;
					margin-bottom: 0.25rem;
				}
			}
		}

		&.wizard-step-review {
			[class^="field-value-"],
			[class*=" field-value-"] {
				color: $woodsmoke;
				font-weight: 600;

				.iconography-medium {
					margin-right: 0.5rem;
				}
			}

			.field-label-horizontal,
			.field-value-horizontal,
			.section-subtitle {
				padding-bottom: 1rem;
				line-height: 1.25rem;
			}

			.field-label-horizontal {
				color: $woodsmoke;
				letter-spacing: 0px;
			}

			.section-body {
				padding-bottom: 0.75rem;
			}

			@include media-medium-or-print {
				.field-value-horizontal:not(.field-value-multiple) {
					width: 50%;
				}
			}

			@media print {
				padding: 0;

				.edit-step,
				.monster-button {
					display: none;
				}

				.print-nobreak {
					page-break-inside: avoid;
				}

				// Some elements that use display:flex might be truncated on page breaks in Firefox.
				// This class sets them to display:block to avoid that behavior on print.
				// See https://stackoverflow.com/a/45440750/806975
				.print-block {
					display: block;
				}
			}
		}
	}
}

/*****************************************************************/
/**************** WIZARD INSIDE FULL-SCREEN MODAL ****************/
/****************************************************************/

.modal-full-screen-wrapper .modal-content #navigation_wizard_wrapper {
	.header .actions {
		margin-right: 2rem;
	}

	.right-content {
		// TODO: Use flexbox to prevent using viewport units and specific calculations
		min-height: calc(100vh - 137px);
	}
}
