/* ============================================================ */
/* CSS for control sap.suite.ui.commons/CalculationBuilderItem  */
/* Base theme                                                   */
/* ============================================================ */

.sapCalculationBuilderItem {
	background-color: var(--sapButton_Background);
	border: 1px solid var(--sapNeutralBorderColor);
	color: var(--sapNeutralTextColor);
	display: inline-block;
	font-size: @sapMFontMediumSize;
	border-radius: 3px;
	font-weight: bold;
	position: relative;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;

	&:focus {
		outline: none;
	}
}

.sapUiSizeCozy .sapCalculationBuilderItem {
	font-size: var(--sapFontLargeSize);
}

.sapCalculationBuilderItemContentWrapper {
	display: flex;
	flex-direction: row;
	width: 100%;
}

.sapCalculationBuilderItemContent {
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	height: 1.625rem;
	width: 100%;
	position: relative;
}

.sapUiSizeCozy .sapCalculationBuilderItemContent {
	height: 2.5rem;
}

.sapCalculationBuilderItemLabel {
	padding: 0 0.75rem;
	pointer-events: none;
	white-space: nowrap;
}

.sapCalculationBuilderReadOnly .sapCalculationBuilderItemLabel {
	color: var(--sapButton_BorderColor);
}

.sapCalculationBuilderReadOnly .sapCalculationBuilderItem{
	background-color: transparent;
}

.sapCalculationBuilderItemVariable .sapCalculationBuilderItemContent,
.sapCalculationBuilderItemLiteral .sapCalculationBuilderItemContent,
.sapCalculationBuilderUnknownItem .sapCalculationBuilderItemContent,
.sapCalculationBuilderItemExpandButton {

	&:hover {
		border-color: var(--sapButton_Hover_BorderColor);
		background-color: var(--sapButton_Hover_Background);
	}

	&:active {
		border-color: var(--sapButton_Active_BorderColor);
		background-color: var(--sapActiveColor);
		color: var(--sapButton_Active_TextColor);
	}
}

.sapCalculationBuilderItemVariable,
.sapCalculationBuilderItemLiteral,
.sapCalculationBuilderUnknownItem {
	border-color: var(--sapButton_BorderColor);
	background-color: var(--sapButton_Background);
	color: var(--sapButton_TextColor);
	display: flex;
}

.sapCalculationBuilderItemFunction,
.sapCalculationBuilderItemBracket,
.sapCalculationBuilderItemOperator {
	background-color: var(--sapButton_Lite_Background);
	border-color: var(--sapButton_Lite_BorderColor);
	color: @sapUiCalendarColorToday;

	&:hover {
		border-color: var(--sapButton_Lite_Hover_BorderColor);
		background-color: var(--sapButton_Lite_Hover_Background);
	}

	&:active {
		border-color: var(--sapButton_Lite_Active_Background);
		background-color: var(--sapButton_Lite_Active_BorderColor);
		color: var(--sapButton_Active_TextColor);
	}
}

.sapCalculationBuilderItemCustomOperator.sapCalculationBuilderItemOperator {
	width: auto !important;
}

.sapCalculationBuilderItemOperator {
	width: 1.625rem;
}

.sapUiSizeCozy .sapCalculationBuilderItemOperator,
.sapUiSizeCozy .sapCalculationBuilderItemBracket {
	width: 2.25rem;
}

.sapCalculationBuilderBracket {
	border-color: var(--sapButton_Lite_Hover_BorderColor);
	background-color: var(--sapButton_Lite_Hover_Background);
}

.sapCalculationBuilderItemOperator {
	color: var(--sapButton_TextColor);
}

.sapCalculationBuilderItemFunctionLabel {
	padding-right: 0;
}

.sapCalculationBuilderItemFunctionBracket {
	padding-left: 0;
	background-color: var(--sapButton_Lite_Background);
	border-color: var(--sapButton_Lite_BorderColor);
}

.sapCalculationBuilderItemOperatorLength-1 .sapCalculationBuilderItemLabel {
	padding: 0;
}

.sapCalculationBuilderItemOperatorLength-2,
.sapCalculationBuilderItemOperatorLength-3 {
	width: auto;
}

.sapCalculationBuilderNewItem,
.sapCalculationBuilderEmptyItem {
	border-radius: 3px;
	outline: none;
	width: 1.625rem;
	border: 1px solid var(--sapButton_TextColor);
	background-color: var(--sapButton_Lite_Background);
	color: var(--sapButton_TextColor);
}

.sapUiSizeCozy .sapCalculationBuilderNewItem,
.sapUiSizeCozy .sapCalculationBuilderEmptyItem {
	width: 2rem;
}

.sapCalculationBuilderNewItemIcon {
	line-height: 2rem;
	cursor: pointer;
}

.sapCalculationBuilderEmptyItemIcon {
	cursor: pointer;
}

.sapCalculationBuilderItemPopupOperatorsAndInputWrapper {
  margin: 1rem 1rem 0 1rem;
}

.sapCalculationBuilderItemPopupOptionItem {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--sapList_BorderColor);
}

.sapCalculationBuilderItemPopupOperators {

	.sapMBtn {
		padding: 0;
	}

	.sapMBtnInner {
		height: 2rem;
	}

	.sapMBtnContent {
		line-height: 30px;
		font-size: 1.125rem;
		font-weight: bold
	}

	.sapMBtnIcon {
		line-height: 30px;
	}
}

