// Forms
// --------------------------------------------------
// Form
// -------------------------
.qor-form-container {
    margin: 24px;
}

.qor-slideout__body .qor-form-container {
    margin: 24px 0;
    padding: 0;
    box-shadow: none;
}

.qor-textarea__input {
    border: 1px solid rgba(0, 0, 0, 0.12);
    outline: none;
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.4 !important;
}

.qor-form__actions {
    margin-top: 24px;
    @include clearfix();
    .percent-complete {
        margin-top: -22px;
        font-weight: 600;
    }
    #qor-submit-loading {
        float: right;
        .mdl-spinner {
            margin: 0 24px 24px 0;
        }
    }
    .mdl-button {
        float: right;
        + .mdl-button {
            margin-right: 8px;
        }
    }
}

.mdl-switch {
    width: auto;
    &.is-upgraded {
        padding-right: 28px;
    }
}

.mdl-textfield textarea.mdl-textfield__input {
    overflow: initial !important;
}

// Search Form
// -------------------------
.qor-search-container {
    float: right;
    z-index: 1;
    background-color: inherit;
}

// Add to .qor-page__header
.qor-search,
.qor-global-search {
    height: 56px;
    padding: 14px 6px;
    .mdl-button {
        top: 10px;
    }
    .qor-search__label {
        color: unquote('rgba(#{$color-black}, 0.54)');
    }
    .qor-search__input {
        font-size: 14px;
    }
    .qor-search__clear {
        display: none;
    }
    &.is-dirty,
    &.is-focused {
        .qor-search__label {
            &,
            &:hover {
                background-color: transparent;
                cursor: default;
            }
        }
        .qor-search__clear {
            right: -7px;
            display: block;
        }
    }
}

// Field
// -------------------------
.qor-field__label {
    display: block;
    max-width: 100%;
    font-size: 12px;
    color: unquote('rgba(#{$color-black}, 0.54)');
    font-weight: 500;
}

.qor-field__value {
    display: block;
    padding: 4px 0;
}

.qor-field__input {
    width: 100%;
}

.qor-field__block {
    display: block;
    padding-bottom: 20px;
    position: relative;
}


.chosen-container {
    margin-top: 8px;
}

.qor-field__show {
    display: none;
    margin-top: 8px;
    margin-bottom: 20px;
}

[data-upgraded] > .qor-field__show {
    margin-bottom: 0;
}

.qor-page__show {
    .qor-field__show {
        display: block;
    }
    .qor-field__edit,
    .qor-fieldset__delete,
    .qor-fieldset__add {
        display: none;
    }
}

.qor-page__edit {
    .qor-field__show {
        display: none;
    }
    .qor-field__edit,
    .qor-fieldset__delete {
        display: block;
    }
    .qor-fieldset__add {
        display: inline-block;
        &.mdl-menu__item {
            display: block;
        }
    }
}

button.qor-fieldset__add,
.qor-fieldset__add-promotion,
.qor-button__icon-add {
    font-size: 12px;
    padding: 0;
    &:hover,
    &:active,
    &:focus:not(:active) {
        background: none;
    }
}

.qor-field {
    padding-top: 4px;
    padding-bottom: 4px;
    &.is-error {
        margin-bottom: 16px;
        .qor-field__label,
        .qor-field__error,
        .mdl-textfield__label {
            color: unquote('rgb(#{$color-accent})');
        }
        .qor-field__error {
            display: block;
            font-size: 12px;
            > i {
                font-size: 18px;
                vertical-align: top;
            }
            > span {
                + span {
                    margin-left: 8px;
                }
            }
        }
        .mdl-textfield,
        .qor-field__block {
            + .qor-field__error {
                margin-top: -16px;
            }
        }
    }
    .mdl-textfield__label {
        font-weight: 500;
    }
    .mdl-checkbox__label {
        font-size: 14px;
    }
}

// Custom modifier for .mdl-textfield
.qor-field {
    .mdl-textfield__label {
        color: unquote('rgba(#{$color-black}, 0.54)');
        font-size: 12px;
        top: 4px;
    }
    .mdl-textfield__input {
        font-size: 14px;
    }
    .mdl-textfield.is-dirty .mdl-textfield__label,
    .mdl-textfield.has-placeholder .mdl-textfield__label {
        visibility: visible;
    }
}

.qor-textfield--condensed {
    padding-top: 0;
    padding-bottom: 0;
    .mdl-textfield__label {
        top: 0;
        font-size: 14px;
        &:after {
            bottom: 0;
        }
    }
    .mdl-textfield__input {
        font-size: 14px;
    }
}

