@charset "UTF-8";

/*****************
 * Progress bars *
 *****************/
progressbar {
	// sizing
	&.horizontal {
		trough,
		progress {
			min-height: 4px;
		}
	}

	&.vertical {
		trough,
		progress {
			min-width: 4px;
		}
	}

	// FIXME: insensitive state missing and some other state should be set probably
	font-size: smaller;
	color: gtkalpha(
		gtk("@theme_button_foreground_normal"),
		0.3
	);

	trough {
		border: 1px solid;
		border-radius: $r;
		background: gtkoverlay(
			gtk("@theme_bg_color"),
			gtkalpha(gtk("@theme_button_foreground_normal"), 0.5*0.2)
		);

		border-color: gtkalpha(
			gtk("@theme_button_foreground_normal"),
			0.2
		);
	}

	progress {
		border: 1px solid;
		margin: -1px;
		border-radius: $r;
		box-shadow: none; //needed for clipping
		background: gtkoverlay(
			gtk("@theme_bg_color"),
			gtkalpha(gtk("@theme_button_decoration_hover"), 0.5)
		);

		border: 1px solid gtk("@theme_button_decoration_hover");
	}

	&:backdrop progress {
		background: gtkoverlay(
			gtk("@theme_bg_color"),
			gtkalpha(gtk("@theme_unfocused_selected_bg_color"), 0.5)
		);

		border-color: gtk(
			"@theme_unfocused_selected_bg_color"
		);
	} // states not passed here as well

	&.osd {
		// progressbar.osd used for epiphany page loading progress
		background-color: transparent;
	}
}

treeview.view {
	&.progressbar {
		border: 0px solid transparent;
		border-radius: $r;
		background-color: gtk("@theme_selected_bg_color");
		color: gtk("@theme_selected_fg_color");
		background-image: none;
		&:selected {
			&:focus,
			& {
				background-color: gtkalpha(
					gtk("@theme_selected_bg_color"),
					0.25
				);
			}
		}
	}
	&.trough {
		background-color: $trough_color;
		&:selected {
			&:focus,
			& {
				background-color: gtkalpha(
					gtk("@theme_selected_fg_color"),
					0.3
				);
			}
		}
	}
}

/*************
 * Level Bar *
 *************/
@mixin levelbar($color) {
		border: 1px solid $color;
		background: gtkoverlay(
			gtk("@theme_bg_color"),
			gtkalpha($color, 0.5)
		);
		box-shadow: none;
		border-radius: $r;
}

levelbar {
	block {
		min-height: 6px;
	}

	&.vertical block {
		min-width: 6px;
		min-height: 32px;
	}

	trough {
		border: 1px solid;
		padding: 2px;
		border-radius: 3px;
		@include entry(normal);

		&:backdrop {
			@include entry(backdrop);
		}
	}

	&.horizontal.discrete block {
		margin: 0 1px;
		min-width: 32px;
	}

	&.vertical.discrete block {
		margin: 1px 0;
	}

	block {
		&:not(.empty) {
			@include levelbar(gtk("@theme_button_decoration_hover"));

			&:backdrop {
				@include levelbar(gtk("@theme_unfocused_selected_bg_color"));
			}
		}

		&.low {
			@include levelbar(gtk("@warning_color"));
			&:backdrop {
				@include levelbar(gtk("@warning_color_backdrop"));
			}
		}

		&.full, &.high {
			@include levelbar(gtk("@success_color"));

			&:backdrop {
				@include levelbar(gtk("@success_color_backdrop"));
			}
		}

		&.empty {
			@include levelbar(gtkalpha(gtk("@theme_button_foreground_normal"), 0.2));
		}
	}
}
