// -----------------------------------------------
//  Widget    : deliteful/ProgressBar
//  baseClass : d-progress-bar
// -----------------------------------------------

@import "../node_modules/delite/css/includes";
@import "./variables";

//predefined styles
.d-progress-bar-success .d-progress-bar-indicator {
	background-color: @progress-bar-success-bg;
}

.d-progress-bar-info .d-progress-bar-indicator {
	background-color: @progress-bar-info-bg;
}

.d-progress-bar-warning .d-progress-bar-indicator {
	background-color: @progress-bar-warning-bg;
}

.d-progress-bar-danger .d-progress-bar-indicator {
	background-color: @progress-bar-danger-bg;
}

.d-progress-bar-styles() {
	font-size: @font-size-small;
	height: @height;
	vertical-align: middle;
	overflow: hidden; // Corners clipping
	text-align: center; // Use 'initial' to override and restore default value (left if ltr, right if rtl)
	.box-sizing(border-box);
	.border-radius(4px);
	border: 1px solid transparent; // a11y: high contrast
}

.d-progress-bar-background-styles() {
	position: absolute;
	top: 0;
	height: 100%;
	background-color: @progress-bg;
	box-shadow: 0 0.1em 0.2em 0.1em rgba(0, 0, 0, 0.1) inset;
}
.d-progress-bar-background-rtl-styles() {
}


.d-progress-bar-indicator-styles() {
	position: relative;
	overflow: hidden; // Needed for the alignment of the two parts of the text
	height: 100%;
	.transition(width @transition-params);
	background-color: @progress-bar-bg;
}
.d-progress-bar-indicator-rtl-styles() {
	.transition(width @transition-params);
	float: right;
	position: relative;
}

.d-progress-bar-a11y-styles() {
	position: relative;
	height: 100%;
	width: 100%;
	border: 0.2em solid transparent;
	.box-sizing(border-box);
}

.d-progress-bar-msg-styles() {
	position: absolute;
	font-size: inherit;
	height: 100%;
	width: 100%;
	left: 0;
	line-height: @line-height;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.d-progress-bar-msg-rtl-styles() {
}


.d-progress-bar-msg::before {
	content: "\00a0"; //nbsp
}

.d-progress-bar-msg-invert-styles() {
	position: absolute;
	font-size: inherit;
	overflow: hidden; // Needed by text-overflow
	height: 100%;
	white-space: nowrap;
	line-height: @line-height;
	text-overflow: ellipsis;
	width: 100%;
	color: @progress-bar-color;
}
.d-progress-bar-msg-invert-rtl-styles() {
}


.d-progress-bar-msg-invert::before {
	content: "\00a0"; //nbsp
}

.d-progress-bar-msg-ext-styles() {
}
.d-progress-bar-msg-ext-rtl-styles() {
}

.d-progress-bar-indeterminate-background-styles() {
}

.d-progress-bar-indeterminate-indicator-styles() {
	width: 100%;
	background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
	background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
	background-size: 40px 40px;
	.transition(width 0s);
	.animation-name(d-progress-bar-indeterminate-animation);
	.animation-duration(1s);
	.animation-timing-function(linear);
	.animation-delay(0s);
	.animation-iteration-count(infinite);
	.animation-direction(normal);
}
.d-progress-bar-indeterminate-indicator-rtl-styles() {
	.animation-direction(reverse); //fyi: reverse has same effect as normal on android (4.2.2 GS4)
	.transition(width 0s);
}

.keyframes-d-progress-bar-indeterminate-animation() {
	0% {
		background-position: 40px 0;
	}
	100% {
		background-position: 0 0;
	}
}

.d-progress-bar {
	display: inline-block;
	position: relative; // Needed for absolutely positioned children
	padding: 0;
	width: 100%;
	.d-progress-bar-styles;
}

.d-progress-bar-background {
	left: 0;
	width: 100%;
	margin: 0;
	padding: 0;
	.d-progress-bar-background-styles;

	.d-progress-bar.d-rtl & {
		.d-progress-bar-background-rtl-styles;
	}
}

.d-progress-bar-indicator {
	top: 0;
	left: 0;
	width: 100%;
	margin: 0;
	padding: 0;

	.d-progress-bar-indicator-styles;

	.d-progress-bar.d-rtl & {
		.d-progress-bar-indicator-rtl-styles;
	}
}

.d-progress-bar-msg {
	width: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden; // Needed for the alignment of the two parts of the text
	.d-progress-bar-msg-styles;

	.d-progress-bar.d-rtl & {
		.d-progress-bar-msg-rtl-styles;
	}
}

.d-progress-bar-msg-invert {
	.d-progress-bar-msg-invert-styles;

	.d-progress-bar.d-rtl & {
		.d-progress-bar-msg-invert-rtl-styles;
	}
}

.d-progress-bar-a11y {
	.d-progress-bar-a11y-styles;
}

.d-progress-bar-msg-ext {
	.d-progress-bar-msg-ext-styles;
	overflow: hidden; // Needed for the alignment of the two parts of the text

	.d-progress-bar.d-rtl & {
		.d-progress-bar-msg-ext-rtl-styles;
	}
}

.d-progress-bar-indeterminate .d-progress-bar-background {
	margin: 0;
	padding: 0;
	.d-progress-bar-indeterminate-background-styles;
}

.d-progress-bar-indeterminate .d-progress-bar-indicator {
	margin: 0;
	padding: 0;
	.d-progress-bar-indeterminate-indicator-styles;
}
.d-progress-bar-indeterminate.d-rtl .d-progress-bar-indicator {
	.d-progress-bar-indeterminate-indicator-rtl-styles;
}

@keyframes d-progress-bar-indeterminate-animation {
	.keyframes-d-progress-bar-indeterminate-animation;
}

@-webkit-keyframes d-progress-bar-indeterminate-animation {
	.keyframes-d-progress-bar-indeterminate-animation;
}
