@import "selectize";

#g5-container {//wrapper

#settings {
    h2 {
        &:first-child {
            margin-top: 0.5rem;
        }
    }
}

.settings-block {
    width: 100%;

    min-width: inherit;

    &.card {
        .badge {
            margin-left: 4px;
        }
    }

    &.disabled {
        opacity: 0.6;
    }

    .advanced {
        color: $orange;
    }

    .alert {
        margin: $content-margin 0;
    }

    .settings-param {
        @extend .clearfix;
        padding: 10px 5px;
        clear: both;
        position: relative;
        border-bottom: 1px solid #f4f4f4;

        &.input-hidden {
            display: none;
            @extend %list-reset;
        }

        &:last-child {
            border-bottom: 0;
        }

        .button.button-simple {
            background-color: $light-gray;
            color: darken($light-gray, 30%);
            padding: 6px 8px;

            &:hover {
                background-color: darken($light-gray, 10%);
                color: darken($light-gray, 50%);
            }
        }
    }

    .g-instancepicker-title {
        margin-right: 0.5rem;
        font-style: italic;
        &:empty {
            margin: 0;
        }
    }

    .input-small {
        width: 120px !important;
    }

    input.settings-param-toggle {
        position: absolute;
        top: 50%;
        right: 0;
        margin: -7px 15px 0 0;
        z-index: 5;

        &:checked {
            + .settings-param-override {
                opacity: 0;
                z-index: -1;
            }
        }
    }

    .settings-param-override {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        padding: 0;
        background-color: transparentize(#f4f4f4, 0.5);
        z-index: 4;
        opacity: 1;
        @include transition(opacity 0.3s ease-in-out, z-index 0.3s ease-in-out);
        @include backface-visibility(hidden);
        /*@include linear-gradient(90deg, transparentize($white, 0.7) 0%, transparentize($white, 0.7) 150px, transparentize($white, 0.4) 150px, transparentize($white, 0.4) 100%);*/
    }

    .settings-param-field {
        margin-left: 175px;

        // fields reset
        .g-reset-field {
            display: inline-block;
            opacity: 0;
            cursor: pointer;

            @include transition(opacity 0.2s ease-in-out);
        }

        .input-group .g-reset-field {
            display: table-cell;
            vertical-align: middle;
            padding-left: 4px; // 4px is the display: inline-block gap
        }

        &:hover {
            .g-reset-field {
                opacity: 1;

                @include transition(opacity 0.2s ease-in-out);
            }
        }
    }

    .settings-param-title {
        max-width: 175px;
        margin: 5px;
    }


    i {
        line-height: inherit;
    }

    .fa {
        width: 1rem;
        text-align: center;
    }

    .fa-lg {
        font-size: inherit;
        vertical-align: inherit;
    }

    input, textarea {
        padding: 6px 12px;
        border: 1px solid $medium-gray;
        margin: 0;
        height: auto;
        max-width: 100%;
        font-size: $core-font-size;
        line-height: $core-line-height;
        border-radius: $core-border-radius;
    }

    select {
        margin: 0 0 10px;
        display: inline-block;
    }

    input:not(.settings-param-toggle):not([type="checkbox"]), select, .collection-list ul, .colorpicker, .multi.selectize-control {
        width: 275px;
        @include breakpoint(no-desktop) {
            width: 100%;
        }
    }

    textarea {
        width: 90%;
        min-height: 150px;
    }

    .input-group {
        &.append, &.prepend {
            input {
                width: 235px;
                @include breakpoint(mobile-only) {
                    width: 100% !important;
                }
            }
        }
    }

    .selectize-control.single {
        width: 275px !important;
        @include breakpoint(tablet-range) {
            width: 100% !important;
        }
        @include breakpoint(mobile-only) {
            width: 92% !important;
        }
    }

    img {
        display: block;
    }

    &.search {
        position: relative;
        margin-bottom: 10px;

        i {
            position: absolute;
            right: 10px;
            top: 50%;
            margin-top: -12px;
        }
    }
}

.g-panel-filters {
    position: relative;
    margin-bottom: 1rem;
    display: inline-block;

    .search.settings-block {
        width: auto;
        display: inline-block;
        margin-bottom: 0;
        margin-right: 5px;
    }

    .search, input, .button {
        font-size: 0.85rem;
    }
}

.g-filters-bar {
    label {
        @extend .font-small;
        display: inline-block;
        margin: 0 0 0 1rem;
        border-left: 1px solid $medium-gray;
        line-height: 30px;
        padding-left: 1rem;

        input {
            display: inline-block;
        }
    }
}

// modal
.g5-dialog {

    .settings-block {
        width: 100%;
        margin: 0 0 15px;
    }

    .g-modal-body {
        overflow-x: hidden;
        overflow-y: scroll;
        max-height: 650px;
    }

    .settings-param {
        padding: 5px;
        @include breakpoint(no-desktop) {
            padding: 2px 5px;
            border: 0;
        }
    }
}

// fields styles
.settings-param-field-colorpicker {
    position: relative;

    .settings-param-field-colorpicker-preview {
        position: absolute;
        top: 2px;
        right: 2px;
        bottom: 2px;
        width: $core-line-height + em(1px);
        border-radius: 3px;
    }
}

// collections
.collection-list .settings-param-field, .collection-keyvalue .settings-param-field .g-keyvalue-field {
    ul {
        @extend %list-reset;
        margin: 5px 0;
        display: table;

        li {
            //padding: 0.1rem 0;
            position: relative;
            display: table-row;
            line-height: $core-line-height - 0.2;

            &:only-child {
                .fa-reorder {
                    display: none;
                }

                a {
                    margin-left: 0;
                }
            }
        }
    }

    .item-reorder {
        cursor: row-resize;
        color: lighten($dark-gray, 20%);
        display: table-cell;
    }
}

.collection-list .settings-param-field {
    ul:not(.collection-sorting) li {
        &:hover [data-title-edit], &:hover [data-collection-remove] {
            color: $dark-gray;
            opacity: 1;
        }

        &[data-collection-item]:hover a {
            color: $core-accent;
        }
    }

    [data-collection-item] a {
        color: $core-text;
        margin-left: 5px;
        vertical-align: middle;
        display: table-cell;
        padding: 0.3rem 0.4rem;
    }

    [data-title-edit], [data-collection-remove] {
        cursor: pointer;
        color: lighten($dark-gray, 40%);
        //float: right;
        //margin-top: 0.4rem;
        opacity: 0;
        display: table-cell;
        padding-left: 0.4rem;
        //@include transition(all 0.2s ease-in-out);
    }
}

}//endwrapper
