/**
 * selectize.bootstrap3.css (v0.12.3) - Bootstrap 3 Theme
 * Copyright (c) 2013–2015 Brian Reavis & contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the License at:
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
 * ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 *
 * @author Brian Reavis <brian@thirdroute.com>
 */

$selectize-font-family: inherit !default;
$selectize-font-size: inherit !default;
$selectize-line-height: $line-height-computed !default;

$selectize-color-text: $input-color !default;
$selectize-color-highlight: rgba(255,237,40,0.4) !default;
$selectize-color-input: $input-bg !default;
$selectize-color-input-full: $input-bg !default;
$selectize-color-input-error: $state-danger-text !default;
$selectize-color-input-error-focus: darken($selectize-color-input-error, 10%) !default;
$selectize-color-disabled: $input-bg !default;
$selectize-color-item: mix($selectize-color-input, $selectize-color-text, 90%) !default;
$selectize-color-item-border: rgba(black, 0) !default;
$selectize-color-item-active: $component-active-bg !default;
$selectize-color-item-active-text: color-contrast($selectize-color-item-active) !default;
$selectize-color-item-active-border: rgba(black, 0) !default;
$selectize-color-optgroup: $dropdown-bg !default;
$selectize-color-optgroup-text: $dropdown-header-color !default;
$selectize-color-optgroup-border: $dropdown-divider-bg !default;
$selectize-color-dropdown: $dropdown-bg !default;
$selectize-color-dropdown-text: $dropdown-link-color !default;
$selectize-color-dropdown-border-top: mix($input-border, $input-bg, 0.8) !default;
$selectize-color-dropdown-item-active: $dropdown-link-hover-bg !default;
$selectize-color-dropdown-item-active-text: $dropdown-link-hover-color !default;
$selectize-color-dropdown-item-create-active-text: $dropdown-link-hover-color !default;
$selectize-opacity-disabled: 0.5 !default;
$selectize-shadow-input: none !default;
$selectize-shadow-input-focus: inset 0 1px 2px rgba(black, 0.15) !default;
$selectize-shadow-input-error: inset 0 1px 1px rgba(black, .075) !default;
$selectize-shadow-input-error-focus: inset 0 1px 1px rgba(black, .075), 0 0 6px lighten($selectize-color-input-error, 20%) !default;
$selectize-border: 1px solid $input-border !default;
$selectize-border-radius: $input-border-radius !default;

$selectize-width-item-border: 0 !default;
$selectize-padding-x: $padding-base-horizontal !default;
$selectize-padding-y: $padding-base-vertical !default;
$selectize-padding-dropdown-item-x: $padding-base-horizontal !default;
$selectize-padding-dropdown-item-y: 3px !default;
$selectize-padding-item-x: 3px !default;
$selectize-padding-item-y: 1px !default;
$selectize-margin-item-x: 3px !default;
$selectize-margin-item-y: 3px !default;
$selectize-caret-margin: 0 !default;

$selectize-arrow-size: 5px !default;
$selectize-arrow-color: $selectize-color-text !default;
$selectize-arrow-offset: $selectize-padding-x + 5px !default;

@import "selectize";

//Import Plugins
@import "plugins/drag_drop";
@import "plugins/dropdown_header";
@import "plugins/optgroup_columns";
@import "plugins/remove_button";

.selectize-dropdown, .selectize-dropdown.form-control {
    height: auto;
    padding: 0;
    margin: 2px 0 0 0;
    z-index: $zindex-dropdown;
    background: $selectize-color-dropdown;
    color: $selectize-color-dropdown-text;
    border: 1px solid $dropdown-fallback-border;
    border: 1px solid $dropdown-border;
    @include selectize-border-radius ($border-radius-base);
    @include selectize-box-shadow (0 6px 12px rgba(black, .175));
}

.selectize-dropdown {
    .optgroup-header {
        font-size: $font-size-small;
        line-height: $line-height-base;
    }
    .optgroup:first-child:before {
        display: none;
    }
    .optgroup:before {
        content: ' ';
        display: block;
        @include nav-divider;
        margin-left: $selectize-padding-dropdown-item-x * -1;
        margin-right: $selectize-padding-dropdown-item-x * -1;
    }
}

.selectize-dropdown-content {
    padding: 5px 0;
}

.selectize-dropdown-header {
    padding: $selectize-padding-dropdown-item-y * 2 $selectize-padding-dropdown-item-x;
}

.selectize-input {
    min-height: $input-height-base;

    &.dropdown-active {
        @include selectize-border-radius ($selectize-border-radius);
    }
    &.dropdown-active::before {
        display: none;
    }
    &.focus {
        $color: $input-border-focus;
        $color-rgba: rgba(red($color), green($color), blue($color), .6);
        border-color: $color;
        outline: 0;
        @include selectize-box-shadow ("inset 0 1px 1px rgba(black, .075), 0 0 8px #{$color-rgba}");
    }
}

.has-error .selectize-input {
    border-color: $selectize-color-input-error;
    @include selectize-box-shadow ($selectize-shadow-input-error);

    &:focus {
        border-color: $selectize-color-input-error-focus;
        @include selectize-box-shadow ($selectize-shadow-input-error-focus);
    }
}

.selectize-control {
    &.multi {
        .selectize-input.has-items {
            padding-left: $selectize-padding-x - $selectize-padding-item-x;
            padding-right: $selectize-padding-x - $selectize-padding-item-x;
        }
        .selectize-input > div {
            @include selectize-border-radius ($selectize-border-radius - 1px);
        }
    }
}

.form-control.selectize-control {
    padding: 0;
    height: auto;
    border: none;
    background: none;
    @include selectize-box-shadow (none);
    @include selectize-border-radius (0);
}
