.cx-vui-component--has-macros {
	> .cx-vui-component__control {
		display: flex;
		position: relative;
		align-items: flex-start;
		flex-wrap: wrap;
		> input,
		> textarea,
		> select {
			flex: 0 0 calc(100% - 32px);
		}
	}
}

.cx-vui-component.cx-vui-component--mini-label {
	padding: 5px 0 !important;
}

.jet-engine-exclude-empty-toggle {
	cursor: pointer;
	margin: 5px 0 0;
	display: flex;
	font-size: 12px;
	color: #7B7E81;
	input {
		margin: 1px 5px 0 0;
	}
}

.cx-vui-component {
	&--disabled {
		opacity: 0.6;
		pointer-events: none;
	}
}

.cx-vue-list-table {
	.cols-4 .list-table-heading__cell,
	.cols-4 .list-table-item__cell {
		flex: 0 0 25%;
		&.cell--id {
			flex: 0 0 60px;
			width: 60px;
			padding-right: 0;
		}
		&.cell--name {
			flex: 0 0 calc(50% - 60px);
			width: calc(50% - 60px);
			max-width: calc(50% - 60px);
		}
		&.cell--actions {
			display: flex;
			justify-content: flex-end;
		}
	}
}

.jet-engine-copy-query-id {
	display: flex;
	justify-content: center;
	align-items:center;
	gap: 3px;
	cursor: copy;
	svg {
		display: block;
		visibility:hidden;
		width: 16px;
		height: 16px;
	}
	&:hover {
		svg {
			visibility: visible;
		}
	}
}

.jet-engine-query-builder-heading {
	display: flex;
	padding: 20px 0 20px;
	align-items: center;
	justify-content: space-between;
	.cx-vui-component {
		padding: 0;
		&__meta {
			padding-right: 10px;
		}
	}
}

.cx-vui-component--has-ai-popup {
	.cx-vui-component__control {
		position: relative;
	}
}

.jet-engine-query-builder-fullscreen {
	#adminmenumain,
	#wpadminbar,
	.cpt-header > .notice,
	#wpbody-content > .notice,
	.jet-engine-edit-page__actions-delete {
		display: none;
	}

	#wpcontent {
		margin-left: 0;
	}
}

