@import 'common';

.theme-oo-ui-widget () {}

.theme-oo-ui-outlineControlsWidget () {
	height: 3em;
	background-color: #fff;

	&-items,
	&-movers {
		height: 2em;
		margin: 0.5em 0.5em 0.5em 0;
		padding: 0;
	}

	> .oo-ui-iconElement-icon {
		width: 1.5em;
		height: 2em;
		margin: 0.5em 0 0.5em 0.5em;
		opacity: 0.2;
	}
}

.theme-oo-ui-toggleWidget () {}

.theme-oo-ui-buttonGroupWidget () {
	display: inline-block;
	white-space: nowrap;
	border-radius: 0.3em;

	.oo-ui-inline-spacing(0.5em);
	.oo-ui-buttonElement {
		.oo-ui-inline-spacing(0);
	}

	.oo-ui-buttonElement-framed {
		.oo-ui-buttonElement-button {
			border-radius: 0;
			margin-left: -1px;
		}

		&:first-child .oo-ui-buttonElement-button {
			border-bottom-left-radius: 0.3em;
			border-top-left-radius: 0.3em;
			margin-left: 0;
		}

		&:last-child .oo-ui-buttonElement-button {
			border-bottom-right-radius: 0.3em;
			border-top-right-radius: 0.3em;
		}
	}
}

.theme-oo-ui-buttonWidget () {
	.oo-ui-inline-spacing(0.5em);
}

.theme-oo-ui-actionWidget () {
	&.oo-ui-pendingElement-pending {
		.oo-ui-background-image('@{oo-ui-default-image-path}/textures/pending.gif');
	}
}

.theme-oo-ui-popupButtonWidget () {
	&.oo-ui-buttonElement-frameless > .oo-ui-popupWidget {
		// Compensate for icon being inset
		/* @noflip */
		left: 1em;
	}

	&.oo-ui-buttonElement-framed > .oo-ui-popupWidget {
		// Compensate for icon being inset
		/* @noflip */
		left: 1.25em;
	}
}

.theme-oo-ui-toggleButtonWidget () {
	.oo-ui-inline-spacing(0.5em);
}

.theme-oo-ui-iconWidget () {
	line-height: 2.5em;
	height: @icon-size;
	width: @icon-size;

	&.oo-ui-widget-disabled {
		opacity: 0.2;
	}
}

.theme-oo-ui-indicatorWidget () {
	line-height: 2.5em;
	height: @indicator-size;
	width: @indicator-size;
	margin: @indicator-size / 2;

	&.oo-ui-widget-disabled {
		opacity: 0.2;
	}
}

.theme-oo-ui-dropdownWidget () {
	margin: 0.25em 0;
	width: 100%;
	max-width: 50em;

	.oo-ui-inline-spacing(0.5em);

	&-handle {
		height: 2.5em;
		border: 1px solid rgba(0,0,0,0.1);
		border-radius: 0.25em;

		&:hover {
			border-color: rgba(0,0,0,0.2);
		}

		.oo-ui-indicatorElement-indicator {
			right: 0;
		}

		.oo-ui-iconElement-icon {
			left: 0.25em;
		}

		.oo-ui-labelElement-label {
			line-height: 2.5em;
			margin: 0 0.5em;
		}

		.oo-ui-indicatorElement-indicator {
			top: 0;
			width: @indicator-size;
			height: @indicator-size;
			margin: 0.775em;
		}

		.oo-ui-iconElement-icon {
			top: 0;
			width: @icon-size;
			height: @icon-size;
			margin: 0.3em;
		}
	}

	&.oo-ui-widget-disabled {
		.oo-ui-dropdownWidget-handle {
			color: #ccc;
			text-shadow: 0 1px 1px #fff;
			border-color: #ddd;
			background-color: #f3f3f3;
		}
		.oo-ui-indicatorElement-indicator {
			opacity: 0.2;
		}
	}

	&.oo-ui-iconElement .oo-ui-dropdownWidget-handle .oo-ui-labelElement-label {
		margin-left: 3em;
	}

	&.oo-ui-indicatorElement .oo-ui-dropdownWidget-handle .oo-ui-labelElement-label {
		margin-right: 2em;
	}
}

