/* Mobile Sidebar Menu - Clean WordPress-style Design */

/* Ultra-smooth offcanvas transitions */
.offcanvas {
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: transform;
}

.offcanvas.offcanvas-top {
    transform: translateY(-100%) !important;
}

.offcanvas.offcanvas-top.show {
    transform: translateY(0) !important;
}

/* Closing animation - smooth slide up */
.offcanvas.offcanvas-top.hiding {
    transform: translateY(-100%) !important;
    transition: transform 0.6s cubic-bezier(0.7, 0, 0.84, 0) !important;
}

/* Ultra-smooth backdrop transition */
.offcanvas-backdrop {
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: opacity;
}

.offcanvas-backdrop.show {
    opacity: 0.6 !important;
}

.offcanvas-backdrop.fade {
    transition: opacity 0.5s cubic-bezier(0.7, 0, 0.84, 0) !important;
}

/* Mobile Navigation Collapse/Expand for Offcanvas */
.mobile-nav-heading-container,
.mobile-submenu-heading-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    transition: all 0.2s ease;
    border-radius: 4px;
}
.mobile-submenu-heading-container{
    padding: 20px 0px 0px 0px;
}
.mobile-nav-heading-container a,
.mobile-submenu-heading-container a {
    flex: 1;
    pointer-events: auto;
    cursor: pointer;
}
.mobile-nav-heading-container a, .mobile-nav-heading a, .mobile-nav-heading-container h6, .mobile-nav-heading-container{
font-family: 'Josefin Sans', serif;
    font-weight: 600;
    font-style: normal;
    color: #171A21;
    font-size: 18px;
}
 .mobile-submenu-heading-container a,  .mobile-submenu-heading a, .mobile-submenu-heading-container h6, .mobile-submenu-heading-container {
    color: #2e2e2e;
    font-size: 16px;
    font-family: 'Josefin Sans', serif;
    font-weight: 600;
    font-style: normal;
}
.mobile-submenu-items .list-unstyled {
    margin-bottom: 0px;
}
/* Arrow animation - ultra smooth rotation */
.collapse-arrow {
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
height: 20px;
width: 20px;
    border-radius: 50% !important;
    margin-left: 8px !important;
    pointer-events: auto !important;
   display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    user-select: none !important;
    will-change: transform;
}

.collapse-arrow.expanded {
    transform: rotate(180deg) !important;
}

/* Collapsible sections - ultra smooth slide down from top */
.mobile-nav-submenu,
.mobile-submenu-items {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-15px);
    transition: max-height 1.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: max-height, opacity, transform;
}

