﻿:root {
    --blazor-load-percentage: 0;
}

html, body {
    font-family: 'Open Sans', 'Noto Sans SC', sans-serif;
    font-variant-numeric: proportional-nums;
    font-size: 0.9rem;
}

body {
    background-color: #1249ffe6;
    background-image:
            linear-gradient(25deg, rgba(0, 0, 0, 0.15) 65%, transparent, rgba(0, 0, 0, 0.15) 70%),
            linear-gradient(-25deg, rgba(0, 0, 0, 0.15) 65%, transparent, rgba(0, 0, 0, 0.15) 70%),
            linear-gradient(-25deg, rgba(0, 0, 0, 0.15) 30%, transparent, rgba(0, 0, 0, 0.15) 35%),
            linear-gradient(25deg, rgba(0, 0, 0, 0.15) 30%, transparent, rgba(0, 0, 0, 0.15) 35%),
            linear-gradient(65deg, rgba(0, 0, 0, 0.15) 65%, transparent, rgba(0, 0, 0, 0.15) 70%),
            linear-gradient(-65deg, rgba(0, 0, 0, 0.15) 65%, transparent, rgba(0, 0, 0, 0.15) 70%),
            linear-gradient(-65deg, rgba(0, 0, 0, 0.15) 30%, transparent, rgba(0, 0, 0, 0.15) 35%),
            linear-gradient(65deg, rgba(0, 0, 0, 0.15) 30%, transparent, rgba(0, 0, 0, 0.15) 35%);
    background-size:
            5em 2em,
            5em 2em,
            5em 2em,
            5em 2em,
            2em 5em,
            2em 5em,
            2em 5em,
            2em 5em;
}

/* 
    Scrollbar
*/

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #dddddd;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #c7c7c7
}

/*
    Grid background
 */

.bg-grid{
    background-color: #F6F9FC;
    background-image: radial-gradient(circle at 10px 10px, lightgrey 1px, transparent 0);
    background-size: 20px 20px;
}
.bg-grid.invalid{
    border: 1px solid #dc3545;
}
.bg-grid.disabled{
    background-color: #e1efff;
}

/*
    Loading Splash and Global Error
    ------------------------------
    Toggled by "/framework/blazor.webassembly.js" when a runtime error occurs in blazor. 
    This also attaches an click event handler to any element with a "dismiss" class 
    when clicked, "display:block" style is applied 
*/
#blazor-error-ui {
    display: none;
}

