/* Buttons */
.btn,
.button,
input.submit,
input[type="submit"] {
    @include transition (all 0.1s);
}

button {
    border: 1px solid #ccc;
}

.btn-default {
    color: #666;
}

.btn-icon i {
    margin-#{$right}: 10px;
}

.btn-icon-right i {
    margin-#{$right}: 0;
    margin-#{$left}: 10px;
}

@each $state in $states {
    .btn-#{nth($state,1)} {
        border-color: #{nth($state,2)};
        background-color: #{nth($state,2)};
        border-color: #{nth($state,2)} #{nth($state,2)} darken(nth($state,2), 10%);
        color: #{nth($state,3)};
        text-shadow: 0 -1px 0 rgba(0,0,0,.25);

        &:hover {
            border-color: lighten(nth($state,2), 5%) lighten(nth($state,2), 5%) darken(nth($state,2), 5%);
            background-color: darken(nth($state,2), 5%);
            color: #{nth($state,3)};
        }

        &:active,
        &:focus {
            border-color: darken(nth($state,2), 5%);
            background-color: darken(nth($state,2), 5%);
            color: #{nth($state,3)};
        }

        &.dropdown-toggle {
            border-left-color: darken(nth($state,2), 5%);
        }

        &[disabled] {
            border-color: darken(nth($state,2), 20%);
            background-color: darken(nth($state,2), 20%);
            color: #CCC;
        }
    }
}

/* Border Buttons */
.btn-borders {
    border-width: 3px;
}

@each $state in $states {
    .btn-borders {
        &.btn-#{nth($state,1)} {
            background: transparent;
            border-color: #{nth($state,2)};
            color: #{nth($state,2)};
            text-shadow: none;
            &:hover, &:focus {
                background-color: darken(nth($state,2), 5%);
                border-color: #{nth($state,2)} !important;
                color: #{nth($state,3)};
            }
        }
    }
}

/* Border Buttons - Sizes */
.btn-borders {
    padding: 4px 12px;
}

.btn-borders.btn-lg, .btn-group-lg > .btn-borders.btn {
    padding: 8px 16px;
}

.btn-borders.btn-sm, .btn-group-sm > .btn-borders.btn {
    border-width: 2px;
    padding: 4px 10px;
}

.btn-borders.btn-xs, .btn-group-xs > .btn-borders.btn {
    padding: 1px 5px;
    border-width: 1px;
}

/* 3D Buttons */
.btn-3d {
    border-bottom-width: 3px;
    padding: 5px 12px;
    border-radius: $border-medium;
}

.btn-3d.btn-lg, .btn-group-lg > .btn-3d.btn {
    padding: 9px 16px;
}

.btn-3d.btn-sm, .btn-group-sm > .btn-3d.btn {
    border-width: 2px;
    padding: 4px 10px;
}

.btn-3d.btn-xs, .btn-group-xs > .btn-3d.btn {
    padding: 1px 5px;
    border-width: 1px;
}

.btn-flat {
    display: inline-block;
}

