:root {
    --primary-color: #5600ff !important;
    --primary-color-hover: #4b06d1;
    --dark-primary-color: #4d40ff;
    --dark-primary-color-hover: rgb(77 64 255 / 21%);
    --grid-border-color: #e4e4e4;
    --gray-color-1: #a8a8a8;
    --gray-color-2: #e1e3e8;
    --gray-color-3: #c9c9c9;
    --dark-border-color-1: rgb(255 255 255 / 10%);
    --dark-border-color-2: rgb(255 255 255 / 25%);
    --light-theme-background-color: #fff;
    --light-theme-background-color-2: #f7f8fa;
    --light-theme-background-color-3: #edf0f6;
    --dark-theme-background-color: #242529;
    --dark-theme-background-color-2: #1a1c21;
    --dark-theme-background-color-3: #222327;
    --header-table-background-color: #fafbfc;
    --animation-duration: .2s;
}

body {
    overflow-x: hidden;
    overflow-y: hidden;
}

a.btn,
button {
    align-items: center;
    gap: 0.2rem;

    &.with-borders {
        border-color: var(--primary-color) !important;
        height: max-content;
    }

    &.onhover-primary:hover {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        color: #fff;
    }
}

input,
select {
    &.width-100 {
        width: 100px;
    }

    &.width-150 {
        width: 150px;
    }

    &.width-200 {
        width: 200px;
    }
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

a {
    &.onhover-primary:hover {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        color: #fff;
    }
}

.background-primary {
    background-color: var(--primary-color) !important;
    color: #fff !important;

    &::placeholder {
        color: #fff !important;
    }

    &.with-borders {
        border-color: var(--primary-color) !important;
    }

    &.white-borders {
        border-color: #fff !important;
    }
}

.background-dark {
    background-color: var(--dark-theme-background-color-3) !important;
    color: #fff !important;

    &.with-borders {
        border-color: var(--dark-theme-background-color-3) !important;
    }
}

.over-hidden {
    overflow: hidden;
}

.form-control {
    &::placeholder {
        font-family: 'Roboto' !important;
    }

    &.w-100 {
        width: 100px !important;
    }

    &.w-200 {
        width: 200px !important;
    }
}

span.material-symbols-rounded {
    font-family: "Material Symbols Rounded" !important;
    font-variation-settings: 'FILL'0,
        'wght'400,
        'GRAD'0,
        'opsz'48 !important;
}

span.material-symbols-outlined {
    font-family: "Material Symbols Outlined" !important;
    font-variation-settings: 'FILL'0,
        'wght'400,
        'GRAD'0,
        'opsz'48 !important;
}

.font-h3 {
    font-family: 'Inter';
    font-size: 18px;
    font-weight: 500;
}

button {
    &.button-icon.min {
        border: 1px solid var(--gray-color-3);
        border-radius: 0.5rem;
        align-items: center;
        justify-content: center;
        display: flex;
        padding: 0 !important;
        height: 24px;
        width: 24px;

        & span.material-symbols-rounded {
            font-variation-settings: 'FILL'0,
                'wght'300,
                'GRAD'0,
                'opsz'48;
            font-size: 24px;
        }
    }
}

nav {
    & ol.breadcrumb {
        margin: 0;

        & li,
        & li a {
            font-family: 'Inter',
            font-size: 18px;
            font-weight: 500;
            color: #000 !important;
        }
    }
}

.form-check-inline-permission {
    display: inline-block;
    margin-right: auto;
}

.reading {
    color: #ff860e;
    width: 1em;
    height: 1em;
}

.reading:focus {
    border-color: none;
    outline: none;
    box-shadow: none;
}

.reading:checked {
    background-color: #ff860e;
    border-color: #ff860e;
}


.writing {
    color: #98be33;
    width: 1em;
    height: 1em;
}

.writing:focus {
    border-color: none;
    outline: none;
    box-shadow: none;
}

.writing:checked {
    background-color: #98be33;
    border-color: #98be33;
}


.mainSelect {
    color: #2C3E50;
    width: 1em;
    height: 1.3em;
}

.mainSelect:focus {
    border-color: none;
    outline: none;
    box-shadow: none;
}

.mainSelect:checked {
    background-color: #2C3E50;
    border-color: #2C3E50;
}

.form-switch .reading-permission:focus {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
}

.form-switch .reading-permission:checked {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-switch .writing-permission:focus {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
}

.form-switch .writing-permission:checked {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-permission {
    background-color: #f8f9fa;
    cursor: default;
}

.form-permission:focus {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    box-shadow: none;
}

.readonlybgalvan[readonly] {
    background-color: var(--bs-form-control-disabled-bg);
    opacity: 1;
    cursor: default;
}

.readonlybgalvan[readonly]:focus {
    background-color: var(--bs-form-control-disabled-bg);
    border-color: #dee2e6;
    box-shadow: none;
}

.wtree li {
    list-style-type: none;
    margin: 10px 0 10px 10px;
    position: relative;
}

.wtree li:before {
    content: "";
    position: absolute;
    left: -20px;
    border-left: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    width: 20px;
    height: 15px;
    z-index: 0;
}

.wtree ul li:before {
    height: calc(50px);
    top: -30px;
}

.wtree li:after {
    position: absolute;
    content: "";
    top: 23px;
    left: -20px;
    border-left: 1px solid #ddd;
    border-top: 1px solid #ddd;
    width: 20px;
    height: calc(100% - 23px);
}

.wtree li:last-child:after {
    display: none;
}

a:link,
a:visited,
a:active {
    text-decoration: none;
}


.wtree {
    margin: 0;

    & li {
        &:before {
            border-radius: 0 0 0 0.5rem;
            border-left: 1px solid var(--gray-color-3);
            border-bottom: 1px solid var(--gray-color-3);
            height: calc(20px);
        }

        & .list-group {
            z-index: 1;

            & small {
                font-family: 'Roboto';

                & span.material-symbols-rounded {
                    font-variation-settings: 'FILL'0,
                        'wght'250,
                        'GRAD'0,
                        'opsz'48;
                    padding: 0 !important;
                    border: 0;
                }

                & a.btn {
                    border: 1px solid var(--gray-color-3);
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    padding: 0;
                    border-radius: 0.5rem;
                    height: 28px;
                    width: 28px;
                }
            }

            ;
            position: relative;
        }
    }

    &>li:first-child,
    &>li:last-child>ul:last-child>li:last-child {
        margin: 10px 0 0 10px;
    }
}

.wtree ul:has(>li:nth-child(2))>li:nth-child(1):before {
    border-radius: 0 !important;
}

form {

    & input.form-control,
    & select.form-select,
    & textarea.form-control {
        &:focus {
            outline: none;
        }
    }
}

.loading-backdrop {
    background-color: rgb(255 255 255 / 59%);
    justify-content: center;
    align-items: center;
    display: flex;
    position: fixed;
    height: 100%;
    width: 100%;
    z-index: 1051;
    left: 0;
    top: 0;

    #loading {
        height: 200px;
        width: 200px;
    }
}

.notification-item {
    transition-duration: .2s;
    background-color: #ececec;
    border-radius: 0.5rem;
    padding: 1rem;
    position: fixed;
    display: flex;
    max-width: 300px;
    min-width: 250px;
    overflow: hidden;
    right: 2rem;
    bottom: 2rem;
    z-index: 1070;
    gap: 0.5rem;
    box-shadow: 0 2px 5px -3px #000;
    animation: moveUp .2s linear, fadeIn .2s linear;

    &.hide {
        animation: fadeUp .3s linear, fadeOut .3s linear;
    }

    & div.bar-timeout-current {
        transition-duration: .2s;
        position: absolute;
        border-radius: 0.5rem;
        bottom: 0;
        left: 0;
        height: 0.5rem;
    }

    &.success {
        background-color: #d4f9e7;
        color: #00a750;

        & div.bar-timeout-current {
            background-color: #00a750;
        }

        & .close span {
            color: #00a750;
        }
    }

    &.error {
        background-color: #ffe5e5;
        color: #dc6069;

        & div.bar-timeout-current {
            background-color: #dc6069;
        }

        & .close span {
            color: #dc6069;
        }
    }

    &.notification {
        background-color: #cbd0ff;
        max-width: 350px;
        min-width: 300px;
        color: #5c49f7;

        & div.bar-timeout-current {
            background-color: #5c49f7;
        }

        & .close span {
            color: #5c49f7;
        }
    }

    & span.status {
        font-size: 28px;
        font-variation-settings: 'FILL'1,
            'wght'400,
            'GRAD'0,
            'opsz'48;
    }

    & div.text {
        line-height: 20px;
        width: calc(100% - (50px + 1rem));
        margin: 0 auto 0 0;
    }

    & span.title {
        font-family: 'Poppins' !important;
        font-size: 16px !important;
        font-weight: 600;
    }

    & span.message {
        font-family: 'Roboto' !important;
        width: 100%;
        font-weight: 500;
        font-size: 13.5px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        height: -webkit-fill-available;
        overflow: hidden;

        & ul {
            padding-inline-start: 1rem;
            list-style: disc;
            margin: 0;
        }
    }

    & button.close {
        background-color: transparent;
        transition-duration: .2s;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: none;
        border-radius: 1rem;
        height: 22px;
        width: 22px;
        padding: 0;
        border: 0;

        & span {
            font-size: 20px;
        }
    }

    &.success {
        button.close:hover {
            transition-duration: .2s;
            background-color: #00a75054;
        }
    }

    &.error {
        button.close:hover {
            transition-duration: .2s;
            background-color: rgb(220 96 105 / 30%);
        }
    }
}

.notification-backdrop {
    background-color: rgb(0 0 0 / 50%);
    justify-content: center;
    align-items: center;
    z-index: 1020;
    display: flex;
    position: fixed;
    height: 100%;
    width: 100%;
    top: 0;

    &.show {
        animation: fadeIn .2s linear;

        .notification-modal {
            animation: moveUp .2s linear;
        }
    }

    &.hide {
        animation: fadeOut .3s linear;

        .notification-modal {
            animation: moveDown .3s linear;
        }
    }

    .notification-modal {
        background-color: #ffffff;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-radius: 0.5rem;
        display: flex;
        padding: 1.5rem;
        height: 300px;
        width: 500px;
        gap: 1rem;

        &.waiting {
            height: 160px;
            width: 300px;

            & .icon {
                animation: ease rotate 1s running infinite;
                background-color: rgb(195 224 255 / 32%);
            }

            & span {
                &.status {
                    color: #0796ff;
                }
            }
        }

        &.warning {
            & .icon {
                background-color: rgb(255 193 7 / 20%);
            }

            & span {
                &.status {
                    color: #ffc107;
                }
            }
        }

        &.success {
            & .icon {
                background-color: #8fe0c3;
            }

            & span {
                &.status {
                    color: #000;
                }
            }
        }

        & .icon {
            border-radius: 50%;
            align-items: center;
            justify-content: center;
            display: flex;
            height: 60px;
            width: 60px;
        }

        & span {
            &.status {
                font-size: 36px !important;
                font-variation-settings:
                    'FILL'0,
                    'wght'200,
                    'GRAD'0,
                    'opsz'24
            }

            &.title {
                font-family: 'Poppins' !important;
                font-weight: 500;
                font-size: 18px;
            }

            &.text {
                font-family: 'Roboto' !important;
                text-align: center;
                font-weight: 400;
                font-size: 14px;
            }
        }
    }
}

.side-modal__backdrop {
    opacity: 1;

    .side-modal__body {
        transform: translateX(-100%);
        overflow-y: auto;
    }

    & button[close-modal] {
        border: 1px solid var(--gray-color-3);
        height: 40px;
        width: 40px;
    }

    &.show {
        animation: fadeIn .2s linear;
        display: flex;

        .side-modal__body {
            animation: moveLeft .2s linear;
            transform: translateX(0%);
        }
    }

    &.hide {
        animation: fadeOut .2s linear;
        opacity: 0;

        .side-modal__body {
            animation: restoreMoveLeft .2s running linear;
            transform: translateX(100%);
        }
    }
}

.custom-tooltip {
    --bs-tooltip-bg: #000;
    --bs-tooltip-padding-y: 0.35rem;
    --bs-tooltip-padding-x: 0.6rem;
    --bs-tooltip-border-radius: 0.7rem;

    & .tooltip-arrow {
        border-color: #000;
    }

    & .tooltip-inner {
        box-shadow: 0 10px 8px -7px rgb(0 0 0 / 40%);
        padding-bottom: 0.5rem;
    }
}

[data-bs-theme=dark] body {
    .loading-backdrop {
        background-color: rgb(0 0 0 / 59%);
    }

    .side-modal__backdrop {
        & button[close-modal] {
            border: 1px solid var(--dark-border-color-2);
        }
    }

    .notification-backdrop {
        .notification-modal {
            background-color: var(--dark-theme-background-color);

            & span {

                &.title,
                &.text {
                    color: #fff !important;
                }
            }
        }
    }

    .custom-tooltip {
        --bs-tooltip-bg: #fff;

        & .tooltip-arrow {
            border-color: #fff;
        }
    }
}

:not([data-bs-theme=dark]) body {
    input {
        &:autofill {
            box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000), inset 0 0 0 100vh #fff !important;
        }
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes fadeUp {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-10rem);
    }
}

@keyframes moveUp {
    0% {
        transform: translateY(5rem);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes moveDown {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(10rem);
    }
}

@keyframes moveLeft {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes restoreMoveLeft {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(100%);
    }
}

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

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