/* =================================== */
/* CSS for control sap.m/ObjectNumber  */
/* Base theme                          */
/* =================================== */

.sapMObjectNumber {
	display: block;
	white-space: normal;
	max-width: 100%;
	text-overflow: ellipsis;
	word-wrap: normal;
	overflow: visible;
	min-height: 1rem;
	font-family: @sapUiFontFamily;
	font-size: @sapMFontMediumSize;

	&.sapMObjectNumberLarge {
		vertical-align: middle;
		height: 2rem;
		font-size: 1.5rem;
		&.sapMObjectNumberInverted .sapMObjectNumberInner{
			padding: 0 0.25rem;
		}
		& .sapMObjectNumberInner {
			height: 2rem;
		}
		.sapMObjectNumberText,
		.sapMObjectNumberUnit {
			line-height: 2rem;
			vertical-align: middle;
			height: 2rem;
		}
	}
}

.sapMObjectNumberText {
	display: inline-block;
	white-space: pre;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
	text-decoration: none;
	min-height: 1rem;
	vertical-align: middle;
	line-height: 1rem;
	font-family: @sapUiFontFamily;
	text-shadow: @sapUiContentTextShadow;
}

.sapMObjectNumberEmph .sapMObjectNumberText {
	font-weight: bold;
}

.sapMObjectNumberUnit {
	display: inline-block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
	text-decoration: none;
	height: 1rem;
	line-height: 1rem;
	vertical-align: middle;
	font-family: @sapUiFontLightFamily;
 	text-shadow: @sapUiContentTextShadow;
}

// Android fix
html[data-sap-ui-os^="Android"] {
	.sapMObjectNumberUnit {
		padding-top: 0;
	}
}

.sapUiForm .sapMObjectNumberUnit,
.sapUiForm .sapMObjectNumberText {
	vertical-align: top;
}

.sapUiForm.sapUiFormEdit .sapMObjectNumber {
	line-height: 3rem;
}

.sapUiForm.sapUiFormEdit .sapMObjectNumber .sapMObjectNumberUnit {
	line-height: 2.875rem;
}

.sapUiSizeCompact .sapUiForm.sapUiFormEdit .sapMObjectNumber {
	line-height: 2rem;
}

.sapUiSizeCompact .sapUiForm.sapUiFormEdit .sapMObjectNumber .sapMObjectNumberUnit {
	line-height: 1.875rem;
}

.sapMLIBActive .sapMObjectNumber {
	color: @sapUiListActiveTextColor;
}

.sapMObjectNumberStatusNone {
	color: @sapUiNeutralText;
}

.sapMObjectNumberStatusError {
	color: @sapUiNegativeText;
}

.sapMObjectNumberStatusWarning {
	color: @sapUiCriticalText;
}

.sapMObjectNumberStatusSuccess {
	color: @sapUiPositiveText;
}

.sapMObjectNumberStatusInformation {
	color: @sapUiInformativeText;
}

// focus

.sapMObjectNumberActive {
	cursor: pointer;
}

.sapMObjectNumberInner {
	position: relative;
	box-sizing: border-box;
	display: inline-block;
	min-height: 1rem;
	line-height: 0.875rem;
	vertical-align: text-top;
}

html.sap-desktop .sapMObjectNumberActive:focus {

	outline: none;

	.sapMObjectNumberInner::after {
		pointer-events: none;
		display: block;
		content: "";
		position: absolute;
		top: -1px;
		left: 1px;
		bottom: 0px;
		right: 1px;
		height: 1.125rem;
		outline: 1px dotted @sapUiContentFocusColor;
	}

	&.sapMObjectNumberInverted .sapMObjectNumberInner::after {
		top: -1px;
		left: 1px;
		bottom: -1px;
		right: 1px;
		height: 1.125rem;
		outline: 1px dotted @sapUiContentFocusColor;
	}



	&.sapMObjectNumberLarge {

		.sapMObjectNumberInner::after {
			top: 0px;
			left: 1px;
			bottom: 0px;
			right: 1px;
			height: 2rem;
		}

		&.sapMObjectNumberInverted .sapMObjectNumberInner::after {
			top: 3px;
			left: 3px;
			bottom: 3px;
			right: 3px;
			height: 1.625rem;
			outline: 1px dotted @sapContent_ContrastFocusColor;
		}

	}
}

