@use 'sass:color';
@use 'src/views/styles/colors.module.scss';

.button {
    background-color: #000;
    color: #fff;
    padding: 10px;
    margin: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.1s ease-in-out;
    font-family: 'Inter';

    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
        background-color: #fff;
        color: #000;
    }

    &:active {
        transform: scale(0.96);
    }

    &.disabled {
        cursor: not-allowed !important;
        opacity: 0.5 !important;

        &:active {
            transform: unset;
        }
    }

    @each $color,
        $value
            in (
                primary: colors.$burnt_orange,
                secondary: colors.$charcoal,
                tertiary: colors.$bluebonnet,
                danger: colors.$speedway_brick,
                warning: colors.$tangerine,
                success: colors.$turtle_pond,
                info: colors.$turquoise
            )
    {
        &.#{$color} {
            background-color: $value;
            color: #fff;

            &:hover {
                background-color: color.adjust($value, $lightness: 10%);
            }

            &:focus-visible,
            &:active {
                background-color: color.adjust($value, $lightness: -10%);
            }

            &.disabled {
                background-color: $value !important;
            }
        }
    }
}
