@import "~./zul/less/_header.less";

.z-combobox,
.z-bandbox,
.z-datebox,
.z-timebox,
.z-spinner,
.z-doublespinner {
	display: inline-block;
	height: 34px;
	white-space: nowrap;

	&-input {
		.fontStyle(@baseContentFontFamily, @inputTextSize, normal, @inputColor);
		height: 34px;
		border: 1px solid @inputBorderColor;
		border-right: 0;
		.leftBorderRadius(@baseBorderRadius);
		margin: 0;
		padding: @inputPadding;
		line-height: @baseLineHeight;
		background: @inputBackgroundColor;

		&:hover {
			border-color: @inputHoverBorderColor;
		}
		&:hover + * {
			border-color: @inputHoverBorderColor;
		}
		&:focus {
			border-color: @inputFocusBorderColor;
		}
		&:focus + * {
			border-left: 1px solid @inputFocusBorderColor;
		}
		&[readonly] {
			color: @inputReadonlyColor;
			background: @inputReadonlyBackgroundColor;
		}
		&[readonly] + * {
			color: @inputReadonlyColor;
			background-color: @inputBackgroundColor;
		}
	}

	&-button {
		.iconFontStyle(@comboButtonIconSize, @comboButtonIconColor);
		display: inline-block;
		min-width: @baseButtonWidth + 8px * 2;
		height: 34px;
		border: 1px solid @inputBorderColor;
		.rightBorderRadius(@baseBorderRadius);
		padding: 6px 8px 0;
		line-height: @baseLineHeight;
		background: @inputBackgroundColor;
		text-align: center;
		vertical-align: middle;
		overflow: hidden;
		cursor: pointer;

		&:hover {
			border-color: @comboButtonHoverBorderColor;
			background: @comboButtonHoverBackgroundColor;
		}
		&:active {
			color: @comboButtonActiveIconColor;
			border-color: @comboButtonActiveBorderColor;
			background-color: @comboButtonActiveBackgroundColor;
		}
	}

	&-disabled {
		.opacity(@disabledOpacity);
		& > * {
			color: @inputDisableColor !important;
			background: @inputDisableBackgroundColor !important;
			cursor: default !important;
			&:hover {
				border-color: @inputBorderColor;
			}
			&:hover + * {
				border-color: @inputBorderColor;
			}
		}
	}

	&-invalid {
		border-color: @invalidBorderColor !important;
		& + * {
			border-left: 1px solid @invalidBorderColor !important;
		}
	}

	&-rightedge {
		border-right: 1px solid @inputBorderColor;
		.borderRadius(@baseBorderRadius);
	}
}

.z-combobox-open .z-combobox-button,
.z-bandbox-open .z-bandbox-button,
.z-datebox-open .z-datebox-button {
	border-color: @inputFocusBorderColor;
}

.z-combobox-input,
.z-bandbox-input,
.z-datebox-input {
	&[readonly] {
		cursor: pointer;
	}
}

.z-combobox-button.z-combobox-disabled,
.z-bandbox-button.z-bandbox-disabled,
.z-datebox-button.z-datebox-disabled,
.z-timebox-button.z-timebox-disabled,
.z-spinner-button.z-spinner-disabled,
.z-doublespinner-button.z-doublespinner-disabled {
	display: none;
}

.z-datebox-button,
.z-bandbox-button,
.z-combobox-button {
	font-size: 22px;
	min-height: @baseButtonHeight;
	padding-top: 8px;
}

.z-datebox-button,
.z-bandbox-button {
	text-align: center;
}

.z-timebox-button,
.z-spinner-button,
.z-doublespinner-button {
	width: 34px;
	padding: 0;
	position: relative;

	&:hover,
	&:active {
		background: @inputBackgroundColor;
	}

	& > a {
		display: block;
		color: @textColorDefault;
		height: @baseBarHeight / 2;
		padding: 0 8px;
		overflow: hidden;
		text-decoration: none;

		&:hover {
			background: @comboButtonHoverBackgroundColor;
		}
		&:active {
			color: @comboButtonActiveIconColor;
			border-color: @comboButtonActiveBorderColor;
			background: @comboButtonActiveBackgroundColor;
		}
	}
	// separator
	& > i {
		z-index: 2; // greater than arrow icon
	}
	&:hover > i {
		.size(100%, 1px);
		border-top: 1px solid @comboButtonHoverBorderColor;
		position: absolute;
		top: 15px;
		left: 0;
	}
}