.theme-oo-ui-inputWidget () {
	.oo-ui-inline-spacing(0.5em);
}

.theme-oo-ui-buttonInputWidget () {}

.theme-oo-ui-checkboxInputWidget () {}

.theme-oo-ui-dropdownInputWidget () {
	width: 100%;
	max-width: 50em;

	select {
		height: 2.5em;
		padding: 0.5em;
		font-size: inherit;
		font-family: inherit;
		border: 1px solid rgba(0,0,0,0.1);
		border-radius: 0.25em;
	}

	&.oo-ui-widget-enabled {
		select:hover,
		select:focus {
			border-color: rgba(0,0,0,0.2);
			outline: none;
		}
	}

	&.oo-ui-widget-disabled {
		select {
			color: #ccc;
			border-color: #ddd;
			background-color: #f3f3f3;
		}
	}
}

.theme-oo-ui-radioInputWidget () {}

.theme-oo-ui-textInputWidget () {
	width: 100%;
	max-width: 50em;

	input,
	textarea {
		padding: 0.5em;
		font-size: inherit;
		font-family: inherit;
		background-color: #fff;
		color: black;
		border: 1px solid #ccc;
		box-shadow: 0 0 0 white, inset 0 0.1em 0.2em #ddd;
		border-radius: 0.25em;
		.oo-ui-transition(border-color 200ms, box-shadow 200ms);
	}

	&-decorated {
		input,
		textarea {
			padding-left: 2em;
		}
	}

	&-icon {
		width: 2em;
	}

	&.oo-ui-widget-enabled {
		input:focus,
		textarea:focus {
			outline: none;
			border-color: #a7dcff;
			box-shadow: 0 0 0.3em #a7dcff, 0 0 0 white;
		}

		input[readonly],
		textarea[readonly] {
			color: #777;
		}

		&.oo-ui-flaggedElement-invalid {
			input,
			textarea {
				background-color: #fdd;
			}
		}
	}

	&.oo-ui-widget-disabled {
		input,
		textarea {
			color: #ccc;
			text-shadow: 0 1px 1px #fff;
			border-color: #ddd;
			background-color: #f3f3f3;
		}
		.oo-ui-iconElement-icon,
		.oo-ui-indicatorElement-indicator {
			opacity: 0.2;
		}
		.oo-ui-labelElement-label {
			color: #ddd;
			text-shadow: 0 1px 1px #fff;
		}
	}

	&.oo-ui-pendingElement-pending {
		input,
		textarea {
			background-color: transparent;
			.oo-ui-background-image('@{oo-ui-default-image-path}/textures/pending.gif');
		}
	}

	&.oo-ui-iconElement {
		input,
		textarea {
			padding-left: 2em;
		}

		.oo-ui-iconElement-icon {
			width: @icon-size;
			margin-left: 0.1em;
		}
	}

	&.oo-ui-indicatorElement {
		input,
		textarea {
			padding-right: 1.5em;
		}

		.oo-ui-indicatorElement-indicator {
			width: @indicator-size;
			margin-right: 0.775em;
		}
	}

	> .oo-ui-labelElement-label {
		padding: 0.4em;
		line-height: 1.5em;
		color: #888;
	}

	&-labelPosition-after {
		&.oo-ui-indicatorElement > .oo-ui-labelElement-label {
			margin-right: 1.6em;
		}
	}

	&-labelPosition-before {
		&.oo-ui-iconElement > .oo-ui-labelElement-label {
			margin-left: 2.1em;
		}
	}
}

.theme-oo-ui-comboBoxWidget () {
	width: 100%;
	max-width: 50em;

	.oo-ui-inline-spacing(0.5em);

	&-handle {
		border: 1px solid rgba(0,0,0,0.1);
		border-radius: 0.25em;

		&:hover {
			border-color: rgba(0,0,0,0.2);
		}
	}

	&.oo-ui-widget-disabled,
	&-empty {
		.oo-ui-textInputWidget.oo-ui-indicatorElement {
			.oo-ui-indicatorElement-indicator {
				cursor: default;
				opacity: 0.2;
			}
		}
	}

	> .oo-ui-selectWidget {
		margin-top: -3px
	}
}

