/*
* Customised Theme for use with jsGrid
* Dependent on the presence of the primary stylesheet and Bootstrap 5
* 
* (c) 2023
* Project Page: https://github.com/sameerdhoot/wolweb
*/

.jsgrid {
    overflow: visible;
}

.jsgrid-edit-row > .jsgrid-cell,
.jsgrid-filter-row > .jsgrid-cell,
.jsgrid-grid-body,
.jsgrid-grid-header,
.jsgrid-header-row > .jsgrid-header-cell,
.jsgrid-insert-row > .jsgrid-cell {
    border-color: var(--bs-border-color) !important;
}

.jsgrid-header-row > .jsgrid-header-cell {
    border-top: 0;
    border-bottom: 1px solid;
}

.jsgrid-header-row > .jsgrid-header-cell,
.jsgrid-grid-header {
    background-color: rgb(var(--bs-emphasis-color-rgb), 5%) !important;
}

.jsgrid-filter-row > .jsgrid-cell:first-child,
.jsgrid-header-row > .jsgrid-header-cell:first-child,
.jsgrid-insert-row > .jsgrid-cell:first-child {
    border-left: none
}

.jsgrid-filter-row > .jsgrid-cell:last-child,
.jsgrid-header-row > .jsgrid-header-cell:last-child,
.jsgrid-insert-row > .jsgrid-cell:last-child {
    border-right: none
}

.jsgrid-header-row .jsgrid-align-left,
.jsgrid-header-row .jsgrid-align-right {
    text-align: center
}

.jsgrid-header-scrollbar {
    scrollbar-arrow-color: #f1f1f1;
    scrollbar-base-color: #f1f1f1;
    scrollbar-3dlight-color: #f1f1f1;
    scrollbar-highlight-color: #f1f1f1;
    scrollbar-track-color: #f1f1f1;
    scrollbar-shadow-color: #f1f1f1;
    scrollbar-darkshadow-color: #f1f1f1
}

.jsgrid-header-scrollbar::-webkit-scrollbar {
    visibility: hidden
}

.jsgrid-header-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1
}

.jsgrid-header-sortable:hover {
    cursor: pointer;
    background: #fcfcfc
}

.jsgrid-header-row .jsgrid-header-sort {
    background: #c4e2ff
}

.jsgrid-header-sort:before {
    content: " ";
    display: block;
    float: left;
    width: 0;
    height: 0;
    border-style: solid
}

.jsgrid-header-sort-asc:before {
    border-width: 0 5px 5px;
    border-color: transparent transparent #009a67
}

.jsgrid-header-sort-desc:before {
    border-width: 5px 5px 0;
    border-color: #009a67 transparent transparent
}

.jsgrid-grid-body {
    border-top: none
}

.jsgrid-cell {
    border-color: var(--bs-border-color) !important;
    border-bottom: 1px solid;
}

.jsgrid-grid-body .jsgrid-alt-row:first-child .jsgrid-cell,
.jsgrid-grid-body .jsgrid-row:first-child .jsgrid-cell {
    border-top: none;
}

.jsgrid-grid-body .jsgrid-cell:first-child {
    border-left: none;
}

.jsgrid-grid-body .jsgrid-cell:last-child {
    border-right: none;
}

.jsgrid-row > .jsgrid-cell {
    background-color: rgb(var(--bs-emphasis-color-rgb), 0%);
}

.jsgrid-alt-row > .jsgrid-cell {
    background-color: rgb(var(--bs-emphasis-color-rgb), 2.5%);
}

.jsgrid-filter-row > .jsgrid-cell {
    background-color: rgb(var(--bs-emphasis-color-rgb), 3%);
}

.jsgrid-insert-row > .jsgrid-cell {
    background-color: rgb(25, 135 ,84 , 20%);
}

.jsgrid-edit-row > .jsgrid-cell {
    background-color: rgb(217, 177, 55, 20%);
}

.jsgrid-edit-row input,
.jsgrid-insert-row input,
.jsgrid-filter-row input {
    background-color: rgb(var(--bs-body-bg-rgb), 30%);
    border-radius: 8px;
    border-style: solid;
    border-color: rgba(var(--bs-dark-rgb) ,var(--bs-bg-opacity)) !important;
    border-width: 1px;
    height: 31px;
}

.jsgrid-control-field button {
    max-height: 31px;
}

.jsgrid-control-field .btn-group button {
    width: 31px;
}

.jsgrid-selected-row > .jsgrid-cell {
    background-color: rgb(var(--bs-primary-rgb), 15%)
}

.jsgrid-nodata-row > .jsgrid-cell {
    background-color: rgb(var(--bs-emphasis-color-rgb), 0%);
    height: 48px;
}

.jsgrid-invalid input,
.jsgrid-invalid select,
.jsgrid-invalid textarea {
    background: #ffe3e5;
    border: 1px solid #ff808a
}

.jsgrid-pager-container {
    margin-top: 10px;
}

.jsgrid-pager-current-page {
    font-weight: 700
}

.jsgrid-pager-nav-inactive-button {
    display: flex;
}

.jsgrid-pager-nav-button,
.jsgrid-pager-page {
    padding: 0;
}

.jsgrid-button + .jsgrid-button {
    margin-left: 5px
}

.jsgrid-button {
    min-width: unset !important;
    :hover {
        opacity: 50%;
        transition: opacity 200ms linear
    }
}

.jsgrid .jsgrid-button {
    width: 16px;
    height: 16px;
    border: none;
    cursor: pointer;
    background-repeat: no-repeat;
    background-color: transparent
}

@media only screen and (-webkit-min-device-pixel-ratio:2),
only screen and (min-device-pixel-ratio:2) {
    .jsgrid .jsgrid-button {
        background-size: 24px 352px
    }
}

.jsgrid .jsgrid-mode-button {
    width: 24px;
    height: 24px
}

.jsgrid-mode-on-button {
    opacity: .5
}

.jsgrid-load-shader {
    background: #ddd;
    opacity: .5;
    filter: alpha(opacity=50)
}

.jsgrid-load-panel {
    width: 15em;
    height: 5em;
    background: #fff;
    border: 1px solid #e9e9e9;
    padding-top: 3em;
    text-align: center
}

.jsgrid-load-panel:before {
    content: ' ';
    position: absolute;
    top: .5em;
    left: 50%;
    margin-left: -1em;
    width: 2em;
    height: 2em;
    border: 2px solid #009a67;
    border-right-color: transparent;
    border-radius: 50%;
    -webkit-animation: indicator 1s linear infinite;
    animation: indicator 1s linear infinite
}

@-webkit-keyframes indicator {
    from { -webkit-transform: rotate(0deg) }
    50% { -webkit-transform: rotate(180deg) }
    to { -webkit-transform: rotate(360deg) }
}

@keyframes indicator {
    from { transform: rotate(0deg) }
    50% { transform: rotate(180deg) }
    to { transform: rotate(360deg) }
}


/* Custom Pager Tweaks*/
.pagination,
.jsgrid-pager,
.jsgrid-pager-container nav {
    display: flex;
    align-items: center;
    flex-direction: row;
    margin: 0;
}

.pagination:not(first-child) { margin-left: 8px; }
.pagination:not(last-child) { margin-right: 8px; }

/* Unify button radii within jsgrid */
.jsgrid-cell button { border-radius: var(--bs-border-radius); }