.molstar-btn {
    padding: 0 $control-spacing;
    line-height: $row-height;
    border: none;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.molstar-btn, .molstar-btn:active, .molstar-btn-link:focus, .molstar-btn:hover {
    outline: none !important;
}

.molstar-btn-icon {
    height: $row-height;
    width: $row-height;
    line-height: $row-height;
    padding: 0;
    text-align: center;
}

.molstar-btn-link {
    .molstar-icon {
        font-size: 100%;
    }
}

.molstar-btn-link, .molstar-btn-link:active, .molstar-btn-link:focus {
    color: $molstar-btn-link-font-color;
    text-decoration: none;
}

.molstar-btn-link:hover {
    color: $hover-font-color;
    text-decoration: none;
}

.molstar-btn-link-toggle-on {
    color: $molstar-btn-link-toggle-on-font-color;
}

.molstar-btn-link-toggle-off, .molstar-btn-link-toggle-off:active, .molstar-btn-link-toggle-off:focus {
    color: $molstar-btn-link-toggle-off-font-color;
}

.molstar-btn-link-toggle-off:hover,  .molstar-btn-link-toggle-on:hover {
    color: $hover-font-color;
}

@mixin molstar-btn($name, $font, $bg) {
    .molstar-btn-#{$name}, .molstar-btn-#{$name}:active, .molstar-btn-#{$name}:focus {
        color: $font;
        background: $bg;
    }
    .molstar-btn-#{$name}:hover {
        color: $hover-font-color;
        background: color-lower-contrast($bg, 2.5%);
    }

    .molstar-btn-#{$name}[disabled], .molstar-btn-#{$name}[disabled]:hover,
    .molstar-btn-#{$name}[disabled]:active, .molstar-btn-#{$name}[disabled]:focus {
        color: color-lower-contrast($font, 1%);
    }
}

@include molstar-btn('remove', $molstar-btn-remove-font-color, $molstar-btn-remove-background);
@include molstar-btn('action', $font-color, $molstar-btn-action-background);
@include molstar-btn('commit-on', $molstar-btn-commit-on-font-color, $molstar-btn-commit-on-background);
@include molstar-btn('commit-off', $molstar-btn-commit-off-font-color, $molstar-btn-commit-off-background);

.molstar-btn-remove:hover {
    color: $molstar-btn-remove-hover-font-color;
}
.molstar-btn-commit-on:hover {
	color: $molstar-btn-commit-on-hover-font-color;
}

.molstar-btn-action {
    height: $row-height;
    line-height: $row-height;
}

.molstar-form-control {
    width: 100%;
    background: $molstar-form-control-background;
    color: $font-color;
    border: none !important;
    padding: 0 $control-spacing;
    line-height: $row-height - 2px;
    height: $row-height;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: none !important;

    &:hover {
        color: $hover-font-color;
        background-color: color-increase-contrast($molstar-form-control-background, 5%);
        border: none;
        outline-offset: -1px;
        outline: 1px solid color-increase-contrast($molstar-form-control-background, 20%);
    }

    &:active, &:focus {
        color: $font-color;
        background-color: $molstar-form-control-background;
        border: none;
        outline-offset: 0;
        outline: none;
    }
}

.molstar-btn-commit {
    text-align: right;
    padding-top: 0;
    padding-bottom: 0;
    padding-right: $control-spacing;
    padding-left: 0;
    line-height: $row-height;
    border: none;
    overflow: hidden;

    .molstar-icon {
        display: block-inline;
        line-height: $row-height;
        margin-right: $control-spacing;
        width: $row-height;
        text-align: center;
        float: left;
    }
}

select.molstar-form-control {
    background: none;
    background-color: $molstar-form-control-background;
    background-size: 8px 12px;
    background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAMAAACzvE1FAAAADFBMVEUzMzMzMzMzMzMzMzMKAG/3AAAAA3RSTlMAf4C/aSLHAAAAPElEQVR42q3NMQ4AIAgEQTn//2cLdRKppSGzBYwzVXvznNWs8C58CiussPJj8h6NwgorrKRdTvuV9v16Afn0AYFOB7aYAAAAAElFTkSuQmCC);
    background-repeat: no-repeat;
    background-position: right $control-spacing top (($row-height - 12px) / 2);
}

select.molstar-form-control:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 $font-color;
}