/**
 * All of the CSS for your admin-specific functionality should be
 * included in this file.
 */

#wpcontent {
    padding-left: 0;
}

/** General setup **/
table td {
    padding: 4px !important;
}

select,
input:not([type="checkbox"]) {
    height: 30px !important;
    font-size: 14px !important;
}

.wp-core-ui select {
    max-width: 100% !important;
}

textarea {
    border: solid 1px #8C8F94 !important;
    font-size: 14px !important;
}

.fs-xs {
    font-size: 13px;
}

/** Until here **/

/** Adjust modal considering the WP admin bar */
:root {
    --wp-admin-bar-height: 32px;
}

@media screen and (max-width: 782px) {
    :root {
        --wp-admin-bar-height: 46px;
    }
}

.modal-dialog.modal-top {
    margin-top: calc(var(--wp-admin-bar-height) + 10px);
    margin-bottom: 10px;
}

/** Until here **/

/** Others **/
.required-mark {
    color: red;
}

.inline-block>* {
    display: inline-block;
}

.blocked {
    pointer-events: none;
    opacity: 0.6;
}

.product-filter-container input,
.product-filter-container select {
    width: 100px;
}

.modal-backdrop {
    z-index: 9998 !important;
}

.modal {
    z-index: 9999 !important;
}

.modal-dialog.modal-top.modal-dialog-scrollable {
    height: calc(100dvh - var(--wp-admin-bar-height) - 20px);
}

.floating-loader {
    position: fixed;
    top: 50%;
    right: 50%;
    transform: translateY(-50%);
    z-index: 10000;
}

/** Until here **/



/** Floating buttons **/
.float-div {
    position: fixed;
    bottom: 30px;
    z-index: 9997 !important;
    font-size: 1.1rem;
}

.float-div-left {
    left: 170px;
    /* Default WP admin menu width */
    transition: left 0.3s ease;
}

body.folded .float-div-left {
    left: 45px;
    /* Collapsed menu width */
}

.float-div-right {
    right: 10px;
}

.float-btn {
    height: 50px !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/** Until here **/

.small-dashicons {
    font-size: 16px;
    margin-top: 4px;
}

/** Change the default tr hover color */
#mdspbe-main-table tbody tr {
    --bs-table-hover-bg: rgb(182, 199, 231) !important;
}

/** Until here **/

.cursor-pointer {
    cursor: pointer !important;
}

@keyframes button-flash {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(13, 110, 253, 0);
    }

    50% {
        transform: scale(1.07);
        filter: brightness(1.2);
        box-shadow: 0 0 14px rgba(0, 0, 0, 0.6);
    }
}

.btn-flash {
    animation: button-flash 3s ease-in-out infinite;
}


/** Image selectors **/
.no-image-container {
    width: 100px;
    height: 100px;
    border: 1px solid gray;
    background-color: #FAF0E6;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container {
    width: 100px;
    height: 100px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/** Until here **/


/** Do this to avoid color issues on the notices **/
.alert-success {
    background-color: #D3E7DD !important;
}

.alert-warning {
    background-color: #FEF2CC !important;
}

.alert-danger {
    background-color: #F6D7DA !important;
}

.alert-primary {
    background-color: #D1E2FF !important;
}

.alert-secondary {
    background-color: #E2E3E5 !important;
}

/** Until here **/

/** Sticky columns **/
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
}

.sticky-col:after {
    content: " ";
    height: 100%;
    position: absolute;
    top: 0;
    width: 10px;
    box-shadow: 10px 0 10px -10px rgba(0, 0, 0, 0.3) inset;
    right: -10px;
}

@media (min-width: 768px) {
    thead.sticky-top {
        box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 0.3);
    }

    /** Show on hover **/
    .hover-child {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
        top: 0;
        right: 0;
    }

    .hover-parent:hover .hover-child {
        opacity: 1;
        visibility: visible;
    }
}

/** Until here **/


/** Make table columns resizable **/
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: max-content;
    /* Key: allows natural width growth */
}

th,
td {
    border: 1px solid #ccc;
    padding: 8px;
    position: relative;
    min-width: 100px;
}

.resizer {
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    z-index: 10;
}

.resizing {
    cursor: col-resize;
    user-select: none;
}

/** Until here **/

@media (max-width: 991.98px) {
    .modal-backdrop {
        display: none !important;
        /** Hide this because somethimes it goes over the modal **/
    }

    .float-div-left {
        left: 10px;
    }
}