.theme-oo-ui-labelWidget () {
	padding: 0.5em 0;
}

.theme-oo-ui-optionWidget () {
	padding: 0.25em 0.5em;
	border: none;

	&-highlighted {
		background-color: #e1f3ff;
	}

	.oo-ui-labelElement-label {
		line-height: 1.5em;
	}

	.oo-ui-selectWidget-depressed &-selected {
		background-color: #a7dcff;
	}

	.oo-ui-selectWidget-pressed &-pressed,
	.oo-ui-selectWidget-pressed &-pressed&-highlighted,
	.oo-ui-selectWidget-pressed &-pressed&-highlighted&-selected {
		background-color: #a7dcff;
	}

	&.oo-ui-widget-disabled {
		color: #ccc;
	}
}

.theme-oo-ui-decoratedOptionWidget () {
	padding: 0.5em 2em 0.5em 3em;

	&.oo-ui-iconElement .oo-ui-iconElement-icon,
	&.oo-ui-indicatorElement .oo-ui-indicatorElement-indicator {
		top: 0;
		height: 100%;
	}

	&.oo-ui-iconElement .oo-ui-iconElement-icon {
		width: @icon-size;
		left: 0.5em;
	}

	&.oo-ui-indicatorElement .oo-ui-indicatorElement-indicator {
		width: @indicator-size;
		right: 0.5em;
	}

	&.oo-ui-widget-disabled {
		.oo-ui-iconElement-icon,
		.oo-ui-indicatorElement-indicator {
			opacity: 0.2;
		}
	}
}

.theme-oo-ui-buttonOptionWidget () {
	padding: 0;
	background-color: transparent;

	.oo-ui-buttonElement-button {
		height: @icon-size;
	}

	&.oo-ui-iconElement .oo-ui-iconElement-icon {
		margin-top: 0;
	}

	&.oo-ui-optionWidget-selected,
	&.oo-ui-optionWidget-pressed,
	&.oo-ui-optionWidget-highlighted {
		background-color: transparent;
	}
}

.theme-oo-ui-radioOptionWidget () {
	padding: 0;
	background-color: transparent;

	&.oo-ui-optionWidget-selected,
	&.oo-ui-optionWidget-pressed,
	&.oo-ui-optionWidget-highlighted {
		background-color: transparent;
	}

	&.oo-ui-labelElement .oo-ui-labelElement-label {
		padding-left: 0.5em;
	}

	.oo-ui-radioInputWidget {
		margin-right: 0;
	}
}

.theme-oo-ui-menuOptionWidget () {
	&.oo-ui-optionWidget {
		&-selected {
			background-color: transparent;
		}
		&-highlighted,
		&-highlighted.oo-ui-optionWidget-selected {
			background-color: #e1f3ff;
		}
	}
}

.theme-oo-ui-menuSectionOptionWidget () {
	padding: 0.33em 0.75em;
	color: #888;
}

.theme-oo-ui-outlineOptionWidget () {
	font-size: 1.1em;
	padding: 0.75em;

	&.oo-ui-indicatorElement .oo-ui-labelElement-label {
		padding-right: 1.5em;
	}

	&.oo-ui-indicatorElement .oo-ui-indicatorElement-indicator {
		opacity: 0.5;
	}

	&-level-0 {
		padding-left: 3.5em;

		.oo-ui-iconElement-icon {
			left: 1em;
		}
	}
	&-level-1 {
		padding-left: 5em;

		.oo-ui-iconElement-icon {
			left: 2.5em;
		}
	}

	&-level-2 {
		padding-left: 6.5em;

		.oo-ui-iconElement-icon {
			left: 4em;
		}
	}

	.oo-ui-selectWidget-depressed &.oo-ui-optionWidget-selected {
		background-color: #a7dcff;
		text-shadow: 0 1px 1px rgba(255,255,255,0.5);
	}

	&.oo-ui-flaggedElement-important {
		font-weight: bold;
	}

	&.oo-ui-flaggedElement-placeholder {
		font-style: italic;
	}

	&.oo-ui-flaggedElement-empty {
		.oo-ui-iconElement-icon {
			opacity: 0.5;
		}
		.oo-ui-labelElement-label {
			color: #777;
		}
	}
}

