Image covering chatbot when clicked, how to fix layering issue

I’m building a web application that includes a chatbot feature and displays images using the Next.js Image component. I’ve encountered an issue where, when the chatbot is clicked to open, the images cover over the chatbot.

I’m using the Image component inside a container with position: relative, and the chatbot is positioned on top of this container. However, when the chatbot is clicked to open, it gets covered by the image.

I’ve tried using z indexes as well but it’s not working. If I don’t use some kind of aspect ratio the image no longer covers the chatbot pop up but the images are no longer the same sizes.

This is my code:

import { H3 } from "@/components/ui/H3";
import { H2 } from "@/components/ui/H2";
import Image from 'next/image';
import Link from 'next/link';
import motorbase from "@/assets/motorbase.webp";
import ozon from "@/assets/ozon.png";
const motorbasePdfPath = "/MotorBaseSchema.pdf";
const motorbasepath = "/projects/motorbaseproject";
import { Metadata } from "next";
export const metadata: Metadata = {
  title: "Projects",
  description: "favorite projects",

};
export default function Page() {
  return (
    <section className="text-black dark:text-white p-8">
      <H3 className="text-center mb-10">Here are some of my favorite projects</H3>
      <section className="grid grid-cols-1 md:grid-cols-2 gap-8">
        {/* MotorBase Project */}
        <section className="flex flex-col overflow-hidden rounded-lg">
        <div className="aspect-ratio">
  <Image src={motorbase} alt="MotorBase" layout="fill" />
</div>

          <section className="p-4"> {/* Text Content */}
            <H2>MotorBase: DBMS</H2>
            <p className="text-sm my-4 dark:text-gray-300">
              MotorBase is a database aimed at simplifying a local car dealership’s business operations online.
            </p>
            <a href={motorbasePdfPath} target="_blank" rel="noopener noreferrer" >
              <p className="inline-block bg-blue-600 text-white px-6 py-2 rounded-full hover:bg-blue-700 transition-colors duration-300">View</p>
            </a>
          </section>
        </section>

        {/* Ozon Game Project */}
        <section className="flex flex-col overflow-hidden rounded-lg"> {/* Removed fixed height */}
        <div className="aspect-ratio">
  <Image src={ozon} alt="Ozon Game" layout="fill" />
</div>


          <div className="p-4"> {/* Text Content */}
            <H2>Ozon: Game Developer</H2>
            <p className="text-sm my-4 dark:text-gray-300">
              A futuristic game set in 2729, tackling pollution with innovative gameplay and interactive design elements.
            </p>
            <a href = "https://github.com/m-shahzad1/OZON" >
              <p className="inline-block bg-blue-600 text-white px-6 py-2 rounded-full hover:bg-blue-700 transition-colors duration-300">View</p>
            </a>
          </div>
        </section>
      </section>
    </section>
  );
}

This is my relevant globals.css

.image-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aspect-ratio {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* Assuming 16:9 aspect ratio. Adjust as needed */
}

.aspect-ratio img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Or any other value you need */
}


Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật