/**
 *
 *
 *  @author Björn Hase, Tentakelfabrik
 *  @license http://opensource.org/licenses/MIT The MIT License
 *  @link https://github.com/tentakelfabrik/plain-ui
 *
 */

.button {
    appearance: none;
    position: relative;

    display: inline-flex;
    align-items: center;
    text-decoration: none;

    font-family: $plain-ui__font-family;
    font-size: 1rem;

    border: 1px solid var(--primary);
    background-color: var(--white);
    color: var(--primary);

    border-radius: $plain-ui__border-radius;
    transition: background-color 0.1s;

    margin-bottom: 0.5em;
    padding: 0 1.3em;
    min-height: 2.8em;
    width: 100%;

    @include plain-ui__media-sm() {
        width: auto;
    }

    &--small {
        font-size: 0.8rem;
    }

    &--transparent {
        margin: 0;
        padding: 0;
        border: none;
        background: transparent;

        &:focus, &:active {
            outline: none;
        }
    }

    &:hover, &--selected {
        cursor: pointer;
        text-decoration: none;
        color: white;
        background-color: var(--primary-active);
    }

    &:focus, &:active {
        outline: 1px solid var(--primary-active);
    }

    &:disabled {
        opacity: 0.5;

        &:hover {
            cursor: not-allowed;
            border: 1px solid var(--primary);
            background-color: white;
            color: var(--primary);
        }
    }

    &--danger {
        border-color: var(--danger);

        &:hover {
            background-color: var(--danger);
        }

        &:focus, &:active {
            outline: 2px solid var(--primary-active);
        }
    }

    &--success {
        border-color: var(--success);

        &:hover {
            background-color: var(--sucess);
        }

        &:focus, &:active {
            outline: 2px solid var(--primary-active);
        }
    }

    &--outline {
        background-color: transparent;

        &:hover {
            color: var(--primary);
            border-color: var(--primary-light);
            background-color: transparent;
        }
    }

    &--danger.button--outline {
        &:hover {
            border-color: var(--danger-light);
        }
    }

    &--success.button--outline {
        &:hover {
            border-color: var(--success-light);
        }
    }
}