.z-timebox-disabled a,
.z-spinner-disabled a,
.z-doublespinner-disabled a {
	color: @disabledColor;
	&:active,
	&:hover {
		background: 0;
	}
	// separator
	& + i[class*='-separator'] {
		display: none;
	}
}

// Inplace editing
.z-combobox-inplace .z-combobox-input,
.z-bandbox-inplace .z-bandbox-input,
.z-datebox-inplace .z-datebox-input,
.z-timebox-inplace .z-timebox-input,
.z-spinner-inplace .z-spinner-input,
.z-doublespinner-inplace .z-doublespinner-input {
	border: 0;
	padding: 3px;
	background: none;
}
.z-combobox-inplace .z-combobox-button,
.z-bandbox-inplace .z-bandbox-button,
.z-datebox-inplace .z-datebox-button,
.z-timebox-inplace .z-timebox-button,
.z-spinner-inplace .z-spinner-button,
.z-doublespinner-inplace .z-doublespinner-button {
	visibility: hidden; // Bug ZK-2216: Performance issue of Listbox and Combobox with inplace="true"
}

// combobox emptySearchMessage
.z-combobox-emptySearchMessage {
	display: block;
	padding: 4px 8px;
	position: relative;
	min-height: @comboPopupItemSize + 2px + 4px * 2;
	.borderRadius(@baseBorderRadius);
	color: @disabledColor;
}
.z-combobox-emptySearchMessage-hidden {
	display: none;
}

// Comboitem
.z-comboitem,
.z-comboitem-button {
	font-size: @comboPopupItemSize;
	white-space: nowrap;
	cursor: pointer;
}
.z-comboitem {
	display: block;
	padding: 4px 8px;
	position: relative;
	min-height: @comboPopupItemSize + 2px + 4px * 2; //ZK-2783: give default height to empty item
	.borderRadius(@baseBorderRadius);
}
.z-comboitem-inner,
.z-comboitem-content {//description
	.iconFontStyle(@comboPopupDescSize, @comboPopupDescColor);
}
.z-comboitem,
.z-comboitem a,
.z-comboitem a:visited {
	font-size: @comboPopupItemSize;
	font-weight: normal;
	color: @comboPopupItemColor;
	text-decoration: none;
}
.z-comboitem:hover {
	background-color: @comboPopupItemHoverBackgroundColor;
}
.z-comboitem-selected {
	color: @comboPopupItemSelectedColor;
	& * {
		color: @comboPopupItemSelectedColor;
	}
}
.z-comboitem-text {
	line-height: @comboPopupItemSize + 2;
}
.z-comboitem-image {
	margin-top: -4px;
	margin-right: 4px;
	float: left;

	&:empty {
		margin-right: 0;
	}
}
.z-comboitem-icon {
	.iconFontStyle(@comboPopupIconSize, @comboPopupIconColor);
	padding-right: 4px;
}
.z-combobox-popup,
.z-bandbox-popup,
.z-datebox-popup,
.z-timebox-popup {
	font-family: @baseContentFontFamily;
	font-weight: normal;
	font-size: @fontSizeMedium;
	color: @textColorDefault;
	display: block;
	border: 1px solid @comboPopupBorderColor;
	.borderRadius(@baseBorderRadius);
	padding: 4px 8px;
	background: @popupBackgroundColor;
	position: absolute;
	overflow: hidden;
}

.z-combobox-popup {
	overflow: auto;
	min-height: 10px;
}

.z-bandbox-popup {
	overflow: auto;
	padding: 8px;
	min-height: 10px;
}

.z-combobox-content {
	border: 0;
	padding: 0;
	margin: 0;
	background: transparent none repeat 0 0;
	position: relative;
	list-style: none outside none;
}

//Shadow
.z-combobox-shadow,
.z-bandbox-shadow,
.z-datebox-shadow {
	.boxShadow('0 3px 6px 0 rgba(0,0,0,0.16), 0 2px 4px 0 rgba(0,0,0,0.24)');
}