.mobile-nav-submenu.expanded,
.mobile-submenu-items.expanded {
    max-height: 1500px;
    opacity: 1;
    transform: translateY(0);
    transition: max-height 1.8s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile Navigation Styles for Offcanvas */
.offcanvas-body {
    padding: 1rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.3s;
    will-change: opacity, transform;
}

/* Submenu section containers - smooth animation */
.mobile-submenu-section {
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Ensure all submenu containers have the same smooth slide-down */
.mobile-nav-submenu .mobile-submenu-section,
.mobile-submenu-items ul {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.offcanvas.show .offcanvas-body {
    opacity: 1;
    transform: translateY(0);
}

.offcanvas.hiding .offcanvas-body {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s cubic-bezier(0.7, 0, 0.84, 0), 
                transform 0.4s cubic-bezier(0.7, 0, 0.84, 0);
    transition-delay: 0.1s;
}
.mobile-nav-heading-container .collapse-arrow.expanded {
    transform: none !important;
}
.navbar-toggler {
    display: none;
    border: none;
    padding: 0.5rem;
}
.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: none;
    width: 20px;
    height: 20px;
    position: relative;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after,
.navbar-toggler-icon {
    background-color: var(--secondary);
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    left: 0;
    transition: all 0.3s ease;
}

.navbar-toggler-icon::before {
    top: -6px;
}

.navbar-toggler-icon::after {
    top: 6px;
}

.navbar-toggler-icon {
    background-color: var(--secondary);
    height: 2px;
}
@media (min-width: 991px) {
    .offcanvas {
        display: none !important;
    }
}
/* Make offcanvas full width on mobile */
@media (max-width: 991px) {
    .navbar-toggler {
        display: block;
    }
    .offcanvas {
        width: 100% !important;
        max-width: 100% !important;
    }
}

.mobile-nav-section {
    border-bottom: 1px solid #f1f1f1;
    padding: 18px 0;
}

.mobile-nav-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mobile-submenu-items .list-unstyled,
.mobile-nav-submenu .list-unstyled{
margin-bottom: 0px;
    margin-top: 20px;
}

h6.mobile-nav-heading {
    margin-bottom: 0;
}

.mobile-nav-link {
    color: #3F4254;
    text-decoration: none;
    font-size: 14px;
    font-family: 'Josefin Sans', serif;
    font-weight: 400;
    font-style: normal;
    display: block;
    padding-bottom: 15px;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    color: #ff4500;
    text-decoration: none;
    padding-left: 8px;
}

/* Active state for mobile navigation links */
.mobile-nav-link.active {
    color: #ff4500;
    padding-left: 8px;
    font-weight: 600;
    position: relative;
}

.mobile-nav-link.active::before {
    content: '';
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 12px;
    background-color: #ff4500;
    border-radius: 2px;
}

/* Active state for mobile navigation headings */
.mobile-nav-heading a.active,
.mobile-nav-heading.active a,
.mobile-nav-heading.active {
    color: #ff4500 !important;
    font-weight: 600;
}

/* Active state for mobile submenu headings */
.mobile-submenu-heading-container h6 a.active,
.mobile-submenu-heading-container.active h6 a,
.mobile-submenu-heading-container h6.active,
.mobile-submenu-heading-container.active h6 {
    color: #ff4500;
    font-weight: 600;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 320px;
    max-width: 85vw;
    background: #ffffff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    min-height: 80px;
}

.sidebar-logo img {
    height: 35px;
    width: auto;
}

.sidebar-close {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Sidebar Content */
.sidebar-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Main Menu Items */
.sidebar-menu-item {
    position: relative;
    border-bottom: 1px solid #f5f5f5;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #fff;
}

.sidebar-menu-link:hover {
    background: #f8f9fa;
    color: #1e40af;
    text-decoration: none;
}

.sidebar-menu-item.active > .sidebar-menu-link {
    background: #eff6ff;
    color: #1e40af;
    border-left: 4px solid #1e40af;
}

.sidebar-menu-item.has-children .sidebar-menu-link i {
    font-size: 14px;
    color: #999;
    transition: all 0.2s ease;
    pointer-events: none; /* Prevent arrow from intercepting clicks */
}

.sidebar-menu-item.has-children .sidebar-menu-link:hover i {
    color: #1e40af;
    transform: translateX(2px);
}

/* Submenu Styles */
.sidebar-submenu,
.sidebar-child-menu {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100vh;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-submenu.active,
.sidebar-child-menu.active {
    transform: translateX(0);
}

/* Submenu Header */
.submenu-header,
.child-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    min-height: 80px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.submenu-back,
.child-back {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.submenu-back:hover,
.child-back:hover {
    color: #1e40af;
}

.submenu-back i,
.child-back i {
    margin-right: 10px;
    font-size: 14px;
}

/* Submenu Items */
.submenu-items,
.child-items {
    flex: 1;
    padding: 10px 0;
}

.submenu-item {
    position: relative;
    border-bottom: 1px solid #f8f8f8;
}

.submenu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: #555;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.2s ease;
    background: #fff;
}

.submenu-link:hover {
    background: #f8f9fa;
    color: #1e40af;
    text-decoration: none;
    padding-left: 25px;
}

.submenu-item.has-children .submenu-link i {
    font-size: 12px;
    color: #999;
    transition: all 0.2s ease;
    pointer-events: none; /* Prevent arrow from intercepting clicks */
}

.submenu-item.has-children .submenu-link:hover i {
    color: #1e40af;
    transform: translateX(2px);
}

/* Child Menu Links */
.child-link {
    display: block;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8f8f8;
    background: #fff;
}

.child-link:hover {
    background: #f8f9fa;
    color: #1e40af;
    text-decoration: none;
    padding-left: 25px;
    border-left: 3px solid #1e40af;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.sidebar-cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

/* Mobile Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: #f5f5f5;
    color: #1e40af;
}

/* Responsive Styles */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide desktop navigation */
    .navbar-collapse {
        display: none !important;
    }

    /* Adjust navbar for mobile */
    .navbar {
        padding-top: 0px !important;
        padding-bottom: 0px !important;
    }

    .container-fluid {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .offcanvas-header {
    display: flex
;
    align-items: center;
    padding-right: 1.5rem !important;
    padding-left: 1.5rem !important;
    height: 68px;
    border-bottom: 1px solid #f1f1f1;
}
}

@media (max-width: 480px) {
    .mobile-sidebar {
        width: 100vw;
        max-width: 100vw;
    }
}

/* Scrollbar Styling */
.sidebar-content::-webkit-scrollbar,
.sidebar-submenu::-webkit-scrollbar,
.sidebar-child-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track,
.sidebar-submenu::-webkit-scrollbar-track,
.sidebar-child-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb,
.sidebar-submenu::-webkit-scrollbar-thumb,
.sidebar-child-menu::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover,
.sidebar-submenu::-webkit-scrollbar-thumb:hover,
.sidebar-child-menu::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Animation Classes */
.slide-in-left {
    animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Focus States for Accessibility */
.mobile-menu-toggle:focus,
.sidebar-close:focus,
.submenu-back:focus,
.child-back:focus,
.sidebar-menu-link:focus,
.submenu-link:focus,
.child-link:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}
.offcanvas.offcanvas-top {
    height: 100vh;
}
/* High Contrast Support */
@media (prefers-contrast: high) {
    .mobile-sidebar {
        border: 2px solid #000;
    }
    
    .sidebar-menu-link,
    .submenu-link,
    .child-link {
        border-bottom: 1px solid #ccc;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .mobile-sidebar,
    .sidebar-submenu,
    .sidebar-child-menu,
    .sidebar-overlay {
        transition: none;
    }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    .mobile-sidebar {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .sidebar-header {
        border-bottom-color: #374151;
        background: #1f2937;
    }
    
    .sidebar-menu-link,
    .submenu-link,
    .child-link {
        color: #f9fafb;
        background: #1f2937;
    }
    
    .sidebar-menu-link:hover,
    .submenu-link:hover,
    .child-link:hover {
        background: #374151;
    }
    
    .sidebar-close {
        color: #d1d5db;
    }
    
    .sidebar-close:hover {
        background: #374151;
        color: #f9fafb;
    }
}
