// ------------------------------------------------------------------------------------------------
// XTS DASHBOARD
// ------------------------------------------------------------------------------------------------

// ------------------------------------------
// GENERAL STYLES
// ------------------------------------------

.xts-options {

	*,
	*:before,
	*:after {
		-webkit-box-sizing: border-box;
		-moz-box-sizing: border-box;
		box-sizing: border-box;
	}

	a {
		text-decoration: none;
	}

	img {
		max-width: 100%;
		height: auto;
		vertical-align: middle;
	}

	&.xts-dashboard {
		-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);
		box-shadow: 0 1px 1px rgba(0,0,0,.04);

		.xts-fields-tabs {
			display: flex;
		}
	}

	// .xts-hidden {
	// 	display: none;
	// }

	.xts-fields-section {
		min-height: calc(100% - 48px);
	}

	.xts-active-section {
		animation: wd-fadeIn .6s ease both;
	}
}

// ------------------------------------------
// DASHBOARD
// ------------------------------------------

.toplevel_page_xtemos_options {

	#wpbody-content {

		> *:not(.wrap):not(.woodmart-msg):not(#setting-error-tgmpa) {
			@extend %dashboard-hide-all;
		}

		> .woodmart-msg,
		> #setting-error-tgmpa {
			margin-top: 10px;
			margin-bottom: 15px;
			margin-left: 2px;
		}
	}
}

body {

	&.toplevel_page_woodmart_dashboard {
		overflow-y: scroll;
	}
}

.toplevel_page_woodmart_dashboard {

	#wpbody-content {

		// .wrap {
		// 	display: flex;
		// 	flex-direction: column;
		// 	height: calc(100vh - 57px);
		// }

		// .woodmart-wrap-content {
		// 	flex-grow: 1;
		// }

		> *:not(.wrap) {
			@extend %dashboard-hide-all;
		}
	}
}

.xts-options-form {

	> *:not(.xts-options-form-row):not(.woodmart-msg):not(#setting-error-tgmpa) {
		@extend %dashboard-hide-all;
	}
}

.xts-options-form-row {
	margin-top: 20px;

	> .xts-col {
		flex-grow: 1;
		margin-bottom: 20px;
	}
}

//**** WHITE LABEL ****//

.toplevel_page_xtemos_options,
.toplevel_page_woodmart_dashboard {

	&.menu-top {

		.wp-menu-image {
			display: flex;
			align-items: center;
			justify-content: center;

			img {
				padding: 0 !important;
				max-width: 20px;
				max-height: 20px;
			}
		}
	}
}

//**** EXTENDS ****//

// @extend %dashboard-hide-all;

%dashboard-hide-all {
	display: none;
}

// ------------------------------------------
// DASHBOARD HEADER
// ------------------------------------------

.xts-options-header {
	position: relative;
	z-index: 50;
	display: flex;
	align-items: center;
	padding: 25px 20px;
	border-bottom: 3px solid #464646;
	background-color: #131313;
	color: #FFF;

	h2, h3 {
		margin-top: 0;
		margin-bottom: 0;
		color: inherit;
	}
}

.xts-options-theme-data {
	display: flex;
	align-items: baseline;
	margin-right: 35px;
	// color: #FFF;

	.rtl & {
		margin-right: 0;
		margin-left: 35px;
	}
}

.xts-options-theme-name {
	position: relative;
	margin-right: 20px;
	padding-left: 70px;
	color: #FFF;
	font-size: 30px;
	line-height: 1;

	&:before {
		content: "";
		position: absolute;
		top: 50%;
		left: 5px;
		display: block;
		width: 50px;
		height: 50px;
		background-image: url(../images/theme-admin-icon.svg);
		background-size: 50px 50px;
		background-repeat: no-repeat;
		-webkit-transform: translateY(-50%);
		transform: translateY(-50%);
	}

	.rtl & {
		margin-right: 0;
		margin-left: 20px;
		padding-right: 70px;
		padding-left: 0;

		&:before {
			right: 5px;
			left: auto;
		}
	}
}

