// Icon scss
@import "icons";
@import "variables";
@import "components";
@import "mixins";
@import "animations";

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*:focus {
    outline: none;
}

a:link,
a:hover,
a:visited,
a:focus,
a:active {
    text-decoration: none;
    color: $brand-color;
}

textarea {
    resize: none;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

h1 {
    font-size: 28px;
    color: $font-color;
    margin-top: 0;
}

h2 {
    font-size: 24px;
    color: $font-color;
}

h3 {
    font-size: 20px;
    color: $font-color;
}

h4 {
    font-size: 16px;
    color: $font-color;
}

h5 {
    font-size: 12px;
    color: $font-color;
}

.hide {
    display: none !important;
}

.btn {
    @include box-shadow(
        0 1px 4px 0 rgba(0, 0, 0, 0.2),
        0 0 8px 0 rgba(0, 0, 0, 0.1)
    );
    @include border-radius(3px);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font: inherit;
    display: inline-block;

    &:hover,
    &:active,
    &:focus {
        opacity: 0.75;
        border: none;
    }

    &.btn-sm {
        padding: 6px 12px;
    }
    &.btn-md {
        padding: 8px 16px;
    }
    &.btn-lg {
        padding: 10px 20px;
    }
    &.btn-xl {
        padding: 12px 24px;
        font-size: 16px;
    }

    &.btn-primary {
        background: $brand-color;
        color: #ffffff;
    }

    &.btn-black {
        background: #000;
        color: #ffffff;
    }

    &:disabled,
    &[disabled="disabled"],
    &[disabled="disabled"]:hover,
    &[disabled="disabled"]:active {
        cursor: not-allowed;
        background: #b1b1ae;
        box-shadow: none;
        opacity: 1;
    }
}

.dropdown-btn {
    min-width: 150px;
    text-align: left;
    background: #ffffff;
    border: 2px solid $control-border-color;
    @include border-radius(3px);
    font-size: 14px;
    padding: 8px 35px 8px 10px;
    cursor: pointer;
    position: relative;

    &:hover,
    &:active,
    &:focus {
        opacity: 0.75;
        border: 2px solid $control-border-color;
    }

    .icon {
        position: absolute;
        right: 10px;
        top: 50%;
        margin-top: -4px;
    }
}

.dropdown-open {
    position: relative;
}

.dropdown-list {
    width: 200px;
    margin-bottom: 20px;
    @include box-shadow(
        0 2px 4px 0 rgba(0, 0, 0, 0.16),
        0 0 9px 0 rgba(0, 0, 0, 0.16)
    );
    @include border-radius(3px);
    background-color: #ffffff;
    position: absolute;
    display: none;
    z-index: 10;
    text-align: left;

    &.bottom-left {
        top: 42px;
        left: 0px;
    }
    &.bottom-right {
        top: 42px;
        right: 0px;
    }
    &.top-left {
        bottom: 0px;
        left: 42px;
    }
    &.top-right {
        bottom: 0px;
        right: 42px;
    }

    .search-box {
        padding: 20px;
        border-bottom: 1px solid $border-color;

        .control {
            background: #fff;
            border: 2px solid $control-border-color;
            @include border-radius(3px);
            width: 100%;
            height: 36px;
            display: inline-block;
            vertical-align: middle;
            transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            padding: 0px 10px;
            font-size: 15px;

            &:focus {
                border-color: $brand-color;
            }
        }
    }

    .dropdown-container {
        padding: 20px;
        overflow-y: auto;

        label {
            font-size: 15px;
            display: inline-block;
            text-transform: uppercase;
            color: #9e9e9e;
            font-weight: 700;
            padding-bottom: 5px;
        }

        ul {
            margin: 0px;
            list-style-type: none;
            padding: 0px;

            li {
                padding: 5px 0px;

                a:link,
                a:active,
                a:visited,
                a:focus {
                    color: #333333;
                    display: block;
                }
                a:hover {
                    color: $brand-color;
                }

                .checkbox {
                    margin: 0;
                }

                .control-group label {
                    color: $font-color;
                    font-size: 15px;
                    font-weight: 500;
                    text-transform: capitalize;
                    width: 100%;
                }
            }
        }

        .btn {
            width: 100%;
            margin-top: 10px;
        }
    }
}

.table {
    width: 100%;
    overflow-x: auto !important;

    table {
        border-collapse: collapse;
        text-align: left;
        width: 100%;

        thead th {
            font-weight: 700;
            padding: 12px 10px;
            background: #f8f9fa;
            color: $font-color;
        }

        tbody td {
            padding: 10px;
            border-bottom: solid 1px #d3d3d3;
            color: $font-color;
            vertical-align: top;

            &.actions {

                .icon {
                    cursor: pointer;
                    vertical-align: middle;
                }
            }

            &.empty {
                text-align: center;
            }
        }

        tbody tr:last-child td {
            border-bottom: none;
        }
    }

    .control-group {
        width: 100%;
        margin-bottom: 0;
        min-width: 140px;

        .control {
            width: 100%;
            margin: 0;
        }
    }
}

.pagination {
    .page-item {
        background: #ffffff;
        border: 2px solid $control-border-color;
        @include border-radius(3px);
        padding: 7px 14px;
        margin-right: 5px;
        font-size: 16px;
        display: inline-block;
        color: #8e8e8e;
        vertical-align: middle;
        text-decoration: none;

        &.previous,
        &.next {
            padding: 6px 9px;
        }

        &.active {
            background: #0041ff;
            color: #fff;
            border-color: #0041ff;
        }

        .icon {
            vertical-align: middle;
            margin-bottom: 3px;
        }
    }
}

.checkbox {
    position: relative;
    display: block;
    // vertical-align: middle;

    input {
        left: 0;
        opacity: 0;
        position: absolute;
        top: 0;
        height: 24px;
        width: 24px;
        z-index: 100;
    }

    .checkbox-view {
        background-image: url("../images/Checkbox.svg");
        height: 24px;
        width: 24px;
        margin: 0;
        display: inline-block !important;
        vertical-align: middle;
        margin-right: 5px;
    }

    input:checked + .checkbox-view {
        background-image: url("../images/Checkbox-Checked.svg");
    }

    input:disabled + .checkbox-view {
        opacity: 0.5;
        cursor: not-allowed;
    }
}

.radio {
    position: relative;
    display: block;
    margin: 10px 5px 5px 0px;

    input {
        left: 0;
        opacity: 0;
        position: absolute;
        top: 0;
        z-index: 100;
    }

    .radio-view {
        background-image: url("../images/controls.svg");
        background-position: -21px 0px;
        height: 20px;
        width: 20px;
        margin: 0;
        display: inline-block !important;
        vertical-align: middle;
        margin-right: 5px;
    }

    input:checked + .radio-view {
        background-position: -21px -21px;
    }

    input:disabled + .radio-view {
        opacity: 0.5;
        cursor: not-allowed;
    }
}

.control-group {
    display: block;
    margin-bottom: 25px;
    font-size: 15px;
    color: #333333;
    width: 750px;
    max-width: 100%;
    position: relative;

    label {
        display: block;
        color: $font-color;

        &.required::after {
            content: "*";
            color: $danger-color;
            font-weight: 700;
            display: inline-block;
        }
    }

    textarea.control {
        height: 100px;
        padding: 10px;
    }

    .control {
        background: #fff;
        border: 2px solid $control-border-color;
        @include border-radius(3px);
        width: 70%;
        height: 36px;
        display: inline-block;
        vertical-align: middle;
        transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0px 10px;
        font-size: 15px;
        margin-top: 10px;
        margin-bottom: 5px;

        &:focus {
            border-color: $brand-color;
        }

        &[disabled="disabled"] {
            border-color: #d3d3d3;
            background-color: #d3d3d3;
            cursor: not-allowed;
        }

        &[multiple] {
            height: 100px;
        }
    }

    &.date, &.datetime {
        &::after {
            background-image: url("../images/Icon-Calendar.svg");
            width: 24px;
            height: 24px;
            content: '';
            display: inline-block;
            vertical-align: middle;
            margin-left: -34px;
            margin-top: 2px;
            pointer-events: none;
        }
    }

    .control-info {
        display: block;
        font-size: 14px;
        color: #6F6F6F;
        font-style: italic;
    }

    .control-error {
        display: none;
        color: #ff5656;
        margin-top: 5px;
    }

    &.has-error .control {
        border-color: $danger-color;
    }

    &.has-error .control-error {
        display: block;
    }

    &.price {
        .currency-code {
            vertical-align: middle;
            display: inline-block;
        }
    }
}

.button-group {
    margin-top: 20px;
    margin-bottom: 20px;
}

.alert-wrapper {
    width: 300px;
    top: 10px;
    right: 10px;
    position: fixed;
    z-index: 100;
    text-align: left;

    .alert {
        width: 300px;
        padding: 15px;
        @include border-radius(3px);
        display: inline-block;
        @include box-shadow(
            0px 4px 15.36px 0.64px rgba(0, 0, 0, 0.1),
            0px 2px 6px 0px rgba(0, 0, 0, 0.12)
        );
        position: relative;
        animation: jelly 0.5s ease-in-out;
        transform-origin: center top;
        z-index: 500;
        margin-bottom: 10px;

        &.alert-error {
            background: $danger-color;
        }

        &.alert-info {
            background: $info-color;
        }

        &.alert-success {
            background: $success-color;
        }

        &.alert-warning {
            background: $warning-color;
        }

        .icon {
            position: absolute;
            right: 10px;
            top: 10px;
            cursor: pointer;
        }

        p {
            color: #ffffff;
            margin: 0px;
            padding: 0px;
            font-size: 15px;
        }
    }
}

.tabs {
    ul {
        border-bottom: solid 1px $border-color;

        li {
            display: inline-block;

            a {
                padding: 15px 20px;
                cursor: pointer;
                margin: 0px 2px;
                text-align: center;
                color: #000311;
                display: block;
            }

            &.active a {
                border-bottom: 3px solid $brand-color;
            }
        }
    }
}

.accordian, accordian {
    display: inline-block;
    width: 100%;

    .accordian-header, div[slot*="header"] {
        width: 100%;
        display: inline-block;
        font-size: 18px;
        color: $font-color;
        border-top: solid 1px $border-color;
        border-bottom: solid 1px $border-color;
        padding: 20px 15px;
        cursor: pointer;
        margin-top: -1px;

        .expand-icon {
            background-image: url("../images/Expand-Light.svg");
            margin-right: 10px;
            margin-top: 3px;
        }

        h1 {
            margin: 0;
            font-size: 20px;
            display: inline-block;
        }

        .icon {
            float: right;

            &.left {
                float: left;
            }
        }
    }

    .accordian-content, div[slot*="body"] {
        width: 100%;
        padding: 20px 15px;
        display: none;
        transition: 0.3s ease all;
    }

    &.active > .accordian-content {
        display: inline-block;
    }

    &.active > .accordian-header .expand-icon {
        background-image: url("../images/Expand-Light-On.svg");
    }
}

.tree-container {
    .tree-item {
        padding-left: 30px;
        display: inline-block;
        margin-top: 10px;
        width: 100%;

        > .tree-item {
            display: none;
        }

        &.active > .tree-item {
            display: inline-block;
        }

        .checkbox {
            margin: 0;
            display: inline-block;
        }

        .radio {
            margin: 0;
            display: inline-block;
        }

        .expand-icon {
            display: inline-block;
            margin-right: 10px;
            cursor: pointer;
            background-image: url("../images/Expand-Light.svg");
            width: 18px;
            height: 18px;
            vertical-align: middle;
        }

        .folder-icon {
            vertical-align: middle;
            margin-right: 10px;
        }

        &.active {
            > .expand-icon {
                background-image: url("../images/Expand-Light-On.svg");
            }
        }
    }

    > .tree-item {
        padding-left: 0;
    }
}

.panel {
    @include box-shadow(0 2px 25px 0 rgba(0, 0, 0, 0.15));
    @include border-radius(5px);
    background: #fff;

    .panel-content {
        padding: 20px;
    }
}

modal {
    display: none;
}

.modal-open {
    overflow: hidden;
}

.modal-overlay {
    display: none;
    overflow-y: auto;
    z-index: 10;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
    position: fixed;
    background: #000;
    opacity: 0.7;
}

.modal-open .modal-overlay {
    display: block;
}

.modal-container {
    background: #ffffff;
    top: 200px;
    width: 600px;
    max-width: 80%;
    left: auto;
    right: auto;
    position: absolute;
    z-index: 11;
    @include box-shadow(
        0px 15px 25px 0px rgba(0, 0, 0, 0.03),
        0px 20px 45px 5px rgba(0, 0, 0, 0.2)
    );
    animation: fade-in-white 0.3s ease-in-out;
    animation: jelly 0.5s ease-in-out;
    @include border-radius(5px);

    .modal-header {
        padding: 20px;

        h3 {
            display: inline-block;
            font-size: 20px;
            color: $font-color;
            margin: 0;
        }

        .icon {
            float: right;
            cursor: pointer;
        }
    }

    .modal-body {
        padding: 20px;

        .control-group .control {
            width: 100%;
        }
    }
}

// responsive css for modal
@media only screen and (max-width: 770px) {
    .modal-container {
        max-width: 80%;
        left: 10%;
        margin-left: 0px;
    }
}

.label {
    background: #E7E7E7;
    @include border-radius(2px);
    padding: 8px;
    color: #000311;
    display: inline-block;

    &.label-sm {
        padding: 5px;
    }

    &.label-md {
        padding: 8px;
    }

    &.label-lg {
        padding: 11px;
    }

    &.label-xl {
        padding: 14px;
    }
}

.badge {
    @include border-radius(50px);
    color: white;
    padding: 8px;
    white-space: nowrap;

    &.badge-sm {
        padding: 5px;
    }

    &.badge-md {
        padding: 3px 10px;
    }

    &.badge-lg {
        padding: 11px;
    }

    &.badge-xl {
        padding: 14px;
    }

    &.badge-success {
        background-color: $success-color;
    }

    &.badge-info {
        background-color: $brand-color;
    }

    &.badge-danger {
        background-color: $danger-color;
    }

    &.badge-warning {
        background-color: $warning-color;
    }
}

//Image wrapper
.image-wrapper {
    margin-bottom: 20px;
    margin-top: 10px;
    display: inline-block;
    width: 100%;

    .image-item {
        width: 200px;
        height: 200px;
        margin-right: 20px;
        background: #F8F9FA;
        @include border-radius(3px);
        display: inline-block;
        position: relative;
        background-image: url("../images/placeholder-icon.svg");
        background-repeat: no-repeat;
        background-position: center;
        margin-bottom: 20px;

        img.preview {
            width: 100%;
            height: 100%;
        }

        input {
            display: none;
        }

        .remove-image {
            background-image: linear-gradient(-180deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.24) 100%);
            @include border-radius(0 0 4px 4px);
            position: absolute;
            bottom: 0;
            width: 100%;
            padding: 10px;
            text-align: center;
            color: #fff;
            text-shadow: 0 1px 2px rgba(0,0,0,0.24);
            margin-right: 20px;
            cursor: pointer;
        }

        &:hover .remove-image {
            display: block;
        }

        &.has-image {
            background-image: none;
        }
    }
}

.vue-swatches__trigger {
    border: 1px solid #d3d3d3;
}
