/* ========================================
   MOBILE SIDEBAR MENU - CONSISTENT STYLING
   For His Mercy Private School Website
   ======================================== */

/* Mobile Sidebar Menu - Swipe from Left with Gradient Green & Circular Balls */
@media (max-width: 768px) {
    /* Hide default Bootstrap collapse behavior */
    #navbarCollapse.navbar-collapse {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 85% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
        background-color: #28a745 !important;
        background-attachment: fixed !important;
        z-index: 9999 !important;
        transition: left 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3) !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Show sidebar when toggled */
    #navbarCollapse.navbar-collapse.show {
        left: 0 !important;
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
        background-color: #28a745 !important;
    }
    
    /* Overlay backdrop when menu is open */
    .navbar-collapse.show::before {
        content: '' !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(7, 112, 27, 0.8) !important;
        z-index: -1 !important;
        animation: fadeIn 0.3s ease !important;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    /* Decorative Circular Balls - Like Curriculum Section */
    /* Large circular ball - top right */
    .navbar-collapse::after {
        content: '' !important;
        position: absolute !important;
        width: 280px !important;
        height: 280px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border-radius: 50% !important;
        top: -80px !important;
        right: -100px !important;
        pointer-events: none !important;
        z-index: 1 !important;
    }
    
    /* Logo section in sidebar */
    .offcanvas-brand {
        position: relative !important;
        z-index: 10 !important;
        padding: 24px 20px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        background: rgba(0, 0, 0, 0.1) !important;
        display: flex !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
    
    .offcanvas-brand img {
        filter: brightness(0) invert(1) !important;
    }
    
    /* Navigation container - Scrollable */
    .navbar-nav {
        position: relative !important;
        z-index: 2 !important;
        padding: 20px 0 !important;
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    /* Custom scrollbar for menu */
    .navbar-nav::-webkit-scrollbar {
        width: 6px !important;
    }
    
    .navbar-nav::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 10px !important;
    }
    
    .navbar-nav::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3) !important;
        border-radius: 10px !important;
    }
    
    .navbar-nav::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5) !important;
    }
    
    /* Medium circular ball - middle left */
    .navbar-nav::before {
        content: '' !important;
        position: absolute !important;
        width: 200px !important;
        height: 200px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border-radius: 50% !important;
        top: 30% !important;
        left: -80px !important;
        pointer-events: none !important;
        z-index: 1 !important;
    }
    
    /* Large circular ball - bottom right */
    .navbar-nav::after {
        content: '' !important;
        position: absolute !important;
        width: 350px !important;
        height: 350px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 50% !important;
        bottom: -120px !important;
        right: -150px !important;
        pointer-events: none !important;
        z-index: 1 !important;
        animation: float 8s ease-in-out infinite !important;
    }
    
    @keyframes float {
        0%, 100% { transform: translateY(0px) scale(1); }
        50% { transform: translateY(-20px) scale(1.05); }
    }
    
    /* Menu items styling */
    .nav-link {
        color: #ffffff !important;
        position: relative !important;
        z-index: 2 !important;
        padding: 14px 24px !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: rgba(255, 255, 255, 0.2) !important;
        color: #ffffff !important;
        transform: translateX(8px) !important;
        border-left: 4px solid #ffffff !important;
        padding-left: 20px !important;
    }
    
    .nav-link:active {
        background: rgba(255, 255, 255, 0.25) !important;
        color: #ffffff !important;
    }
    
    .nav-link i {
        color: #ffffff !important;
        font-size: 18px !important;
        margin-right: 12px !important;
        width: 24px !important;
        display: inline-flex !important;
        justify-content: center !important;
    }
    
    /* Dropdown menu styling in sidebar */
    .nav-item.dropdown {
        position: relative !important;
    }
    
    .dropdown-toggle::after {
        filter: brightness(0) invert(1) !important;
        opacity: 0.9 !important;
        float: right !important;
        margin-top: 6px !important;
    }
    
    /* Dropdown menu with darker green background for visibility */
    .dropdown-menu,
    .dropdown-menu.show,
    .dropdown-menu[data-bs-popper],
    #navbarCollapse .dropdown-menu,
    #navbarCollapse .dropdown-menu.show,
    #navbarCollapse .nav-item .dropdown-menu,
    #navbarCollapse .navbar-nav .dropdown-menu,
    .navbar-collapse .dropdown-menu,
    .navbar-collapse .dropdown-menu.show,
    .navbar-nav .dropdown-menu,
    .nav-item .dropdown-menu {
        position: static !important;
        float: none !important;
        background: #7db27d !important;
        background-color: #7db27d !important;
        background-image: none !important;
        border: none !important;
        border-left: 3px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        margin: 0 !important;
        padding: 8px 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
    }
    
    .dropdown-item {
        color: #ffffff !important;
        padding: 12px 20px 12px 48px !important;
        font-size: 15px !important;
        transition: all 0.3s ease !important;
        border-radius: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        background-color: transparent !important;
    }
    
    .dropdown-item:hover,
    .dropdown-item:focus,
    .dropdown-item:active {
        background: rgba(255, 255, 255, 0.15) !important;
        background-color: rgba(255, 255, 255, 0.15) !important;
        color: #ffffff !important;
        transform: translateX(4px) !important;
    }
    
    .dropdown-item i {
        color: #ffffff !important;
        margin-right: 10px !important;
        width: 20px !important;
        display: inline-flex !important;
        justify-content: center !important;
    }
    
    /* Close button for mobile sidebar */
    .mobile-menu-close {
        position: absolute !important;
        top: 20px !important;
        right: 20px !important;
        width: 40px !important;
        height: 40px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border: none !important;
        border-radius: 50% !important;
        color: #ffffff !important;
        font-size: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        z-index: 11 !important;
        transition: all 0.3s ease !important;
    }
    
    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.3) !important;
        transform: rotate(90deg) !important;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden !important;
    }
}

