@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');
@import "../../common/css/lib/fontawesome-pro-6/css/all.css";
@import "../../common/css/lib/bulma.css";
@import "../../site/css/ipi-usercontent.css";
@import "../../site/css/ipi-variables.css";

/*menu*/
:root {
    /*general*/
    --bulma-body-font-size: 13px;
    --bulma-body-size: 13px;

    /*forms*/
    --bulma-control-padding-vertical: calc(0.1em - 1px);
}

.menu {
    --bulma-menu-item-color-h: 100%;
    --bulma-menu-item-color-s: 100%;
    --bulma-menu-item-color-l: 100%;
    --bulma-menu-item-background-l-delta: 100;
    --bulma-menu-list-link-padding: 0.25rem 1rem;
    --bulma-menu-nested-list-margin: 0 0 0 1rem;
    --bulma-menu-nested-list-padding-left: 0;
    --bulma-menu-label-font-size: 0.8em;
}
.button.is-success, .button.is-info, .button.is-danger {
    color: white;
    /*--bulma-button-h: 100%;*/
    /*--bulma-button-s: 100%;*/
    /*--bulma-button-color-l: 100%;*/
    &.is-static{
        color: inherit;
    }
}


/*we handle overflow on elements; use this to hide the main RHS scroll*/
html, body{
    overflow-y: hidden;
}

.column{
    display: flex;
    flex-direction: column;
    .block:last-child {
        flex-grow: 1;
    }
}

.box h3{
    font-weight: bold;
    margin-left:  calc(var(--bulma-box-padding)*-1);
    margin-right:  calc(var(--bulma-box-padding)*-1);
    margin-bottom:  var(--bulma-box-padding);
    padding: 0.5rem var(--bulma-box-padding);
    background-color: hsl(0, 0%, 86%) !important;
    display: flex;
    align-items: center;
    box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.05);
    >*:not(first-child){
        margin-left: 0.5rem;
    }
    &:first-child{
        margin-top:  calc(var(--bulma-box-padding)*-1);
        border-top-left-radius: var(--bulma-box-radius);
        border-top-right-radius: var(--bulma-box-radius);
    }
    &:not(first-child){
        margin-top:  var(--bulma-box-padding);
    }
}

/*main layout*/
.admin-main{
    display: flex;
    overflow-y: hidden;
    overflow-x: hidden;
    height: 100vh;
    >*{
        height: 100%;
    }
    .admin-main-menu{
        overflow-y: scroll;
        padding: 1rem 0;
        flex: none;

        .menu {
            li{
                width: 100%;
            }
            li span, p{
                width: 100%;
                display: flex;
                >:not(:first-child){
                    width: 2rem;
                }
            }
            a i{
                color: var(--bulma-text-light);
            }
            p a{
                padding: var(--bulma-menu-list-link-padding);
            }
            a:not(:first-child){
                padding-left: 0.25rem;
                padding-right: 0.25rem;
            }
        }

        .menu-label{
            padding-left: 0.5rem;
        }
        .menu-table .tabulator-moving-row-receiving{

        }
    }

    .admin-main-content{
        overflow-x: scroll;
        background-color: #fff;
        flex: 1;
        padding-right: 0;
        >{
            width: 100%
        }
    }
}