.sapMObjectNumberActive:not(.sapMObjectNumberInverted) {
	&.sapMObjectNumberPressed,
	&:hover,
	&:active {
		* {
			text-decoration: underline;
		}
	}
}

/* doesn't work on IE */
html[data-sap-ui-browser ^= "ie"], html[data-sap-ui-browser^="ed"] {
	.sapMObjectNumberActive:focus .sapMObjectNumberInner::after {
		outline-style: dashed;
	}
}

// inverted classes

.sapMObjectNumberInverted {

	vertical-align: initial;

	.sapMObjectNumberInner {
		height: 1rem;
		width: auto;
		min-width: 1.25rem;
		padding: 0 0.25rem;
		border-radius: @sapUiElementBorderCornerRadius;
		line-height: 0.75rem;
	}

	.sapMObjectNumberInner::after {
		top: -1px;
		left: 1px;
		bottom: 1px;
		right: 1px;
		height: 1.25rem;
		outline: 1px dotted @sapUiContentFocusColor;
	}

	&:not(.sapMObjectNumberLarge) {
		font-weight: bold;
	}

	.sapMObjectNumberText,
	.sapMObjectNumberUnit {
		font-family: @sapUiFontFamily;
		font-size: @sapMFontSmallSize;
		text-shadow: none;
	}

	&.sapMObjectNumberLarge {

		height: 2rem;

		.sapMObjectNumberText,
		.sapMObjectNumberUnit {
			font-size: 1.25rem;
			line-height: 2rem;
		}

	}
}

.objectNumberStatusMixIn(@class, @innerBackgroundColor, @innerColor, @activeInnerBackgroundColor, @activeInnerColor, @pressedInnerBackgroundColor) {
	.sapMObjectNumberInverted.@{class} {
		.sapMObjectNumberInner {
			background-color: @innerBackgroundColor;
			color: @innerColor;
		}

		&.sapMObjectNumberActive {
			.sapMObjectNumberInner:hover {
				background-color: @activeInnerBackgroundColor;
				color: @activeInnerColor;
			}
			.sapMObjectNumberInner:active,
			&.sapMObjectNumberPressed .sapMObjectNumberInner {
				background-color: @pressedInnerBackgroundColor;
				color: @sapUiButtonActiveTextColor;
			}
		}
	}
}

.sapMObjectNumber .sapMEmptyIndicator.sapMEmptyIndicatorAuto {
	display: none;
}

.sapMShowEmpty-CTX .sapMObjectNumber .sapMEmptyIndicator.sapMEmptyIndicatorAuto {
	display: inline-block;
}

.objectNumberStatusMixIn(sapMObjectNumberStatusError, @sapUiButtonNegativeBackground, @sapUiButtonNegativeTextColor, @sapUiButtonNegativeHoverBackground, @sapUiButtonNegativeHoverTextColor, @sapUiButtonNegativeActiveBackground);
.objectNumberStatusMixIn(sapMObjectNumberStatusWarning, @sapUiButtonCriticalBackground, @sapUiButtonCriticalTextColor, @sapUiButtonCriticalHoverBackground, @sapUiButtonCriticalHoverTextColor, @sapUiButtonCriticalActiveBackground);
.objectNumberStatusMixIn(sapMObjectNumberStatusSuccess, @sapUiButtonSuccessBackground, @sapUiButtonSuccessTextColor, @sapUiButtonSuccessHoverBackground, @sapUiButtonSuccessHoverTextColor, @sapUiButtonSuccessActiveBackground);
.objectNumberStatusMixIn(sapMObjectNumberStatusInformation, @sapUiInformativeElement, @sapUiButtonInformationTextColor, @sapUiButtonInformationHoverBackground, @sapUiButtonInformationHoverTextColor, @sapUiButtonInformationActiveBackground);
.objectNumberStatusMixIn(sapMObjectNumberStatusNone, @sapUiButtonNeutralBackground, @sapUiButtonNeutralTextColor, @sapUiButtonNeutralHoverBackground, @sapUiButtonNeutralHoverTextColor, @sapUiButtonNeutralActiveBackground);