/* Tablet dropdown styling (769px - 991px) */
@media (min-width: 769px) and (max-width: 991px) {
    .navbar-collapse {
        margin-top: 16px !important;
        position: relative !important;
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
        background-color: #28a745 !important;
        border-radius: 20px !important;
        padding: 24px 16px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
        overflow: hidden !important;
    }
    
    .navbar-collapse::before {
        content: '' !important;
        position: absolute !important;
        width: 250px !important;
        height: 250px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border-radius: 50% !important;
        top: -80px !important;
        right: -60px !important;
        pointer-events: none !important;
        z-index: 1 !important;
    }
    
    .navbar-collapse::after {
        content: '' !important;
        position: absolute !important;
        width: 300px !important;
        height: 300px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border-radius: 50% !important;
        bottom: -100px !important;
        left: -80px !important;
        pointer-events: none !important;
        z-index: 1 !important;
    }
    
    .navbar-nav {
        position: relative !important;
        z-index: 2 !important;
    }
    
    .navbar-nav::after {
        content: '' !important;
        position: absolute !important;
        width: 120px !important;
        height: 120px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 50% !important;
        top: 40% !important;
        right: -30px !important;
        pointer-events: none !important;
        z-index: 1 !important;
    }
    
    .nav-link {
        color: #ffffff !important;
        position: relative !important;
        z-index: 2 !important;
        padding: 12px 16px !important;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: rgba(255, 255, 255, 0.2) !important;
        color: #ffffff !important;
    }
    
    .nav-link i {
        color: #ffffff !important;
    }
    
    .dropdown-toggle::after {
        filter: brightness(0) invert(1) !important;
    }
    
    /* Tablet dropdown - transparent */
    .dropdown-menu,
    .dropdown-menu.show {
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .dropdown-item {
        color: #ffffff !important;
        padding: 12px 20px 12px 40px !important;
    }
    
    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.15) !important;
        color: #ffffff !important;
    }
}