.loader {
    width: 48px;
    height: 48px;
    display: block;
    margin:15px auto;
    position: relative;
    color: #FFF;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}
.loader::after,
.loader::before {
    content: '';
    box-sizing: border-box;
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    transform: scale(0.5) translate(0, 0);
    background-color: #FFF;
    border-radius: 50%;
    animation: animloader 1s infinite ease-in-out;
}
.loader::before {
    background-color: #ff8d0a;
    transform: scale(0.5) translate(-48px, -48px);
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
@keyframes animloader {
    50% {
        transform: scale(1) translate(-50%, -50%);
    }
}

.splash {
    cursor: default;
    user-select: none;
    --webkit-user-select: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #131958;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1080; /* .modal : 1060 (.modal-backdrop: 1070), .blazored-toast-container : 1070  */
}
    .splash > p {
        color: #fff;
        font-weight: 200;
        font-size: 0.8rem;
        letter-spacing: 0.2em;
        text-transform: uppercase;
    }

.linear-progress {
    background: silver;
    width: 25vw;
    margin-bottom: 10px;
    height: 0.8rem;
    border-radius: 10rem;
    overflow: hidden;
    position: relative;
}

.linear-progress:after {
    content: '';
    position: absolute;
    inset: 0;
    background: #ff8d0a;
    scale: var(--blazor-load-percentage, 0%) 100%;
    transform-origin: left top;
    transition: scale ease-out 0.6s;
}

/*
    Validation
    BS uses .is-invalid, but EditForm uses .invalid.
    copy the BS is-invalid to blazor invalid
*/
.form-control.invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + .75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

textarea.form-control.invalid {
    background-position: top 0.5em right 1.2em
}

/*
    MainLayout 
    Includes the main and sidebar
*/

.sidebar-wrapper .nav-link{
    width: 40px !important;
    background-color: transparent;
}
.sidebar .nav{
    margin-top: 10px;
}

.wrapper {
    align-items: stretch;
    display: flex;
    width: 100%;
    overflow-x: hidden;
}

@media (min-width: 1px) and (max-width: 991.98px) {
    .sidebar {
        margin-right: 0;
    }
}

/*
    Custom Buttons
 */

.btn-collapse {
    border-width: 0;
}
.btn-collapse img {
    filter: opacity(0.50);
    overflow: hidden;
    transition-duration: .35s;
    transition-property: transform;
}
.btn-collapse.rotate-up img{
    transform: rotate(-90deg);
}

.btn-refresh{
    opacity: 0.5;
}
.btn-refresh:hover{
    opacity: 1;
}
.btn-refresh.rotate i{
    pointer-events: none;
    animation: 1s ease-in-out infinite btn-refresh-rotate;
}
@keyframes btn-refresh-rotate {
    to { transform: rotate(360deg) }
}


/*
    Main + Sidebar
 */

@media (max-width: 991.98px) {
    .main {
        overflow-y: hidden;
    }
}

.main {
    width: 100%;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left .35s ease-in-out,left .35s ease-in-out,margin-right .35s ease-in-out,right .35s ease-in-out;
    flex-direction: column;
}
    .main > .content {
        padding: 0rem 1.1rem;
    }


@media (min-width: 1px) and (max-width: 991.98px) {
    .sidebar.collapsed {
        margin-right: -250px;
    }
}

.sidebar-close {
    position: absolute;
    right: 10px;
    top: 10px;
}

@media (min-width: 1px) and (max-width: 991.98px) {
    .sidebar.collapsed {
        margin-right: -250px;
    }
}

.sidebar {
    min-width: 290px;
    max-width: 290px;
    transition: margin-left .35s ease-in-out, left .35s ease-in-out, margin-right .35s ease-in-out, right .35s ease-in-out;
    direction: ltr;
}

.sidebar.collapsed {
    margin-right: -250px;
}

.sidebar-wrapper {
    height: 100vh;
    position: sticky;
    top: 0;
    left: 0;
    transition: margin-left .35s ease-in-out,left .35s ease-in-out,margin-right .35s ease-in-out,right .35s ease-in-out;
    display: flex;
}

.sidebar-wrapper img {
    width: 14px;
    height: 14px;
}

.sidebar-wrapper button{
    background-color: #fff;
    border: 0;
    position: relative;
}
.sidebar-wrapper button.active {
    border-right: solid 4px #ff9c1d;
    background-color: #ffe4c1;
}
.sidebar-wrapper button span{
    position: absolute;
    left: 0;
    top: 10px;
    transform: translate(-50%,-50%);
}

.sidebar-wrapper-content{
    background: rgb(246, 249, 252);
    width: 100%;
    padding: 0.5rem;
    border-left: 1px solid #dee2e6;
    overflow-x: hidden;
    overflow-y: scroll;
}


/*
    Skeleton loader
    from here : https://ant.design/components/skeleton/
    you need to wrap a <span> "skeleton-avatar skeleton-avatar-sm" or "skeleton-input skeleton-input-sm" with .skeleton div
    the input needs a width
*/

.skeleton {
    width: 100%;
    cursor: wait;
}
    .skeleton .skeleton-avatar {
        display: inline-block;
        vertical-align: top;
        background: hsla(0,0%,74.5%,.35);
        border-radius: 5px;
        width: 24px;
        height: 24px;
        line-height: 24px;
        animation: skeleton-animation 1s linear infinite;
    }

    .skeleton .skeleton-avatar-sm {
        width: 20px;
        height: 20px;
        line-height: 20px;
    }

    .skeleton .skeleton-input {
        width: 100%;
        display: inline-block;
        vertical-align: top;
        background: hsla(0,0%,74.5%,.25);
        border-radius: 3px;
        height: 24px;
        line-height: 24px;
        animation: skeleton-animation 1.5s ease infinite;
    }

    .skeleton .skeleton-input-sm {
        height: 20px;
        line-height: 20px;
    }

    .skeleton .skeleton-input-lg {
        height: 40px;
        line-height: 40px;
    }

    /*Width must be specified*/
    .skeleton .skeleton-image {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        vertical-align: top;
        background: hsla(0,0%,74.5%,.3);
        border-radius: 2px;
        animation: skeleton-animation 1s ease infinite;
    }
    .skeleton .skeleton-button {
        display: inline-block;
        vertical-align: top;
        background: hsla(0,0%,74.5%,.2);
        border-radius: 10px;
        width: 64px;
        height: 32px;
        line-height: 32px;
    }
    .skeleton .skeleton-button-lg {
        width: 150px;
        height: 50px;
        line-height: 40px;
    }
@keyframes skeleton-animation {
    0% {
        opacity: .6;
    }

    50% {
        opacity: 1.0;
    }

    100% {
        opacity: .6;
    }
}




/*
    Input Search
*/

.input-search-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

    .input-search-group input {
        position: relative;
        background-color: #fff !important; /*override form-control focus*/
        padding-right: 1.75rem;
    }

    .input-search-group button {
        padding: inherit;
        position: absolute;
        top: 50%;
        right: 5px;
        transform: translate(0%, -50%);
        background: none;
        cursor: pointer;
        border: none;
    }

        .input-search-group button:disabled {
            pointer-events: none;
            opacity: .65;
        }

    .input-search-group svg {
        fill: #878cb3;
    }
    
/*
    Blade 
*/

.blade-container {
    justify-content: flex-end;
    display: flex;
}
    .blade-container > :last-child {
        margin-right: auto;
    }

/* Limit max width to 300px unless screen is too small for two 
    blades (at 642px incl. margins), then show only one blade */
@media (max-width: 641.98px) {
    .blade {
        min-width: 300px;
        flex: 0 0 100%;
        margin-left: 2px;
    }
}

@media (min-width: 642px) {
    .blade {
        max-width: 300px;
        min-width: 300px;
        flex: none;
    }
}

.blade {
    align-self: flex-start;
    flex-direction: column;
    margin-right: 13px;
    border-radius: 4px;
    padding-bottom: 2px;
    background-color: #F6F9FC;
    box-shadow: 0 3px 7px rgba(50,50,93,.1), 0 2px 2px rgba(0,0,0,.08);
    overflow: hidden;
    --blade-header-height: 100px;
}
.blade .badge{
    font-size: 0.9rem;
    background-color: #dfe6ef;
    color: #424770;
    font-weight: 500;
    user-select: none;
    --webkit-user-select: none;
}
    .blade > .blade-header {
        cursor: default;
        display: flex;
        border-radius: 4px 4px 0px 0px; /* line up top radius with the blade container*/
        padding: 15px;
        height: var(--blade-header-height);
    }

    .blade .blade-header .buttons{
        position: absolute;
        top: 0;
        right: 0;
        padding-right: 0.5rem;
    }
    .blade .blade-header .buttons button{
        opacity: 0.5;
    }
    .blade .blade-header .buttons button:hover{
        opacity: 1;
    } 
    
        .blade > .blade-header > .blade-header-image {
            align-self: center;
            width: 48px;
            height: 48px;
            border-radius: 2px;
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow:
                    2px 2px 2px rgba(50,50,93,.1),
                    1px 1px 1px rgba(0,0,0,.08);
        }
            .blade > .blade-header > .blade-header-image i {
                color: #ffffff;
                font-size: 25px;
            }

        .blade > .blade-header > .blade-header-title {
            display: flex;
            flex-direction: column;
            align-self: center;
            margin-left: 10px;
            overflow: hidden;
        }

            .blade > .blade-header > .blade-header-title h4 {
                margin-bottom: 0px;
                padding-bottom: 4px;
                line-height: 1;
                text-overflow: ellipsis;
                overflow: hidden;
                white-space: nowrap;
            }

            .blade > .blade-header > .blade-header-title p {
                margin-bottom: 0rem;
                text-overflow: ellipsis;
                overflow: hidden;
                white-space: nowrap;
            }
        /*not sure if will use this - right arrow*/
        .blade > .blade-header > a {
            padding: 2px 5px 0px 0px;
            color: #fff;
            cursor: pointer;
        }

    .blade > .blade-content {
        padding: 2px;
        overflow-y: scroll;
        overflow-x: hidden;
        max-height: calc(100 * var(--vh) - 120px - var(--blade-header-height));
    }

        .blade > .blade-content .blade-content-section {
            padding-left: 14px;
            padding-bottom: 10px;
        }

            .blade > .blade-content .blade-content-section h5,
            .blade .blade-content .blade-content-section-title{
                text-transform: uppercase;
                color: #4247709c;
                cursor: default;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
            .blade > .blade-content .blade-content-section .input-search-group {
                margin-left: -7px; /* line up with selector */
                padding-bottom: 6px;
            }

            /*
                blade-content-section-item
                ---------------------------
                This has img + a + badge
                states : disabled, unauthorized, selected
            */

            .blade > .blade-content .blade-content-section .blade-content-section-item {
                position: relative;
                display: flex;
                padding: 6px 2.5px 6px 6px; /*line up the icon-locks between section */
                margin: 1px -6px 1px -6px;
                border-right: solid transparent 4px; /*match width of the *selected* class so lined up */
                align-items: center;
            }
                .blade > .blade-content .blade-content-section .blade-content-section-item.disabled,
                .blade > .blade-content .blade-content-section .blade-content-section-item.unauthorized {
                    filter: opacity(60%);
                    pointer-events: none;
                }

                .blade > .blade-content .blade-content-section .blade-content-section-item.selected:not(.disabled),
                .blade > .blade-content .blade-content-section .blade-content-section-item.selected:not(.unauthorized) {
                    background-color: rgba(13,110,253,.25);
                    color: white;
                }

                .blade > .blade-content .blade-content-section .blade-content-section-item:hover:not(.selected):not(.disabled),
                .blade > .blade-content .blade-content-section .blade-content-section-item:hover:not(.selected):not(.unauthorized) {
                    background-color: #E5EAF0;
                }

                .blade > .blade-content .blade-content-section .blade-content-section-item.active {
                    background-color: #E5EAF0;
                }

                .blade > .blade-content .blade-content-section .blade-content-section-item > img {
                    margin-right: 10px;
                }

                .blade > .blade-content .blade-content-section .blade-content-section-item > .horizontal-line {
                    position: absolute;
                    top: 18px;
                    left: 5px;
                    width: 100%; /*we size the div*/
                    border: 0.5px solid #6e6e97;
                }

                .blade > .blade-content .blade-content-section .blade-content-section-item > button {
                    font-size: 1rem;
                    color: #424770;
                    align-self: center;
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                    border-color: transparent !important;
                }

            /* Align ends with selector */
            .blade > .blade-content .blade-content-section .blade-content-search-item {
                margin: 8px 0px 8px -8px;
            }
                .blade > .blade-content .blade-content-section .blade-content-search-item > input {
                    width: 100%;
                    min-height: calc(1.5em + .75rem + 2px);
                    padding: .375rem .75rem;
                    font-size: 1rem;
                    font-weight: 400;
                    border: 1px solid #ced4da;
                    border-radius: .25rem;
                    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
                }
                    .blade > .blade-content .blade-content-section .blade-content-search-item > input:focus {
                        border-color: #8bbafe;
                        outline: 0;
                        box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25);
                    }


/*
    Rule : 
    If not enough to show at least 1 x blade + blade-form + margins (300 + 900 + c.a. 50 = 1250px) then allow the blade-form
    to fill the page (min-width: 100%). Otherwise width is 900px
*/

@media (max-width: 1250px) {
    .blade-form {
        min-width: 300px;
    }
}

/* for large screen limit to 900px, unless maximised */
@media (min-width: 1250px) {
    .blade-form {
        max-width: 900px;
    }
}

.blade-form {
    margin-right: 13px;
    background-color: #ffff;
    padding: 0 20px 20px 20px;
    border-radius: 4px;
    box-shadow: 0 3px 7px rgba(50,50,93,.1), 0 2px 2px rgba(0,0,0,.08);
    overflow-y: auto;
    max-height: calc(100 * var(--vh) - 57px - 38px - 25px); /*available = vh - navbar - breadcrumb - padding*/
    display: flex;
    flex-direction: column;
    flex: 0 0 100%;
    height: 0%; /*believe me - 0% != 0*/
}
    .blade-form.maximised{
        /*height: calc(100 * var(--vh) - 57px - 38px - 25px);*/
        max-width: initial;
    }

    .blade-form .header {
        padding: 20px 0 5px 0;
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        text-overflow: ellipsis;
        white-space: nowrap;
        background-color: #fff;
        z-index: 3;
    }
    .blade-form .header h2{
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .blade-form .header .buttons{
        margin-top: -16px;
    }
    .blade-form .header .buttons button{
        opacity: 0.5;
    }
    .blade-form .header .buttons button:hover{
        opacity: 1;
    }

    .blade-form .content {
        padding-top: 20px;
        display: flex;
        flex-direction: column;
        margin-bottom: 20px;
    }

    .blade-form .buttons-bar {
        display: flex;
        flex-direction: row;
    }