/*record list and form*/
.admin-record-wrapper{
    height: 100%;
    >*{
        height: 100%;
        display: flex;
        flex-direction: column;
        flex: 1;
    }
    .tabs:not(:last-child){
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .tabs.is-boxed li.is-active a{
        background-color: #f8f8f8;
    }
}

.admin-record-list{
    .buttons .dropdown{
        margin-right: 0.5rem;
    }
}

.admin-record-form{
    width: 100%;
    overflow-y: scroll;
    padding: 1em;
    background-color: #f8f8f8;
    flex-grow: 1;
}

.admin-buttons{
    padding: 1rem;
    padding-bottom: 0;
}

/*general opacity*/
.is-opacity-50{
    opacity: 0.5;
}

/*tabulator*/
.tabulator{
    background-color: #f8f8f8;
}
.tabulator, .tabulator-menu{
    font-size: var(--bulma-body-font-size);
    border-color: #ddd;
}
.tabulator-moving{
    opacity: 0.5;
}
.tabulator-col-group > .tabulator-col-content{
    display: flex;
    >*{
        flex: 1;
    }
    background-color: #f8f8f8;
    border-left: 1px solid #f8f8f8;
    border-top: 1px solid #f8f8f8;
}
.tabulator-row.tabulator-selected {
    background-color: #91acd4 !important;
    .tabulator-cell{
        color: white;
    }
}
.tabulator-row.tabulator-row-even:not(.tabulator-row.tabulator-selected):not(.tabulator-group){
    //background-color: #f4f4f4;
    background-color: inherit;
}
.tabulator-row .tabulator-cell{
    //border-right: 1px solid #ddd;
    border-right: none;
    border-bottom: 1px solid #eee;
}
.tabulator-row.norepeat-break .tabulator-cell{
    border-top: 1px solid #999;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button{
    padding: 0 4px;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{
    padding-right: 16px;
}
.tabulator .tabulator-header{
    font-size: 0.9em;
}

/*bodge here to get the filter summary positioned*/
.tabulator-filter-summary{
    position: absolute;
    left: 0.5em;
    top: 0.5em;
}
.tabulator-cell.colselect:after{
    content: '\f078';
    font-family: "Font Awesome 6 Pro";
    position: absolute;
    right: 0.5em;
}

.tabulator-cell.divider{
    border-left: 1px solid #999;
}

.record-list{
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

/*tabulator classes*/
.list-strike .tabulator-cell, .list-strike.tabulator-cell{
    text-decoration: line-through;
    text-decoration-thickness:  0.1em;
    text-decoration-color:  #aaa;
}

/*forms*/
.control label.checkbox:not(.in-dropdown){
    border: 1px solid var(--bulma-input-border-color);
    border-radius:var(--bulma-control-radius);
    height: 2.5em;
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: var(--bulma-control-padding-horizontal);
    padding-right: var(--bulma-control-padding-horizontal);
    input {
        margin-right: 0.25em;
    }
}
.field.has-addons .control:first-child:not(:only-child) label.checkbox{
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
}
.field.has-addons .control:last-child:not(:only-child) .textarea{
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
}
.field:not(:last-child){
    margin-bottom: 0.5em;
}
.input.static{
    border: none;
    box-shadow: none;
}
.input[readonly]{
    background-color: hsl(0, 0%, 86%) !important;
}
p.input.is-static{
    height: initial;
}

.field-checklist .field-body{
    display: inline-block;
}

label.checkbox{
    /*height: 2.5em;*/
    line-height: 1.5;
    padding-top: 0.375rem;
    padding-right: 0.375rem;
}

/*field-body has default 5 grow, we may want to adjust it*/
.field-body-8 .field-body{
    flex-grow: 8 !important;
}
.field-body-7 .field-body{
    flex-grow: 7 !important;
}
.field-body-6 .field-body{
    flex-grow: 6 !important;
}
.field-body-4 .field-body{
    flex-grow: 4 !important;
}
.field-body-3 .field-body{
    flex-grow: 3 !important;
}
.field-body-2 .field-body{
    flex-grow: 2 !important;
}
.field-body-1 .field-body{
    flex-grow: 1 !important;
}

/*this allows side-by-side selects without overflow*/
.field-body>*{
    flex: 1;
    select {
        width: 100%;
    }
}

.field.has-addons .control.is-expanded{
    display: flex;
}

/*headers*/
h4 {
    font-weight: bold;
    font-size: 1.25em;
}


.input[required], select[required]{
    background-color: var(--bulma-danger-light);
}

@keyframes border-pulse {
    50% {
        border-color: var(--bulma-danger);
    }
}
.input.requiredhint, select.requiredhint{
    border-width: 2px;
    animation: border-pulse 1s infinite;
}

.file-cta.dragover{
    //background-color: bulmaDarken($file-cta-background-color, 2.5%);
    border-style: dotted;
}

/*toasts*/
.toast{
    position: absolute;
    top: 1rem;
    right: 1rem;
    .toast-visible {
        opacity: 0.7;
    }
    .toast-hidden{
        opacity: 0;
        transition: all 5s linear;
    }
}



/*tinymce hack from github to scale buttons down - they are a bit big*/
.tox .tox-tbtn {
    transform: scale(0.85) !important; /* you can set the scale that you want */
    height: unset !important;
    width: unset !important;
}
.tox .tox-tbtn--bespoke .tox-tbtn__select-label {
    width: unset !important;
}
.tox .tox-toolbar, .tox .tox-toolbar__overflow, .tox .tox-toolbar__primary {
    /* change the background y-positionning to : bottom 0*/
    background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 bottom 0 #fff !important;
}

/*litepicker*/
.litepicker[data-plugins*="ranges"] > .container__main > .container__predefined-ranges button{
    margin: 0 !important;
    font-size: 1em !important;
    padding: 4px 10px !important;
}
.litepicker .container__months{
    width: auto;
}

.field{
    position: relative;
}
.select{
    max-width: 100%;
}
.select select.multiselect[multiple]{
    /*position: absolute;*/
    /*top: 0;*/
    /*left: 0;*/
    /*z-index: 100 !important;*/

    option:not(:first-child)::before{
        content: '\f0c8';
        font-family: "Font Awesome 5 Pro";
        padding-right: 1em;
    }

    option:not(:first-child)[data-selected]::before{
        content: '\f14a';
    }
}

@keyframes clipboard-fade {
    from {
        content: '\f46c';
        color: green;
    }
    to {
        content: '\f328';
        color: inherit;
    }
}
.copyable{
    padding: 0.25em;
    border: 1px solid transparent;
    border-radius: 0.25em;
    &::after{
        content: '\f328';
        font-family: "Font Awesome 5 Pro";
        padding-left: 0.5em;
        opacity: 0.25;
    }
    cursor: pointer;
    &:hover{
        border-color: lightgrey;
        &::after{
            color: green;
        }
    }

    &.copied::after{
        animation: clipboard-fade 5s ease-in-out 0s;
    }
}

.right {
    text-align: right;
}
td.right, th.right{
    text-align: right !important;
}

.renderjson                { background-color: black; }
.renderjson a              { text-decoration: none; }
.renderjson .disclosure    { color: crimson;
    font-size: 150%; }
.renderjson .syntax        { color: grey; }
.renderjson .string        { color: red; }
.renderjson .number        { color: cyan; }
.renderjson .boolean       { color: plum; }
.renderjson .key           { color: lightblue; }
.renderjson .keyword       { color: lightgoldenrodyellow; }
.renderjson .object.syntax { color: lightseagreen; }
.renderjson .array.syntax  { color: lightsalmon; }

.fc-list-event-title, .fc-event-title {
    i{
        margin: 0.2em;
        margin-right: 0.6em;
        padding: 0.2em;
        padding-right: 0.6em;
        border-right: 1px solid white;
    }
}

dl.suggestion-list{
    counter-reset: suggestion;
    >div{
        counter-increment: suggestion;
        position: relative;
        padding-left: 2em;
        &:before{
            content: counter(suggestion);
            position: absolute;
            top: 0;
            left: 0;
        }
    }
    >div:not(:last-child){
        margin-bottom: 1em;
        padding-bottom: 1em;
        border-bottom: 2px solid white;
    }
    dd, dt{
        display: flex;
        gap: 0.5em;
        align-items: flex-start;
        span{
            flex-grow: 1;
        }
    }
    dd{
        font-weight: bold;
    }
    dt{
        margin-top: 0.5em;
        >div{
            font-style: italic;
            &.collapsed{
                opacity: 0.5;
                display: -webkit-box;
                -webkit-line-clamp: 1;
                -webkit-box-orient: vertical;
                overflow: hidden;
            }
        }
    }
}