.sapCalculationBuilderItemPopupLiteralLabelAndInput {
  padding-top: 1rem;
}

.sapCalculationBuilderSelected .sapCalculationBuilderItem {
	z-index: 30;
}

.sapCalculationBuilderItem.ui-selecting,
.sapCalculationBuilderItem.ui-selected {
	border: 1px dashed var(--sapButton_BorderColor);
}

.sapCalculationBuilderItem.ui-state-disabled {
	opacity: 1;
}

.sapCalculationBuilderItemExpandButton {
	width: 1.625rem;
	height: 100%;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	vertical-align: middle;
	justify-content: center;
	font-size: var(--sapFontSmallSize);
	border-left: 1px solid var(--sapButton_BorderColor);

	&:focus {
		outline: none;
	}

	.sapUiIcon {
		cursor: pointer;
	}
}

.sapUiSizeCozy .sapCalculationBuilderItemExpandButton {
	width: 2.25rem;
}

.sapCalculationBuilderItemExpandButtonFocus {
	position: absolute;
	height: 1.375rem;
	width: 1.375rem;
	left: 0.188rem;
	box-sizing: border-box;
}

.sapUiSizeCozy .sapCalculationBuilderItemExpandButtonFocus {
	position: absolute;
	height: 2.25rem;
	width: 2rem;
	left: 0.188rem;
	box-sizing: border-box;
}

.sapCalculationBuilderItemExpandButton:focus .sapCalculationBuilderItemExpandButtonFocus,
.sapCalculationBuilderItemExpandButton:active .sapCalculationBuilderItemExpandButtonFocus {
	border: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapContent_FocusColor);
}

.sapCalculationBuilderItemFocusWrapper {
	position: absolute;
	height: 100%;
	width: 100%;
	box-sizing: border-box;
	padding: 2px;
	pointer-events: none;
	display: none;
	top: 0;
	left: 0;
}

.sapCalculationBuilderItemFocus {
	position: relative;
	box-sizing: border-box;
	height: 100%;
	border: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapContent_FocusColor);
	pointer-events: none;
}

.sapCalculationBuilderItem:focus .sapCalculationBuilderItemFocusWrapper,
.sapCalculationBuilderNewItem:focus .sapCalculationBuilderItemFocusWrapper {
	display: block;
}

.sapCalculationBuilderItemExpandButtonWrapper {
	position: relative;

	&:focus {
		outline: none;
	}
}

.sapCalculationBuilderItemErrorSyntax,
.sapCalculationBuilderItemErrorSyntax .sapCalculationBuilderItemContent,
.sapCalculationBuilderItemErrorSyntax .sapCalculationBuilderItemExpandButton {
	background-color: var(--sapButton_Reject_Background);
	border-color: var(--sapButton_Reject_BorderColor);
	color: var(--sapButton_Reject_TextColor);

	&:hover {
		background-color: var(--sapButton_Reject_Hover_Background);
		border-color: var(--sapButton_Reject_Hover_BorderColor);
	}

	&:active {
		background-color: var(--sapButton_Reject_Active_Background);
		border-color: var(--sapButton_Reject_Active_BorderColor);
		color: var(--sapButton_Active_TextColor);
	}

}

.sapCalculationBuilderItemErrorSyntax .sapCalculationBuilderItemExpandButton {
	border-left-color: var(--sapButton_Reject_BorderColor);
}

.sapCalculationBuilderItemTextError {
	background: url(img/error.gif) bottom repeat-x;
	padding-bottom: 1px;
	cursor: help;
}

.sapCalculationBuilderItemTextEmpty {
	background-color: fade(@sapUiFieldTextColor, 15);
	padding: 0 5px 1px 1px;
	border-radius: 3px
}

/* *** DRAGGING *** */
.sapCalculationBuilderDragging.sapCalculationBuilderItem,
.sapCalculationBuilderDragging .sapCalculationBuilderItemExpandButton,
.sapCalculationBuilderDraggingSelectedClone .sapCalculationBuilderItemExpandButton,
.sapCalculationBuilderSelected.sapCalculationBuilderDragging .sapCalculationBuilderItem,
.sapCalculationBuilderDraggingSelectedClone .sapCalculationBuilderItem {
	z-index: 30;
	opacity: 0.7;
	color: var(--sapContent_DisabledTextColor) !important;
	background-color: var(--sapButton_Background) !important;
	border-color: var(--sapButton_Background) !important;
}

.sapCalculationBuilderDroppableLine,
.sapCalculationBuilderDroppableCircle {
	display: none;
}

.sapCalculationBuilderDroppableActive .sapCalculationBuilderDroppableLine,
.sapCalculationBuilderDroppableActive .sapCalculationBuilderDroppableCircle {
	display: block;
}

.sapCalculationBuilderDroppableLine::after {
	content: '';
	position: absolute;
	top: 10px;
	bottom: 10px;
	left: 50%;
	width: 2px;
	background-color: var(--sapSelectedColor);
	transform: translate(-50%);
}

.sapCalculationBuilderDroppableCircle::after {
	border: 2px solid var(--sapSelectedColor);
	content: '';
	position: absolute;
	border-radius: 50%;
	top: 0;
	width: 8px;
	height: 8px;
	background-color: transparent;
	left: -2px;
}

.sapCalculationBuilderExpressionSAPFont {
	font-family: var(--sapContent_IconFontFamily);
}