*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    position: relative; /* Needed for the pseudo-element to be positioned correctly */
    margin: 0; /* Remove default margin */
}

body::before {
    content: "";
    position: fixed; /* Fixed position to cover the entire viewport */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/indexBackground.jpg');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    opacity: 0.7; /* Adjust the opacity as needed */
    z-index: -1; /* Ensure the pseudo-element is behind the content */
}

header {
    background-color: #ffffff;
    color: rgb(0, 0, 0);
    padding: auto;
    position: relative; /* Contain the absolute position of the dropdown */
}

.title-container {
    max-width: 900px;
    margin: 250px auto;
    background-color: white; /* background */
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgb(0, 0, 0);
}

.title-name {
    margin: 0;
    flex: 1; /* Takes up remaining space, centering itself in the navbar */
    text-align: center;
}

h2 {
    font-size: 40px;
    text-align: center;
    color: #333; /* text */
}

p {
    font-size: 18px;
    text-align: justify;
    color: #333;
    margin: 25px; /* Adjust the value as needed */
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* Allows positioning of other elements like logo and menu */
    padding: auto;
}

.logo-container {
    margin-top: 2px;
    margin-left: auto; /* Pushes the logo to the right */
}

.logo-container img {
    height: 50px; /* Adjust the height as needed */
    width: auto;
}

.nav-links {
    background-repeat: no-repeat;
    background-position: top;
    background-size: cover;
    border-style:hidden;
    list-style:none;
    display: flex;
    flex-direction:column; /* Stack links vertically */
    position: absolute;
    top: 56px; /* Adjust based on your header height */
    left: 0rem; /* Position it aligned with the menu icon */
    background-color: #ffffff;
    text-align: center;
    transition: max-height 0.5s ease-in-out;
    overflow:hidden;
    max-height: 0; /* Start collapsed */
    z-index: 1; /* Ensure it appears above other content */
    width: 240px; /* Set a fixed width */
    border-radius: 0px 30px 0px 30px; /* Change the border of the nav link */
}

.nav-links li {
   margin: 0.5rem 2.5rem;
}

.nav-links a {
    color: rgb(0, 0, 0);
    font-size: 1.1rem;
    display: block; /* Ensure links take full width */
    padding: 0.6rem 0rem; /* Add padding for better touch target */
}

/* Scale text on hover */
.nav-links a:hover {
    transform: scale(1.1);  /* Scale text to 110% on hover */
}

.menu-icon {
    display: flex; /* Always display the menu icon */
    flex-direction: column;
    cursor: pointer;
    position: absolute; /* Position at the top left */
    top: auto;
    left: 0.5rem;
}

.menu-icon div {
    width: 25px;
    height: 3px;
    background-color: rgb(0, 0, 0);
    margin: 4px 0;
}

/* Hide nav-links by default for larger screens */
.nav-links {
    display: none;
}

/* Show nav-links when active */
.nav-links.active {
    display: flex;
    max-height: 800px; /* Adjust based on the number of items */
}


@media only screen and (max-width: 768px) {
    .title-container {
        max-width: 90%; /* Adjusted for smaller screens */
        margin: 150px auto; /* Adjusted vertical spacing */
        background-color: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 0 20px rgb(0, 0, 0);
    }

    .title-name {
        margin: 0;
        flex: 1;
        text-align: center;
    }

    h2 {
        font-size: 14px; /* Slightly smaller font size for mobile */
        text-align: center;
        margin-left: 30px;
        color: #333;
    }

    .logo-container {
        margin-top: 2px;
        margin-left: auto;
    }

    .logo-container img {
        height: 40px; /* Adjust logo size for mobile */
        width: auto;
    }

    .nav-links {
        display: flex; /* Ensure it's flex to transition */
        flex-direction: column; /* Stack links vertically on smaller screens */
        max-height: 0; /* Initially collapsed */
        overflow: hidden; /* Hide overflowing items when collapsed */
        transition: max-height 0.3s ease; /* Smooth opening/closing */
        top: 46px; /* Adjust based on your header height */
        left: 0rem; /* Position it aligned with the menu icon */
    }

    .nav-links li {
        margin: 0.5rem 1.5rem;
    }

    .nav-links a {
        color: rgb(0, 0, 0);
        font-size: 1rem; /* Slightly smaller text size */
        display: block;
        padding: 0.5rem 0;
    }
}