@import "./InvisibleTextStyles.css";

:host {
	display: inline-block;
	box-sizing: border-box;
	border: none;
	height: 2.25rem;
}

:host([multi-line]) {
	height: auto;
}

:host([multi-line]) .ui5-tokenizer--content {
	display: flex;
	align-content: baseline;
	flex-wrap: wrap;
	padding: .25rem;
	box-sizing: border-box;
	gap: var(--_ui5_tokenizer_gap);
	overflow-y: auto;
	overflow-x: hidden;
}

:host([multi-line])::slotted([ui5-token]) {
	margin: 0;
	white-space: nowrap;
	text-overflow: ellipsis;
	max-width: 100%;
}

:host([disabled]) {
	opacity: 40%;
	pointer-events: none;
}

:host(:not([expanded])) .ui5-tokenizer-root {
	overflow: hidden;
}

:host([_tokens-count="0"]) .ui5-tokenizer-root {
	padding: 0;
}

.ui5-tokenizer-root {
	height: 100%;
	display: flex;
	align-items: center;
	box-sizing: border-box;
	touch-action: none;
	font-family: var(--sapFontFamily);
}

.ui5-tokenizer--token--wrapper {
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	height: 100%;
}

:host([expanded]) .ui5-tokenizer--content {
	display: inline-flex;
	white-space: nowrap;
	overflow: hidden;
}

.ui5-tokenizer--content {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	overflow: hidden;
	padding-inline-start: var(--_ui5_tokenizer_padding);
	height: 100%;
	box-sizing: border-box;
}

.ui5-tokenizer--list{
	display: contents;
}

:host([_tokens-count="1"]) .ui5-tokenizer--content {
	padding-inline-end: 4px;
	box-sizing: border-box;
	max-width: 100%;
	flex: 1;
}

.ui5-tokenizer-more-text {
	display: inline-block;
	margin-inline-start: var(--_ui5_token_right_margin);
	cursor: pointer;
	white-space: nowrap;
	font-size: var(--sapFontSize);
	font-weight: normal;
	color: var(--_ui5_tokenizer_n_more_text_color);
}

.ui5-tokenizer-more-text:hover {
	text-decoration: underline;
}

/* Underline needs to be removed on mousedown. */
.ui5-tokenizer-more-text:active {
	text-decoration: none;
}

.ui5-tokenizer--clear-all {
	color: var(--sapLinkColor);
	font-family: var(--sapFontFamily);
	font-size: var(--sapFontSize);
	cursor: pointer;
	outline: none;
}

.ui5-tokenizer--clear-all:hover {
	color: var(--sapLink_Hover_Color);
	text-decoration: var(--_ui5_link_hover_text_decoration);
}

.ui5-tokenizer--clear-all:active {
	color: var(--sapLink_Active_Color);
	text-decoration: var(--_ui5_link_active_text_decoration);
}