@use "../../00-base/colors/colors";
@use "../../00-base/mixin/core.mixin";

button[class^='hoo'],
input[class^='hoo'],
textarea[class^='hoo']{
    font-family: inherit;
}

.hoo-button {
	display: inline-flex;
	justify-content: center;

	padding: 0 1rem;

	color: colors.$neutral-700;
	border: 1px colors.$neutral-450 solid;
	border-radius: colors.$roundedCorner2;
	outline: none;
	background-color: colors.$neutral-000;

	align-items: center;
	flex-wrap: nowrap;

	cursor: pointer;
	
	&:hover {
		background-color: colors.$neutral-100;
	}
	&:active{
		background-color: colors.$neutral-200;
	}

	&[disabled],
	&:disabled {
		pointer-events: none;

		color: colors.$neutral-400;
		border-color: colors.$neutral-100;
		background-color: colors.$neutral-100;
	}
	&.is-reversed{
		flex-direction: row-reverse;
		.hoo-icon{
			margin-right: -0.25rem;
			fill: currentColor;
		}
	}
	&:not(.is-reversed){
		.hoo-icon{
			margin-left: -0.25rem;
			fill: currentColor;
		}
	}
}

.hoo-button-label {
	font-size: core.px2rem(14px);
	font-weight: 600;
	line-height: core.px2rem(20px);

	display: flex;
	justify-content: center;

	height: core.px2rem(30px);
	margin: 0 core.px2rem(4px);

	align-items: center;
	white-space: nowrap;
}

// Primary button don't get a disabled state because it don't make sense
.hoo-button-primary {
	@extend .hoo-button;

	color: colors.$neutral-000;
	// border-color: Fixing border because the color is different
	border-color: colors.$theme-600;
	background-color: colors.$theme-600;

	&:hover {
		color: colors.$neutral-000;
		border-color: colors.$theme-700;
		background-color: colors.$theme-700;
	}

	&:active {
		border-color: colors.$theme-800;
		background-color: colors.$theme-800;
	}
}

.hoo-buttoncomp {
	@extend .hoo-button;

	flex-direction: column;

	padding: core.px2rem(16px) core.px2rem(12px);

	align-items: flex-start;

	&-label {
		@extend .hoo-button-label;

		line-height: 1em;

		display: block;

		height: 1em;
		margin: 0;
		margin-bottom: core.px2rem(5px);
	}

	&-desc {
		font-size: core.px2rem(10px);
		font-weight: normal;
	}
}

.hoo-buttoncomp-primary {
	@extend .hoo-button-primary;

	flex-direction: column;

	padding: core.px2rem(16px) core.px2rem(12px);

	align-items: flex-start;

	&-label {
		@extend .hoo-button-label;

		line-height: 1em;

		display: block;

		height: 1em;
		margin: 0;
		margin-bottom: core.px2rem(5px);
	}

	&-desc {
		font-size: core.px2rem(10px);
		font-weight: normal;
	}
}

a.hoo-button {
	@extend .hoo-button;

	display: inline-flex;

	width: auto;
	margin-bottom: 1rem;

	text-decoration: none;

	flex-grow: 0;
	flex-shrink: 1;

	* {
		width: auto;
	}

	&:hover {
		color: colors.$buttonText;
	}
}

a.hoo-button-primary {
	@extend .hoo-button-primary;

	display: inline-flex;

	width: auto;
	margin-bottom: 1rem;

	text-decoration: none;

	flex-grow: 0;
	flex-shrink: 1;

	&:hover {
		color: colors.$neutral-000;
		border-color: colors.$theme-700;
		background-color: colors.$theme-700;
	}

	&:active {
		border-color: colors.$theme-800;
		background-color: colors.$theme-800;
	}
}



/* Split Button Slideout Animation
% {
    opacity: 0;
}
100% {
    opacity: 1;
}
0% {
    transform: translate3d(0px, -10px, 0px);
    pointer-events: none;
}
100% {
    transform: translate3d(0px, 0px, 0px);
    pointer-events: auto;
}

*/
