/**
 *
 *
 *  @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: $font-family;
    font-size: 1rem;

    border: 1px solid var(--border);
    background-color: var(--background-contrast);
    color: var(--text);

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

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

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

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

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

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

    &:disabled {
        opacity: 0.5;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    &--outline {
        background-color: transparent;

        &:hover {
            color: var(--border);
            border-color: lighten($color__primary, 40%);
            background-color: transparent;
        }
    }

    &--danger.button--outline {
        &:hover {
            border-color: lighten($color__danger, 20%);
        }
    }

    &--info.button--outline {
        &:hover {
            border-color: lighten($color__info, 20%);
        }
    }

    &--success.button--outline {
        &:hover {
            border-color: lighten($color__success, 20%);
        }
    }
}