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

@_sap_m_LightBox_MinHeight: 18rem;
@_sap_m_LightBox_FooterOneLineHeightCompact: 2.5rem;
@_sap_m_LightBox_FooterTwoLinesHeightCompact: 3.5rem;
@_sap_m_LightBox_FooterOneLineHeightCozy: 3rem;
@_sap_m_LightBox_FooterTwoLinesHeightCozy: 3.5rem;
@_sap_m_LightBox_TitleSectionPadding: 1rem;
@_sap_m_LightBox_TitleSectionPaddingTwoLines: 0.5rem;
@_sap_m_LightBox_BusyIndicatorHeight: 1rem;
@_sap_m_LightBox_SubtitleMarginTop: 0.5rem;
@_sap_m_LightBox_OverlayBackground: @sapUiBlockLayerBackground;
@_sap_m_LightBox_ContainerBackground: @sapUiGlobalBackgroundColor;
@_sap_m_LightBox_ErrorIconColor: @sapUiContentNonInteractiveIconColor;

/* ==========================================================================
   Container
  ========================================================================== */

.sapMLightBox {
	min-width: 20rem;
	max-width: 100%;
	min-height: 18rem;
	max-height: 100%;
	border-radius: @sapUiElementBorderCornerRadius;
	background-color: @_sap_m_LightBox_ContainerBackground;
	box-shadow: @sapUiShadowLevel3;
	outline: none;
}

html[data-sap-ui-browser^='sf'] .sapMLightBox {
	-webkit-transform: translateZ(0px); // fixes displaying the control behind the block layer in Safari
}

.sap-desktop .sapMLightBox {
	max-width: calc(~"100% - 4rem");
	max-height: calc(~"100% - 4rem");
}

.sap-tablet .sapMLightBox {
	max-width: calc(~"100% - 2rem");
	max-height: calc(~"100% - 2rem");
}

.sap-phone .sapMLightBox {
	max-width: calc(~"100% - 1rem");
	max-height: calc(~"100% - 1rem");
}

.sapMLightBoxFooter {
	background-color: @sapUiPageFooterBackground;
	border-top: 1px solid @sapUiPageFooterBorderColor;
}

/* ==========================================================================
   Overlay
  ========================================================================== */
.sapMLightBox + .sapUiBLy {
	background: @_sap_m_LightBox_OverlayBackground;
	opacity: 0.9;
}

/* ==========================================================================
   Image
  ========================================================================== */