// File input
// -------------------------
.qor-file {
    position: relative;
    display: block;
    margin-top: 8px;
    &.is-svg {
        .qor-file__list {
            > ul {
                > li {
                    text-align: center;
                    img {
                        display: inline-block;
                        max-width: 90%;
                    }
                }
            }
        }
    }
}

.qor-file__list {
    overflow: hidden;
    > ul {
        margin-top: 12px;
        margin-bottom: 0;
        padding-left: 0;
        list-style: none;
        > li {
            position: relative;
            float: left;
            display: block;
            width: 150px;
            height: 150px;
            margin-right: 10px;
            margin-bottom: 10px;
            border: 1px solid unquote('rgba(#{$color-black}, 0.12)');
            background-color: unquote('rgb(#{$color-white})');
            overflow: hidden;
            > span {
                position: absolute;
                bottom: 0;
                width: 100%;
                box-sizing: border-box;
                padding: 5px;
                font-size: 12px;
                line-height: 20px;
                text-align: center;
                background-color: unquote('rgba(#{$color-white}, 0.5)');
                &:first-letter {
                    text-transform: uppercase;
                }
            }
            img {
                display: block;
                margin-left: auto;
                margin-right: auto;
                max-width: 100%;
                max-height: 160px;
            }
        }
    }
    .qor-file__list-item {
        position: relative;
        display: inline-block;
        width: 150px;
        height: 80px;
        border: 1px solid unquote('rgba(#{$color-black}, 0.12)');
        background-color: unquote('rgb(#{$color-white})');
        margin-top: 12px;
        .qor-file__action {
            position: absolute;
            right: 0;
            bottom: 0;
            left: 0;
            top: 0;
            z-index: 1;
            display: block;
            padding: 5px;
            font-size: 12px;
            text-align: center;
            background-color: unquote('rgba(#{$color-black}, 0.75)');
            opacity: 0;
            a {
                display: inline-block;
                color: #fff;
                width: 48px;
                height: 48px;
                margin-top: 16%;
                &:hover {
                    i {
                        color: unquote('rgb(#{$color-primary})');
                    }
                }
            }
        }
        &:hover {
            .qor-file__action {
                opacity: 1;
            }
        }
        > span {
            display: flex;
            font-size: 12px;
            align-items: center;
            line-height: 1.1;
            height: 80px;
            img {
                display: block;
                margin: auto;
                max-height: 80px;
            }
            span {
                display: inline-block;
                width: 100%;
                box-sizing: border-box;
                padding: 0 12px;
                text-align: center;
                word-break: break-all;
            }
        }
    }
}

// Fieldset
// -------------------------
.qor-fieldset {
    position: relative;
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 16px 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    &.qor-fieldset--new {
        display: none;
    }
    .mdl-textfield__input {
        margin-top: 10px;
    }
    .qor-fieldset {
        background-color: unquote('rgb(#{$palette-grey-50})');
        box-shadow: none;
        border: 1px solid unquote('rgba(#{$color-black}, 0.12)');
        .qor-fieldset {
            background-color: #fff;
            .qor-fieldset {
                background-color: unquote('rgb(#{$palette-grey-50})');
            }
        }
    }
}

.qor-fieldset__delete {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.qor-fieldset__alert {
    padding-top: 8px;
    padding-bottom: 8px;
    text-align: center;
}

// Section
// ------------------------
.qor-section-columns-2 .qor-field {
    width: 50%;
    float: left;
    padding-right: 40px;
    box-sizing: border-box;
    .mdl-textfield .qor-field__edit {
        margin-top: 14px;
    }
}

.qor-section-columns-3 .qor-field {
    width: 33.33%;
    float: left;
    padding-right: 20px;
    box-sizing: border-box;
}

.promotion-coupons .qor-section-columns-3 .qor-field {
    &:first-child {
        width: 50%;
        .mdl-textfield {
            width: 100% !important;
        }
    }
    &:last-child {
        margin-top: 36px;
    }
    &:nth-child(2) {
        width: 60px;
        .mdl-textfield__label {
            overflow: inherit;
        }
    }
}

::-webkit-input-placeholder {
    /* WebKit, Blink, Edge */
    color: unquote('rgba(#{$color-black}, 0.12)');
}

::-moz-placeholder {
    /* Mozilla Firefox 19+ */
    color: unquote('rgba(#{$color-black}, 0.12)');
    opacity: 1;
}

:-ms-input-placeholder {
    /* Internet Explorer 10-11 */
    color: unquote('rgba(#{$color-black}, 0.12)');
}

.mdl-checkbox__label {
    line-height: 22px;
}
.mdl-checkbox {
    height: auto;
    margin-bottom: 12px;
}
