/* ========================================
   CUSTOM PUSHABLE SIDENAV STYLES
   ======================================== */

/* Wrapper container for sidenav and content */
.bn-custom-sidenav-wrapper {
    display: flex;
    position: relative;
    overflow-x: hidden;
    height: 100%;
    width: 100%;
}

/* Custom sidenav */
.bn-custom-sidenav {
    position: fixed;
    top: 64px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 64px);
    z-index: 71;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    will-change: left;
    background-color: white;
}

/* Content area that gets pushed */
.bn-custom-content-area {
    flex: 1;
    width: 100%;
    margin-left: 0;
    transition: margin-left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-width: 0;
    will-change: margin-left;
    height: 100%;
}

/* Desktop normal pages - sidenav always visible and locked open */
@media (min-width: 960px) {
    .bn-custom-sidenav.bn-sidenav-desktop-locked {
        left: 0 !important;
    }

    .bn-custom-sidenav.bn-sidenav-desktop-locked~.bn-custom-content-area {
        margin-left: 280px !important;
    }
}

/* When sidenav is open - for mobile and meeting pages */
.bn-custom-sidenav-wrapper.bn-custom-sidenav-open .bn-custom-sidenav {
    left: 0;
}

/* Mobile/meeting pages - overlay mode (no push) */
@media (max-width: 959px) {
    .bn-custom-sidenav-wrapper.bn-custom-sidenav-open .bn-custom-content-area {
        margin-left: 0 !important;
    }

    .bn-custom-sidenav {
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    }
}

/* Desktop meeting/planning pages - overlay mode */
@media (min-width: 960px) {
    .bn-custom-sidenav-wrapper.bn-in-meeting-mode.bn-custom-sidenav-open .bn-custom-content-area {
        margin-left: 0 !important;
    }

    .bn-custom-sidenav-wrapper.bn-in-meeting-mode .bn-custom-sidenav {
        /* box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3); */
    }
}

/* Push mode for desktop normal pages when toggled */
@media (min-width: 960px) {
    .bn-custom-sidenav-wrapper:not(.bn-in-meeting-mode).bn-custom-sidenav-open .bn-custom-content-area {
        margin-left: 280px;
    }
}

/* Toggle button styling */
.bn-sidenav-toggle-btn {
    background-color: white !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.bn-sidenav-toggle-btn:hover {
    background-color: #f5f5f5 !important;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 599px) {
    .bn-custom-sidenav {
        width: 260px;
        left: -260px;
    }

    .bn-custom-sidenav-wrapper.bn-custom-sidenav-open .bn-custom-sidenav {
        left: 0;
    }

    .bn-custom-sidenav-wrapper.bn-custom-sidenav-open .bn-custom-content-area {
        margin-left: 260px;
    }
}

/* Ensure smooth scrolling */
.bn-custom-sidenav::-webkit-scrollbar {
    width: 6px;
}

.bn-custom-sidenav::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.bn-custom-sidenav::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.bn-custom-sidenav::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Backdrop for overlay mode */
.bn-custom-sidenav-backdrop {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 59;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

/* Show backdrop only in overlay mode when sidenav is open */
.bn-custom-sidenav-wrapper.bn-custom-sidenav-open.bn-in-meeting-mode .bn-custom-sidenav-backdrop {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 959px) {
    .bn-custom-sidenav-wrapper.bn-custom-sidenav-open .bn-custom-sidenav-backdrop {
        opacity: 1;
        visibility: visible;
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 599px) {
    .bn-custom-sidenav {
        width: 260px;
        left: -260px;
    }

    .bn-custom-sidenav-wrapper.bn-custom-sidenav-open .bn-custom-sidenav {
        left: 0;
    }
}

/* Ensure smooth scrolling */
.bn-custom-sidenav::-webkit-scrollbar {
    width: 6px;
}

.bn-custom-sidenav::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.bn-custom-sidenav::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.bn-custom-sidenav::-webkit-scrollbar-thumb:hover {
    background: #555;
}