.jet-ai-query {
	&__trigger {
		position: absolute;
		z-index: 10;
		right: 8px;
		top: 8px;
		border: 1px solid #DCDCDD;
		padding: 6px;
		background: rgba( 255,255,255,.7 );
		cursor: pointer;
		border-radius: 4px;
		&-tip {
			background: #23282D;
			padding: 4px;
			font-size: 12px;
			line-height: 14px;
			border-radius: 3px;
			position: absolute;
			text-align: center;
			bottom: 45px;
			color: #fff;
			font-weight: normal;
			width: 104px;
			left: 50%;
			margin-left: -52px;
			box-sizing: border-box;
			visibility: hidden;
			pointer-events: none;
			opacity: 0;
			transition: all 100ms;
			&:after {
				position: absolute;
				top: 100%;
				left: 50%;
				margin-left: -5px;
				content: '';
				width: 0;
				height: 0;
				border-style: solid;
				border-width: 5px 5px 0 5px;
				border-color: #23282D transparent transparent transparent;
			}
		}
		svg {
			display: block;
			path {
				fill: #7B7E81;
			}
		}
		&:hover {
			background: #fff;
			.jet-ai-query__trigger-tip {
				visibility: visible;
				opacity: 1;
				bottom: 35px;
			}
			svg {
				path {
					fill: #23282D;
				}
			}
		}
	}
	&__popup {
		position: fixed;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 9999;
	}
	&__content {
		background: #fff;
		padding: 30px;
		border: 1px solid #ececec;
		box-shadow: 0 10px 26px rgba(35,40,45,.3);
		width: 900px;
		max-width: 90vw;
		border-radius: 6px;
		position: relative;
		max-height: 90vh;
		overflow: auto;
		.cx-vui-component {
			padding: 0;
			display: block;
			&__meta,
			&__control {
				max-width: 100% !important;
				padding: 5px 0;
				.cx-vui-component__label {
					color: #7B7E81;
					font-weight: normal;
				}
			}
		}
	}
	&__header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 0 15px;
		&-notice {
			flex: 1 1 auto;
			b {
				display: inline-block;
				margin: 0 0 0 10px;
				background: #23282d;
				color: #fff;
				line-height: 16px;
				padding: 4px 10px;
				border-radius: 12px;
			}
		}
	}
	&__generated-notice {
		padding: 5px 0;
		font-style: italic;
		color: #7B7E81;
	}
	&__close {
		padding: 2px;
		cursor: pointer;
		svg {
			display: block;
			path {
				fill: #DCDCDD;
			}
		}
		&:hover {
			svg {
				display: block;
				path {
					fill: #7B7E81;
				}
			}
		}
	}
	&__error {
		color: #c92c2c;
		padding: 10px;
		display: flex;
		gap: 6px;
		align-items: flex-start;
		background: rgba(201,44,44,.1);
		border-radius: 3px;
		font-weight: bold;
		line-height: 20px;
		margin: 7px 0 0 0;
		svg {
			flex: 0 0 20px;
			path {
				fill: currentColor;
			}
		}
	}
	&__submit {
		padding: 5px 0;
		display: flex;
		gap: 15px;
		align-items: center;
	}
	&__load {
		font-style: italic;
		color: #7B7E81;
	}
	&__info{
		padding: 15px 0 0 0;
		&-header {
			display: flex;
			align-items: center;
			gap: 8px;
			color: #23282D;
			font-size: 15px;
			line-height: 20px;
			font-weight: bold;
		}
		&-list {
			padding: 0 0 0 19px;
			li {
				color: #7B7E81;
				list-style: disc;
			}
		}
		&-prompt {
			cursor: pointer;
			border-bottom: 1px dashed currentColor;
		}
	}
	&__license-warning {
		position: absolute;
		left: 5px;
		right: 5px;
		top: 5px;
		bottom: 5px;
		display: flex;
		flex-direction: column;
		text-align: center;
		align-items: center;
		justify-content: center;
		padding: 30px 25%;
		background: rgba( 255,255,255,.91 );
		.cx-vui-subtitle {
			font-size: 24px;
			line-height: 32px;
			padding: 0 0 24px;
			margin: 0;
		}
		p {
			font-size: 16px;
			line-height: 24px;
			color: #7B7E81;
		}
	}
}

.jet-engine-query-suggestions {
	position: relative;
	z-index: 1;
	&__list {
		position: absolute;
		left: 0;
		top: 3px;
		width: 100%;
		background: #fff;
		box-shadow: 0 4px 8px rgba( 0, 0, 0, .15 );
	}
	&__item {
		padding: 5px;
		cursor: pointer;
		border-top: 1px solid rgba( 0, 0, 0, .15 );
		&:hover {
			background: rgba( 0, 0, 0, .05 );
		}
		&:first-child {
			border-top: none;
		}
	}
	&__close {
		position: absolute;
		right: 5px;
		top: 5px;
		font-size: 28px;
		z-index: 99;
		cursor: pointer;
	}
}

.jet-engine-query-preview {
	display: flex;
	flex-direction: column;
	width: 430px;
	position: fixed;
	right: 10px;
	bottom: 10px;
	border: 1px solid #007cba;
	box-shadow: 0 5px 10px rgba(0,0,0,.4);
	background: #fff;
	height: calc( 100vh - 55px );
	body.rtl & {
		left: 10px;
		right: auto;
	}
	.cx-vui-component--preview-control {
		flex-direction: column;
		padding: 10px;
		.cx-vui-component__label {
			font-size: 14px;
		}
		.cx-vui-component__desc {
			font-size: 12px;
		}
	}
	&__settings {
		flex: 0 0 auto;
	}
	&__body {
		flex: 1 1 auto;
		min-height: 10vh;
		box-shadow: 0 5px 10px rgba(0,0,0,.1) inset;
		padding: 12px;
		overflow: auto;
		&-updating {
			opacity: .5;
		}
	}
	&__items {
		pre {
			white-space: pre-wrap;
		}
	}
}