.theme-oo-ui-tabOptionWidget () {
	padding: 0.5em 1em;
	margin: 0.5em 0 0 0.75em;
	border: 1px solid transparent;
	border-bottom: none;
	border-top-left-radius: 0.5em;
	border-top-right-radius: 0.5em;

	&.oo-ui-indicatorElement .oo-ui-labelElement-label {
		padding-right: 1.5em;
	}

	&.oo-ui-indicatorElement .oo-ui-indicatorElement-indicator {
		opacity: 0.5;
	}

	.oo-ui-selectWidget-pressed &.oo-ui-optionWidget-pressed {
		background-color: transparent;
	}

	&.oo-ui-widget-enabled {
		&:hover {
			background-color: rgba(255, 255, 255, 0.2);
			border-color: #ddd;
		}

		&:active {
			background-color: #fff;
			border-color: #ddd;
		}
	}

	.oo-ui-selectWidget-pressed &.oo-ui-optionWidget-selected,
	.oo-ui-selectWidget-depressed &.oo-ui-optionWidget-selected,
	&.oo-ui-optionWidget-selected:hover {
		background-color: #fff;
		border-color: #ddd;
	}
}

.theme-oo-ui-popupWidget () {
	&-popup {
		border: 1px solid #ccc;
		border-radius: 0.25em;
		background-color: #fff;
		box-shadow: 0 0.15em 0.5em 0 rgba(0, 0, 0, 0.2);
	}

	@anchor-size: 6px;

	&-anchored {
		.oo-ui-popupWidget-popup {
			margin-top: @anchor-size;
		}

		.oo-ui-popupWidget-anchor:before,
		.oo-ui-popupWidget-anchor:after {
			content: "";
			position: absolute;
			width: 0;
			height: 0;
			border-style: solid;
			border-color: transparent;
			border-top: 0;
		}

		.oo-ui-popupWidget-anchor:before {
			bottom: -@anchor-size - 1px;
			left: -@anchor-size;
			border-bottom-color: #aaa;
			border-width: @anchor-size + 1px;
		}

		.oo-ui-popupWidget-anchor:after {
			bottom: -@anchor-size - 1px;
			left: -@anchor-size + 1px;
			border-bottom-color: #fff;
			border-width: @anchor-size;
		}
	}

	&-transitioning .oo-ui-popupWidget-popup {
		.oo-ui-transition(
			width 100ms ease-in-out, height 100ms ease-in-out, left 100ms ease-in-out
		);
	}

	&-head {
		height: 2.5em;

		.oo-ui-buttonWidget {
			margin: 0.25em;
		}

		.oo-ui-labelElement-label {
			margin: 0.75em 1em;
		}
	}

	&-body-padded {
		padding: 0 1em;
	}
}

.theme-oo-ui-searchWidget () {
	&-query {
		height: 4em;
		padding: 0 1em;
		box-shadow: 0 0 0.5em rgba(0,0,0,0.2);

		.oo-ui-textInputWidget {
			margin: 0.75em 0;
		}
	}

	&-results {
		top: 4em;
		padding: 1em;
		line-height: 0;
	}
}

.theme-oo-ui-selectWidget () {}

.theme-oo-ui-buttonSelectWidget () {
	border-radius: 0.3em;

	.oo-ui-inline-spacing(0.5em);

	.oo-ui-buttonOptionWidget {
		.oo-ui-buttonElement-button {
			border-radius: 0;
			margin-left: -1px;
		}

		&:first-child .oo-ui-buttonElement-button {
			border-bottom-left-radius: 0.3em;
			border-top-left-radius: 0.3em;
			margin-left: 0;
		}

		&:last-child .oo-ui-buttonElement-button {
			border-bottom-right-radius: 0.3em;
			border-top-right-radius: 0.3em;
		}
	}
}