.sapMLightBox .sapMImg {
	margin: auto;
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

.sapMLightBox.sapMLightBoxTopCornersRadius .sapMImg {
	border-radius: @sapUiElementBorderCornerRadius @sapUiElementBorderCornerRadius 0 0;
}

/* ==========================================================================
   Footer
  ========================================================================== */

.sapMLightBoxFooter {
	display: flex;
	flex-direction: row;
	width: 100%;
	position: absolute;
	bottom: 0;
	-webkit-box-direction: normal;
	-webkit-box-orient: horizontal;
	-webkit-box-align: start;
	justify-content: space-between;
	height: @_sap_m_LightBox_FooterOneLineHeightCozy;
	align-items: flex-end;
	border-radius: 0 0 @sapUiElementBorderCornerRadius @sapUiElementBorderCornerRadius;

	&.sapMLightBoxFooterTwoLines {
		height: @_sap_m_LightBox_FooterTwoLinesHeightCozy;
	}
}

.sapMLightBoxSubtitle {
	margin-top: @_sap_m_LightBox_SubtitleMarginTop;
}

.sapMLightBoxTitleSection {
	margin: 0 1rem;
	padding: @_sap_m_LightBox_TitleSectionPadding 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	flex: 1;
}

.sapMLightBoxTwoLines .sapMLightBoxTitleSection {
	padding: @_sap_m_LightBox_TitleSectionPaddingTwoLines 0;
}

.sapMLightBoxFooter .sapMBtn {
	padding-right: 0.25rem;
}

.sapMText.sapMLightBoxTitle {
  color: @sapUiBaseText;
  font-family: @sapUiFontFamily;
  font-size: @sapMFontMediumSize;
}

.sapMText.sapMLightBoxSubtitle {
  color: @sapUiContentLabelColor;
  font-family: @sapUiFontFamily;
  font-size: @sapMFontMediumSize;
}

.sapMText.sapMLightBoxTitle,
.sapMText.sapMLightBoxSubtitle {
	white-space: nowrap;
	overflow: hidden;
	text-align: left;
	text-overflow: ellipsis;
}

/* ==========================================================================
   Footer title
  ========================================================================== */

.sapMLightBoxImageContainer {
	min-height: calc(@_sap_m_LightBox_MinHeight - 3.5rem);
	position: absolute;
	top: 0;
	bottom: @_sap_m_LightBox_FooterOneLineHeightCozy;
	width: 100%;
}

.sapMLightBoxImageContainerTwoLines {
	height: calc(~"100% - " @_sap_m_LightBox_FooterTwoLinesHeightCozy);
	position: absolute;
	top: 0;
	width: 100%;
}

/* ==========================================================================
   Busy Indicator
  ========================================================================== */
.sapMLightBox {
	.sapUiSizeCompact {
		.sapMBusyIndicator {
			display: block;
			margin-top: (@_sap_m_LightBox_MinHeight - @_sap_m_LightBox_BusyIndicatorHeight - @_sap_m_LightBox_FooterOneLineHeightCompact) / 2;
		}

		.sapMLightBoxTwoLines {
			.sapMBusyIndicator {
				height: 14rem;
				margin-top: (@_sap_m_LightBox_MinHeight - @_sap_m_LightBox_BusyIndicatorHeight - @_sap_m_LightBox_FooterTwoLinesHeightCompact) / 2;
			}
		}
	}
}

.sapMLightBox {
	.sapMBusyIndicator {
		display: block;
		margin-top: (@_sap_m_LightBox_MinHeight - @_sap_m_LightBox_BusyIndicatorHeight - @_sap_m_LightBox_FooterOneLineHeightCozy) / 2;
	}

	.sapMLightBoxTwoLines {
		.sapMBusyIndicator {
			height: 14rem;
			margin-top: (@_sap_m_LightBox_MinHeight - @_sap_m_LightBox_BusyIndicatorHeight - @_sap_m_LightBox_FooterTwoLinesHeightCozy) / 2;
		}
	}
}

/* ==========================================================================
   Error State
  ========================================================================== */

.sapMLightBox .sapMLightBoxErrorContainer {
	padding: 1rem;
}

.sapMLightBox .sapMLightBoxErrorContainerTwoLines {
	padding: 2rem;
	height: calc(~"100% - " @_sap_m_LightBox_FooterTwoLinesHeightCozy);
}

.sapMLightBox .sapMLightBoxVerticalLayout {
	text-align: center;
	max-width: 30rem;
}

.sapMLightBox .sapMLightBoxIconErrorContainer {
	margin: 0 auto;
	width: 5rem;
}

.sapMLightBox .sapMLightBoxErrorIcon {
	font-family: SAP-icons;
	font-size: 4rem;
	font-weight: normal;
	width: 5rem;
	height: 5rem;
}

.sapMLightBox .sapMLightBoxErrorTitle {
	margin-top: 1rem;
	font-size: 1.5rem;
	line-height: 2rem;
	color: @sapUiGroupTitleTextColor;
	font-size: @sapMFontHeader2Size;
}

.sapMLightBox .sapMLightBoxErrorSubtitle {
	line-height: normal;
	margin: 1rem auto;
	font-size: 1rem;
	color: @sapUiContentLabelColor;
	font-size: @sapMFontHeader5Size;
}

.sapMLightBox.sapMLightBoxError .sapMLightBoxFooter {
	position: initial;
}

.sapMLightBox .sapMLightBoxErrorContainer .sapUiIcon::before,
.sapMLightBox .sapMLightBoxErrorContainerTwoLines .sapUiIcon::before {
	color: @_sap_m_LightBox_ErrorIconColor;
}

/* ==========================================================================
   Compact
  ========================================================================== */

.sapUiSizeCompact {

	.sapMLightBoxImageContainer {
		bottom: @_sap_m_LightBox_FooterOneLineHeightCompact;
	}

	.sapMLightBoxImageContainerTwoLines {
		bottom: @_sap_m_LightBox_FooterTwoLinesHeightCompact;
		height: calc(~"100% - " @_sap_m_LightBox_FooterTwoLinesHeightCompact);
	}

	.sapMLightBoxFooter {
		height: @_sap_m_LightBox_FooterOneLineHeightCompact;

		&.sapMLightBoxFooterTwoLines {
			height: @_sap_m_LightBox_FooterTwoLinesHeightCompact;
		}
	}

	.sapMLightBoxTitleSection {
		padding: 0.75rem 0;
	}

	.sapMLightBoxTwoLines .sapMLightBoxTitleSection {
		padding: @_sap_m_LightBox_TitleSectionPaddingTwoLines 0;
	}

	.sapMLightBoxFooter .sapMBtn {
		padding-right: 0.5rem;
		margin-bottom: 0.25rem;
	}

	.sapMLightBox .sapMLightBoxErrorContainerTwoLines {
		height: calc(~"100% - " @_sap_m_LightBox_FooterTwoLinesHeightCompact);
	}
}