// ------------------------------------------
// NOTICE
// ------------------------------------------

.xts-notice {
	padding: 15px;
	border: none;
	border-radius: 4px;
	background-color: #F7F7F7;
	box-shadow: none;

	a {
		color: inherit;
		text-decoration: underline;
		font-weight: 600;

		&:hover {
			opacity: .8;
		}
	}
}

.xts-notice-top {
	margin-right: -20px;
	margin-left: -20px;
	padding: 8px 35px 8px 20px;
	border-bottom: 1px solid;

	&.xts-info {
		border-color: transparentize($woodmart-notice-info-text, 0.92);
	}

	&.xts-success {
		border-color: transparentize($woodmart-notice-success-text, 0.92);
	}

	&.xts-warning {
		border-color: transparentize($woodmart-notice-warning-text, 0.92);
	}

	&.xts-error {
		border-color: transparentize($woodmart-notice-critical-text, 0.92);
	}
}

.xts-notice,
.xts-notice-top {

	&.xts-info {
		background-color: $woodmart-notice-info;
		color: $woodmart-notice-info-text;
	}

	&.xts-success {
		background-color: $woodmart-notice-success;
		color: $woodmart-notice-success-text;
	}

	&.xts-warning {
		background-color: $woodmart-notice-warning;
		color: $woodmart-notice-warning-text;
	}

	&.xts-error {
		background-color: $woodmart-notice-critical;
		color: $woodmart-notice-critical-text;
	}
}

// ------------------------------------------
// SECTION
// ------------------------------------------

.xts-sections {
	display: flex;
	flex-grow: 1;
	flex-direction: column;
	justify-content: flex-start;
	padding: 0 20px 0 20px;
	background: #FFF;
}

.xts-section-icon {

	img {
		display: block;
	}
}

.xts-section-title {
	position: relative;
	margin-right: -20px;
	margin-bottom: 30px;
	margin-left: -20px;
	padding-top: 18px;
	padding-right: 20px;
	padding-bottom: 18px;
	padding-left: 20px;
	border-bottom: 1px solid $xts-option-border-color;
	background-color: #F3F3F3;

	h3 {
		position: relative;
		margin: 0;
		text-transform: uppercase;
		font-size: 18px;
	}
}

//**** DUPLICATED TITLES ****//

