:host {
	--input-padding-side: .5rem;
	--input-value-padding-top: 1.25rem;
	--input-value-padding-bottom: .25rem;
	--input-min-height: 3rem;
	min-height: var(--input-min-height);
	box-sizing: border-box;
	border-radius: var(--smoothly-input-border-radius);
}

:host[looks="border"] {
	border: rgb(var(--smoothly-input-border)) solid 1px;
}
:host([looks="border"]:not([readonly]):not([disabled]):focus-within) {
	outline: 2px solid rgb(var(--smoothly-input-border-focus));
}
:host[looks="border"][readonly] {
	border: transparent solid 1px;
}

:host[looks="line"] {
	border-bottom: rgb(var(--smoothly-input-border)) solid 1px;
	position: relative;
}
:host[looks="line"][readonly] {
	border-bottom: transparent solid 1px;
}
:host([looks="line"]:not([readonly]):not([disabled]):focus-within)::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-bottom: 2px solid rgb(var(--smoothly-input-border-focus));
	z-index: 10;
}

:host[looks="grid"] {
  flex-grow: 1;
  flex-basis: 40%;
  box-shadow: 0px 0px 0px 1px rgb(var(--smoothly-input-border));
  border: none;
}
:host[looks="grid"][readonly] {
	box-shadow: 0px 0px 0px 1px rgba(var(--smoothly-input-border-readonly));
}
:host[looks="grid"]:not([readonly]):not([disabled]):focus-within {
	position: relative;
	box-shadow: 0px 0px 0px 2px rgb(var(--smoothly-input-border-focus));
	outline: none;
	z-index: 10;
}

:host[looks="transparent"] {
	border: none;
}

:host[looks="transparent"][readonly],
:host[looks="transparent"]:not(:focus-within) {
	background-color: transparent;
}

:host[looks="transparent"][readonly]>input,
:host[looks="transparent"]:not(:focus-within)>input {
	background-color: transparent;
}

:host[looks="transparent"]:not([readonly]):focus-within {
	outline: 1px solid rgb(var(--smoothly-input-border));
}

:host([disabled]) {
	cursor: not-allowed;
	--smoothly-input-foreground: var(--smoothly-input-disabled-foreground);
	--smoothly-input-background: var(--smoothly-input-disabled-background);
	--smoothly-input-border: var(--smoothly-input-disabled-border);
}

/* --- label --- */

:host ::slotted([slot=label]),
:host .label {
	position: absolute;
	top: .6rem;
	opacity: 0.8;
	user-select: none;
	cursor: inherit;
	transform-origin: top left;
	transition: transform 100ms ease;
}

:host.floating-label ::slotted([slot=label]),
:host.has-value ::slotted([slot=label]),
:host[placeholder] ::slotted([slot=label]),
:host[readonly] ::slotted([slot=label]),
:host.floating-label .label,
:host.has-value .label,
:host.has-text .label,
:host[placeholder] .label,
:host[readonly] .label,
:host:not([readonly]):focus-within .label.float-on-focus {
	top: .2rem;
	transform: scale(0.8);
}

:host:not([show-label]):not(.show-label) .label {
	display: none;
}
:host smoothly-icon.smoothly-invalid {
	fill: rgb(var(--smoothly-input-invalid-icon, var(--smoothly-danger-color)));
}


* {
	box-sizing: border-box;
}
:host {
	position: relative;
	width: 100%;
	justify-content: center;
	align-items: center;
	display: flex;
	background-color: rgb(var(--smoothly-input-background));
	box-sizing: border-box;
}
:host>div:not([slot]) {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	padding-right: var(--input-padding-side);
}
:host>div>smoothly-input {
	width: 12em;
	--input-min-height: calc(3rem - 2px);
	--smoothly-input-border-focus: none;
}
:host>div>smoothly-input label {
	white-space: nowrap;
}
:host.output-side-right>div {
	padding: 0;
}
:host.output-side-right>div>smoothly-input {
	text-align: center;
	margin-left: var(--input-padding-side);
	border: none;
	box-sizing: border-box;
	width: 5em;
	order: 3;
	margin: 0;
}
:host.output-side-right>div>smoothly-display,
:host:not(.output-side-right)>div>label {
	display: none;
}
:host.output-side-right>div>smoothly-input input {
	padding: 0;
	text-align: center;
}
:host.output-side-right>div>smoothly-input label {
	width: 100%;
}
:host.output-side-right>div>label {
	position: static;
	font-size: inherit;
	text-align: center;
	margin: 0 var(--input-padding-side);
}

/*--------------------Reset browserspecific CSS------------------ */
:host>div>input[type=range] {
	-webkit-appearance: none;
	/* Hides the slider so that custom slider can be made */
	width: 100%;
	/* Specific width is required for Firefox. */
	background: transparent;
	/* Otherwise white in Chrome */
	height: 1.5em;
	padding: 0 .4em;
}

/*--------------------THUMB------------------ */
/* WebKit/Blink */
:host>div>input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none;
	height: 0.8em;
	width: 0.8em;
	border-radius: 100%;
	margin-top: -.25em;
	border: none;
	/* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
}
:host:not([disabled]):not([readonly])>div>input[type=range]::-webkit-slider-thumb {
	background-color: rgb(var(--smoothly-primary-color));
	cursor: pointer;
}

/* Firefox */
:host>div>input[type=range]::-moz-range-thumb {
	height: 0.8em;
	width: 0.8em;
	border-radius: 100%;
	border: none;
	background-color: rgb(var(--smoothly-input-foreground));
}
:host:not([disabled]):not([readonly])>div>input[type=range]::-moz-range-thumb {
	background-color: rgb(var(--smoothly-primary-color));
	cursor: pointer;
}

/*--------------------SLIDER TRACK------------------ */
:host>div>input[type=range]::-webkit-slider-runnable-track {
	height: .3rem;
	border-radius: 20px;
	background-color: rgb(var(--smoothly-input-foreground));
}
:host:not([disabled]):not([readonly])>div>input[type=range]::-webkit-slider-runnable-track {
	background-color: rgb(var(--smoothly-primary-color));
	cursor: pointer;
}

:host>div>input[type=range]::-moz-range-track {
	width: 100%;
	height: .3rem;
	border-radius: 20px;
	background-color: rgb(var(--smoothly-input-foreground));
}
:host:not([disabled]):not([readonly])>div>input[type=range]::-moz-range-track {
	background-color: rgb(var(--smoothly-primary-color));
	cursor: pointer;
}

:host:not([value]):not([disabled]):not([readonly])>div>input[type=range]::-webkit-slider-runnable-track {
	background-color: rgb(var(--smoothly-primary-tint));
}

:host:not([value]):not([disabled]):not([readonly])>div>input[type=range]::-moz-range-track {
	background-color: rgb(var(--smoothly-primary-tint));
}

:host[disabled]>div>input[type=range]::-webkit-slider-thumb,
:host[disabled]>div>input[type=range]::-moz-range-thumb,
:host[disabled]>div>input[type=range]::-webkit-slider-runnable-track,
:host[disabled]>div>input[type=range]::-moz-range-track,
:host[disabled],
:host[disabled] * {
	cursor: not-allowed
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