.jet-engine-query-preview__collapse.cx-vui-collapse {

	border-bottom: none;

	.cx-vui-collapse__heading {
		position: relative;
		display: flex;
		align-items: baseline;
		justify-content: flex-start;
		cursor: pointer;
		gap: 4px;
		padding: 4px 0;
	}

	.cx-vui-collapse__heading-icon {
		order: 2;
		font-weight: bold;
		line-height: 18px;
		font-size: 15px;
		width: auto;
		height: auto;
		&:before {
			content: '[-]';
		}
	}

	&.cx-vui-collapse--collapsed .cx-vui-collapse__heading-icon:before {
		content: '[+]';
	}

	.cx-vui-collapse__content {
		padding: 10px 15px;
		font-size: 13px;
		background: #eaeaea;
		pre {
			white-space: pre-wrap;
			overflow-wrap: break-word;
			margin: 0;
			font-family: 'Courier New', Courier, monospace;
			color: #000;
		}
	}
}

.cx-vui-component.cx-vui-component--query-fullwidth {
	padding-left: 0;
	padding-right: 0;
	.cx-vui-component__control {
		max-width: 100%;
		flex: 0 0 100%;
	}
}

.jet-engine-query-builder__field {
	.cx-vui-popup {
		.cx-vui-popup__footer {
			justify-content: flex-end;
			padding: 0;
			button {
				margin-top: -32px;
			}
		}
	}
}

.cx-vui-inner-panel.query-panel {
	padding: 20px;
	.cx-vui-panel {
		margin-bottom: 20px;
	}
	> .cx-vui-component__label {
		padding: 0 0 10px;
		+ .cx-vui-component__desc {
			margin: -5px 0 0 0;
			padding: 0 0 15px;
		}
	}
}

.cx-vui-component.cx-vui-component--has-macros {
	align-items: flex-start;
}

.jet-query-macros {
	width: 32px;
	height: 32px;
	flex: 0 0 32px;
	&__config {
		text-align: right;
		margin: -12px -10px 10px 0;
		&-trigger {
			color: #007cba;
			text-decoration: underline;
			text-decoration-style: dashed;
			cursor: pointer;
			font-size: 12px;
			&:hover {
				color: #7b7e81;
				text-decoration: none;
			}
		}
	}
	&__trigger {
		height: 32px;
		cursor: pointer;
		display: flex;
		align-items: center;
		align-content: center;
		justify-content: center;
		&:hover {
			svg {
				path {
					fill: #007cba;
				}
			}
		}
		svg {
			path {
				fill: #7b7e81;
			}
		}
		&-open {
			width: 24px;
			height: auto;
		}
		&-close {
			width: 24px;
			height: auto;
		}
	}
	&__value {
		position: absolute;
		left: 0;
		top: 0;
		right: 30px;
		background: #fff;
		padding: 6px 15px 4px;
		border: 2px solid #f4f4f5;
		border-radius: 4px;
		display: flex;
		justify-content: space-between;
		font-size: 13px;
		line-height: 17px;
		color: #7b7e81;
		height: 100%;
		box-sizing: border-box;
		i {
			cursor: pointer;
			white-space: nowrap;
			text-overflow: ellipsis;
			overflow: hidden;
		}
		&-clear {
			cursor: pointer;
			padding: 5px;
			margin: -7px -12px -8px 0;
			svg {
				width: 20px;
				height: auto;
				path {
					fill: #007cba;
				}
			}
			&:hover {
				svg {
					path {
						fill: #c92c2c;
					}
				}
			}
		}
		.cx-vui-component--has-empty-toggle & {
			height: 32px;
		}
	}
	&__back {
		cursor: pointer;
		color: #007cba;
		font-weight: bold;
		text-decoration: underline;
	}
	&__title {
		padding: 0 0 10px;
	}
	&__popup {
		position: absolute;
		right: 0;
		left: 0;
		top: 36px;
		background: #fff;
		padding: 20px 25px;
		margin: 0;
		border: 1px solid #ececec;
		box-shadow: 0 2px 6px rgba( 35,40,45,.07 );
		border-radius: 6px;
		z-index: 9999;
		.cx-vui-button.cx-vui-button--style-accent {
			margin: 10px 0 5px 0;
		}
		.cx-vui-component {
			padding: 7px 0;
			&__meta {
				justify-content: center;
			}
			&__label {
				font-size: 13px;
			}
			&--mini-label {
				flex-direction: column;
				border-top: none !important;
				.cx-vui-component__meta {
					max-width: 100%;
					flex: 0 0 100%;
				}
				.cx-vui-component__label {
					font-weight: bold;
					color: #7B7E81;
				}
				.cx-vui-component__control {
					flex: 1 1 auto !important;
					max-width: 100% !important;
				}
			}
		}
	}
	&__search {
		&[type="search"] {
			padding: 3px 8px;
			margin-bottom: 10px;
		}
	}
	&__list {
		margin: 0 -25px;
		padding: 0 25px;
		overflow-y: auto;
		max-height: 250px;
	}
	&-item {
		&__name {
			font-size: 13px;
			line-height: 17px;
			color: #7b7e81;
			padding: 2px 0;
			display: flex;
			align-content: flex-start;
			cursor: pointer;
			&:hover {
				color: #23282d;
				font-weight: bold;
			}
		}
		&__mark {
			font-size: 11px;
			line-height: 12px;
			padding: 3px 5px 0 0;
		}
	}
}