[data-id="notices_section"],
[data-id="plugins_section"],
[data-id="buttons_section"],
[data-id="api_integrations_section"],
[data-id="shop_section"] {

	.xts-section-title {
		display: none;

		+ .xts-fields-wrapper {
			top: 32px;
		}
	}

	.xts-group-title {

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

// ------------------------------------------
// FIELD
// ------------------------------------------

.xts-fields-wrapper {
	position: sticky;
	top: 52px;
	display: flex;
	flex-wrap: wrap;
	margin-right: -15px;
	margin-bottom: -32px;
	margin-left: -15px;
}

.xts-field {
	position: relative;
	display: flex;
	flex-grow: 1;
	flex-basis: 100%;
	margin-bottom: -1px; // NOTE HIDE BORDER BOTTOM IN FIRST FIELD
	// &:not(:first-child) {
	// 	margin-top: 30px;
	// }
	margin-bottom: 30px;
	padding-right: 15px;
	padding-left: 15px;
	animation: wd-fadeIn .6s ease both;

	// margin-bottom: 30px;

	// &:not(:last-child) {
	// 	// margin-bottom: 30px;

	// 	> div {
	// 		// padding-bottom: 30px;
	// 		border-bottom: 1px solid $xts-option-border-color;
	// 	}
	// }

	// > div {
	// 	// padding-bottom: 30px;
	// 	border-bottom: 1px solid $xts-option-border-color;
	// }

	label {
		display: flex;
		align-items: center;
		margin-bottom: 5px;
		// padding-bottom: 5px;
		color: #333;
		font-weight: 600;
		font-size: 14px;
		cursor: default;
	}

	.hide {
		display: none;
	}

	.xts-field-description {
		display: block;
		margin-top: $xts-option-space;
		margin-bottom: 0;
		font-weight: 400;
	}

	&.xts-notice-control {

		&:not(:last-child) {
			margin-bottom: 0 !important; // NOTE IF NOTICE FIELD IS IN THE END
		}

		.xts-option-control {
			border: none !important;
		}
	}

	> div {
		border-bottom: 1px solid var(--xts-option-border-color);
	}

	// &.xts-col-6 {

	// 	> div {
	// 		flex-basis: 50%;
	// 	}
	// }
}

.xts-dashboard {

	.xts-field {
		// margin-bottom: 30px;

		// > div {
		// 	border-bottom: 1px solid var(--xts-option-border-color);
		// }

		&.xts-col-6 {

			> div {
				flex-basis: 50%;
			}
		}
	}

	// .xts-group-title {
	// 	margin-top: -31px;
	// }
}

.xts-builder-wpb {

	.xts-negative_gap-field,
	[data-id="plugins_section"] .xts-fields-group + .xts-group-title,
	[data-id="plugins_section"] .xts-fields-group + .xts-group-title + .xts-fields-group {
		display: none;
	}
}

.xts-option-title {
	flex: 1 0 30%;
	padding-right: 20px;
	padding-bottom: 30px;

	.xts-custom_fonts-control &,
	.xts-advanced_typography-field & {
		display: none;
	}

	.rtl & {
		padding-right: 0;
		padding-left: 20px;
	}
}

.xts-option-control {
	flex: 0 1 100%;
	padding-bottom: 30px;

	> div:not(:first-child) {
		margin-top: $xts-option-space;
	}
}

// ------------------------------------------
// FIELDS GROUP
// ------------------------------------------

.xts-group-title,
.xts-fields-group {
	flex-basis: 100%;
}

.xts-group-title {
	position: relative;
	display: flex;
	flex-grow: 1;
	flex-basis: 100%;
	margin-top: -31px;
	margin-right: -5px;
	margin-bottom: 30px;
	margin-left: -5px;
	padding: 18px 20px 18px 20px;
	border-color: $xts-option-border-color !important;
	border-top: 1px solid;
	border-bottom: 1px solid;
	background-color: #F3F3F3;
	color: #23282D;
	text-transform: uppercase;
	font-weight: 600;
	font-size: 18px;
}

.xts-fields-group {
	display: flex;
	flex-wrap: wrap;
	// margin-right: -15px;
	// margin-left: -15px;

	// &:not(:last-child) {
	// 	margin-bottom: 30px;
	// }
}

// ------------------------------------------
// SAVE SETTINGS
// ------------------------------------------

.xts-options-actions {
	position: sticky;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: row;
	justify-content: flex-end;
	// margin-top: 20px;
	margin-right: -20px;
	margin-left: -20px;
	padding: 6px 20px;
	border-top: 1px solid $xts-option-border-color;
	border-bottom: 1px solid $xts-option-border-color;
	background-color: #EEE;

	button {

		&:not(:last-child) {
			margin-right: $xts-option-space / 2;
		}
	}

	.rtl & {

		button {

			&:not(:last-child) {
				margin-right: 0;
				margin-left: $xts-option-space / 2;
			}
		}
	}
}

.xts-reset-options-btn {
	border: 1px solid #CCC !important;
	background: #F7F7F7;
	line-height: 1;
}

// ------------------------------------------------------------------------------------------------
// RESPONSIVE
// ------------------------------------------------------------------------------------------------

@mixin R-MD-UP__helpers {

	.xts-link-color-field {

		.xts-option-control {
			display: flex;
		}

		.xts-option-with-label {
			margin-top: 0 !important;
			margin-right: 20px;

			> span {
				display: block;
				margin-bottom: 5px;
			}
		}

		.rtl & {

			.xts-option-with-label {
				margin-right: 0;
				margin-left: 20px;
			}
		}
	}
}

@mixin R-MD-DOWN__helpers {

	.xts-field {
		flex-wrap: wrap;

		div.xts-option-title {
			margin-bottom: 20px;
			padding-bottom: 0;
			width: 100%;
			border-bottom: none !important;
		}
	}
}