@import "../style/base";
@import "button-vars";

:host {
	--_button-color: #{$button-color};
	--_button-bg: #{$button-bg};
	--_button-shadow-color: #{$button-shadow-color};

	color: var(--_button-color);
	background: var(--_button-bg);
	box-shadow: elevation(1, var(--_button-shadow-color));

	padding: $button-padding;
	font-size: $button-font-size;
	border-radius: $button-border-radius;
	font-family: $button-font-family;
	transition: $button-transition;
	letter-spacing: $button-letter-spacing;

	line-height: 1;
	text-transform: uppercase;
	cursor: pointer;
	text-align: center;
	user-select: none;
	outline: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;

	// Add ellipsis when the text is too long
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;

	// Make sure the ripple is behind the text but visible inside the button
	position: relative;
	z-index: 0;
}

:host([fab]) {
	width: $button-fab-size;
	height: $button-fab-size;

	padding: 0;
	letter-spacing: 0;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	border-radius: 100%;
}

:host([inverted]) {
	color: var(--_button-bg);
	background: var(--_button-color);
}

:host([outlined]) {
	border: $button-border-outlined;
}

:host(:hover), :host(:focus) {
	--_button-color: #{$button-color-hover};
	--_button-bg: #{$button-bg-hover};
	--_button-shadow-color: #{$button-shadow-color-hover};
	will-change: background, color, box-shadow;
}

:host(:active) {
	--_button-color: #{$button-color-active};
	--_button-bg: #{$button-bg-active};
	box-shadow: elevation(4, var(--_button-shadow-color));
}

:host([flat]:focus) {
	background: $button-bg-active-flat;
}

:host([disabled]) {
	--_button-color: #{$button-color-disabled};
	--_button-bg: #{$button-bg-disabled};
	box-shadow: none;
	cursor: default;
	pointer-events: none;
}

:host([flat]) {
	box-shadow: none;
	background: none;
}

#ripple {
	z-index: -1;
}