.cx-vui-component--api-url {
	.cx-vui-component__control {
		flex: 0 0 100%;
	}
}
.jet-engine-query-builder-api-url {
	position: relative;
	width: 100%;
	&__copy {
		position: absolute;
		right: 10px;
		top: 12px;
		cursor: pointer;
		opacity: .6;
		&:hover {
			opacity: 1;
		}
	}
	pre {
		width: 100%;
	}
	code {
		display: block;
		padding: 15px 35px 15px 15px;
		white-space: pre-wrap;
	}
}
.jet-engine-query-builder-api-error {
	color: #C92C2C;
	padding: 5px 0 0 0;
}
.jet-engine-query-builder-api-args {
	&__row {
		display: flex;
		gap: 5px;
		align-items: center;
		padding: 0 0 5px;
		&-title {
			flex: 1 1 50%;
			color: #7B7E81;
			font-size: 11px;
			text-transform: uppercase;
			font-weight: 500;
		}
		&.headings-row {
			padding: 0;
			&:after {
				content: "";
				width: 24px;
				height: 24px;
			}
		}
		.cx-vui-input {
			flex: 1 1 50%;
		}
		.cx-vui-button {
			width: 24px;
			height: 24px;
			margin: 0;
			display: flex;
			align-items: center;
			justify-content:center;

			.cx-vui-button__content svg {
				margin: 0;
			}

			.cx-vui-tooltip {
				width: 80px;
			}
		}
	}
	&__actions {
		.cx-vui-button {
			font-size: 13px;
		}
	}
}
.jet-engine-real-query-id {
	display: flex;
	gap: 4px;
	align-items: flex-end;
	color: #7B7E81;
	padding: 5px 0 0 0;
	&__label {
		color: #23282D;
	}
	&__help {
		padding: 2px;
		cursor: pointer;
		position: relative;
		&:hover {
			.jet-engine-real-query-id__help-text {
				opacity: 1;
			}
		}
		svg {
			display: block;
		}
		&-text {
			transition: opacity 150ms linear;
			opacity: 0;
			pointer-events: none;
			width: 270px;
			box-sizing: border-box;
			left: 50%;
			padding: 10px !important;
			margin-left: -135px !important;
		}
	}
}

.CodeMirror {
	resize: vertical;
	min-height: 50px;

	&-wrap {
		border: 1px solid #ececec;
    	border-radius: 4px;
	}
}

div.cx-vui-component {
	&--in-row {
		column-gap: 10px;
		align-items: center;

		.cx-vui-component__control {
			flex: 1 0;
		}
	}
}
