@import '~bootstrap/scss/functions';
@import '~bootstrap/scss/variables';
@import '~bootstrap/scss/mixins';
@import '../../styles/variables';
@import '../../styles/mixins';
@import '../../styles/utils';

body {
    &.iframe-mode {
        .content-wrapper {
            margin: 0 !important;
        }
    }

    @include customScrollBar();
}

// Add button follow the accent
// -----------------------------------------------
@each $color, $value in $accent-colors {
    .btn-#{$color} {
        @include button-variant($value, $value);
    }
}

@each $color, $value in $accent-colors {
    .btn-outline-#{$color} {
        @include button-outline-variant($value);
    }
}

// .strong class
// -----------------------------------------------
.strong {
    font-weight: 600;
}

// Fix cursor for .close and a tag
// -----------------------------------------------
a,
.close {
    cursor: pointer;
}

// Fix link color when adding .accent-*
// -----------------------------------------------
[class*=accent-] {
    [class *="btn-"]:not(.btn-link):not(.btn-default) {
        &,
        &.hover,
        &:active,
        &:hover {
            color: #fff;
        }
    }

    a.btn.btn-default {
        color: #444 !important;

        &.hover,
        &:active,
        &:hover {
            color: #2b2b2b !important;
        }
    }
}

// Fix size when adding .text-sm
// -----------------------------------------------
.text-sm {
    .btn.btn-xs {
        font-size: .75rem !important;
    }

    &.brand-link,
    & .brand-link {
        .brand-image {
            margin-left: .8rem;
        }
    }

    .sidebar-collapse .nav-flat .nav-icon {
        margin-left: 0.6rem;
    }

    // Fix height of main content
    .wrapper .content-wrapper {
        min-height: calc(100vh - calc(3.5rem) - calc(2.5rem));
    }

    // Make .nav-icon center vertical in .nav-item and bigger
    .nav-sidebar > .nav-item {
        .nav-link {
            color: #c2c7d0;
        }

        > .nav-link {
            padding-top: .6rem;
            padding-bottom: .6rem;
        }

        .nav-icon {
            transform: translateY(2px);
            font-size: 1rem !important;
        }

        .nav-icon ~ .fas {
            margin-top: 2px;
        }
    }

    // Correct line-height of .btn in .input-group
    .input-group:not(.input-group-lg) {
        .btn {
            line-height: 24px;
        }
    }
}

// Table
// -----------------------------------------------
.table-responsive {
    .table {
        margin-bottom: 0;
    }
}

// Make textarea resizable vertically only
// -----------------------------------------------
textarea.form-control {
    resize: vertical;
}

// Error state for CKEditor
// -----------------------------------------------
.form-group.has-error .cke_chrome {
    border-color: #dc3545;
}

// Dropzone
// -----------------------------------------------
.dropzone {
    border: 3px dashed #ddd !important;
    border-radius: 5px !important;

    .dz-message {
        font-size: 24px;
        color: #bbb;
    }
}

// SweetAlert2
// -----------------------------------------------
.swal2-header {
    border: 0;
    padding: 0;
}

// Ekko Lightbox
// -----------------------------------------------
.ekko-lightbox {
    .modal-title {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }
}

// Loading
// -----------------------------------------------
.loading {
    position: relative;
    background: #fff !important;
    overflow: hidden;
    padding: 30px;
    height: 120px;

    &:before {
        position: absolute;
        content: '';
        top: 50%;
        left: 50%;
        width: 60px;
        height: 60px;
        margin: -30px 0 0 -30px;
        background: no-repeat 50% 50%;
        background-size: 50px 50px;
        animation: rotate 1.6s infinite linear;
        z-index: 999;
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(360deg);
    }
}

// Error page
// -----------------------------------------------
.page-error .content-header {
    display: none;
}