.theme-oo-ui-radioSelectWidget () {
	padding: 0.75em 0 0.5em 0;
}

.theme-oo-ui-menuSelectWidget () {
	background: #fff;
	margin-top: -1px;
	border: 1px solid #ccc;
	border-radius: 0 0 0.25em 0.25em;
	box-shadow: 0 0.15em 1em 0 rgba(0, 0, 0, 0.2);
}

.theme-oo-ui-textInputMenuSelectWidget () {}

.theme-oo-ui-outlineSelectWidget () {}

.theme-oo-ui-tabSelectWidget () {
	background-color: #eee;
	box-shadow: inset 0 -0.015em 0.1em rgba(0, 0, 0, 0.1);
}

.theme-oo-ui-toggleSwitchWidget () {
	@travelDistance: 2em;
	height: 2em;
	width: @travelDistance + 2em;
	border-radius: 1em;
	box-shadow: 0 0 0 white, inset 0 0.1em 0.2em #ddd;
	border: 1px solid #ccc;

	.oo-ui-inline-spacing(0.5em);

	.oo-ui-vertical-gradient(#ddd, #fff);

	&.oo-ui-widget-disabled {
		opacity: 0.5;
	}

	&-grip {
		top: 0.25em;
		left: 0.25em;
		width: 1.5em;
		height: 1.5em;
		margin-top: -1px;
		border-radius: 1em;
		box-shadow: 0 0.1em 0.25em rgba(0, 0, 0, 0.1);
		border: 1px #c9c9c9 solid;

		.oo-ui-transition(left 200ms ease-in-out, margin-left 200ms ease-in-out);
		.oo-ui-vertical-gradient(#fff, #ddd);
	}

	&.oo-ui-widget-enabled {
		&:hover,
		&:hover .oo-ui-toggleSwitchWidget-grip {
			border-color: #aaa;
		}
	}

	.oo-ui-toggleSwitchWidget-glow {
		border-radius: 1em;
		box-shadow: inset 0 1px 4px 0 rgba(0, 0, 0, 0.07);

		.oo-ui-transition(opacity 200ms ease-in-out);
		.oo-ui-vertical-gradient(#b0d9ee, #eaf4fa);
	}

	.oo-ui-toggleWidget-on & {
		&-glow {
			opacity: 1;
		}
		&-grip {
			left: @travelDistance + 0.25em;
			margin-left: -2px;
		}
	}

	.oo-ui-toggleWidget-off & {
		&-glow {
			display: block;
			opacity: 0;
		}
		&-grip {
			left: 0.25em;
			margin-left: 0;
		}
	}
}

.theme-oo-ui-progressBarWidget () {
	max-width: 50em;
	border: 1px solid #ccc;
	border-radius: 0.25em;
	overflow: hidden;

	&-bar {
		height: 1em;
		border-right: 1px solid #ccc;
		.oo-ui-transition(width 200ms, margin-left 200ms);
		.oo-ui-vertical-gradient(@progressive-gradient-start, @progressive-gradient-end);
	}
	&-indeterminate {
		.oo-ui-progressBarWidget-bar {
			.oo-ui-animation(oo-ui-progressBarWidget-slide 2s infinite linear);
			width: 40%;
			margin-left: -10%;
			border-left: 1px solid @progressive-border;
		}
	}
	&.oo-ui-widget-disabled {
		opacity: 0.6;
	}
}

.oo-ui-progressBarWidget-slide-frames () {
	from { margin-left: -40%; }
	to { margin-left: 100%; }
}
@-webkit-keyframes oo-ui-progressBarWidget-slide { .oo-ui-progressBarWidget-slide-frames }
@-moz-keyframes oo-ui-progressBarWidget-slide { .oo-ui-progressBarWidget-slide-frames }
@-ms-keyframes oo-ui-progressBarWidget-slide { .oo-ui-progressBarWidget-slide-frames }
@-o-keyframes oo-ui-progressBarWidget-slide { .oo-ui-progressBarWidget-slide-frames }
@keyframes oo-ui-progressBarWidget-slide { .oo-ui-progressBarWidget-slide-frames }
