@use "../variable" as *;
@use "../mixin" as *;

.rbfb-top-level-wrapper {
    .rbfb-sidebar {
        position: relative;
        background-color: $white;
        height: 100%;
        padding: var(--rbfb-space-5);
        z-index: 999;
        height: calc(100vh - 32px);

        &--border {
            border: 1px solid $primary-light;
        }

        &--toggle {
            position: absolute;
            top: 85px;
            right: -20px;
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        &:hover .rbfb-sidebar--toggle {
            opacity: 1;
        }
    }

    .rbfb-sidebar__resizer {
        position: absolute;
        top: 0;
        right: 0;
        width: 6px;
        height: 100%;
        cursor: col-resize;
        z-index: 1000;
        background-color: transparent;

        &:hover {
            background-color: rgba(0, 0, 0, 0.08);
        }
    }

    .rbfb-sidebar__header {
        position: relative;
        height: 60px !important;

        .rbfb-logo,
        .rbfb-logo-icon {
            position: absolute;
            top: 0px;
            left: 0;
        }
    }

    .rbfb-sidebar__menu {
        &-item {
            cursor: pointer;
        }
    }

    .rbfb-sidebar__menu-item--widget {
        width: 70%;
        margin: 0 auto;
        @include transition;
    }

    .rbfb-sidebar__menu-item--connector {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        width: 30px;
        height: 40px;
        margin: 0 auto;
        background: $secondary;
        overflow: hidden;
        z-index: 0;
        transition: all 0.9s ease;

        &::after,
        &::before {
            content: "";
            position: absolute;
            width: 20px;
            height: 120%;
            background: $white;
            border-radius: 50%;
            z-index: 1;
        }

        &::after {
            left: 18px;
        }

        &::before {
            right: 18px;
        }

        span {
            position: absolute;
            width: 100%;
            height: 0;
            top: 0;
            background: $primary;
            opacity: 0;
            transition: all 0.3s ease;
        }

        &--active {
            span {
                height: 100%;
                opacity: 1;
            }
        }
    }

    .rbfb-sidebar__menu > :last-child .rbfb-sidebar__menu-item--connector {
        display: none;
    }

    .rbfb-sidebar__bottom {
        width: 100%;
        position: absolute;
        bottom: 19px;
        left: 0;
        padding: 0 var(--rbfb-space-5);
        z-index: 999;
        backdrop-filter: blur(3px);
        border-radius: 12px;
    }

    .rbfb-sidebar__bottom-collapsed {
        position: absolute;
        left: 50%;
        bottom: 20px;
        transform: translateX(-50%);
        opacity: 0;
    }

    .rbfb-sidebar__bottom-collapsed-active {
        opacity: 1;
        transition: opacity 0.3s ease 0.3s;
    }

    .rbfb-sidebar__fade {
        opacity: 0;
        visibility: hidden;
        transition:
            opacity 0.25s ease,
            visibility 0.25s ease;
    }

    .rbfb-sidebar:not(.rbfb-sidebar--collapsed) .rbfb-sidebar__fade {
        opacity: 1;
        visibility: visible;
        transition:
            opacity 0.25s ease 0.3s,
            visibility 0s linear 0.3s;
    }

    .rbfb-sidebar--collapsed {
        .rbfb-sidebar--toggle {
            span {
                transform: rotateY(180deg);
            }
        }

        .rbfb-sidebar__menu-item--widget {
            width: 100%;
        }

        .rbfb-sidebar__menu-item--connector {
            height: 15px;
        }

        .rbfb-sidebar__bottom {
            opacity: 0;
            visibility: hidden;
            transition: none;
        }
    }
}
