.navbar {
    background-color: #2d2d2d;
    height: 70px;
    width: 100vw;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    position: sticky;
    /* Make the navbar sticky */
    top: 0;
    /* Stick the navbar to the top */
    z-index: 1000;
    /* Ensure it stays above other content */
}

.left {
    display: flex;
    align-items: center;
    margin-right: auto;
}

.center {
    display: flex;
    justify-content: center;
    flex-grow: 1;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    visibility: visible;
}

.centerList {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.centerList li {
    cursor: pointer;
    position: relative;
    padding-bottom: 5px;
    font-size: 18px;
}

.centerList li::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 50%;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.centerList li:hover::after {
    border-bottom-color: #FF6A00;
}

.right {
    display: flex;
    align-items: center;
    position: relative;
}

.toggleBtn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: none;
    margin-right: 15px;
}

/* Media Queries for responsiveness */
@media (max-width: 1024px) {
    .toggleBtn {
        display: block;
    }

    .center {
        position: static;
        transform: none;
        visibility: hidden;
        display: none;
        flex-direction: column;
    }

    .center.active {
        visibility: visible;
        display: flex;
        flex-direction: column;
        align-items: center;
        position: absolute;
        top: 68px;
        left: 0;
        width: 100%;
        background-color: #2d2d2d;
        z-index: 1000;
        padding: 10px 0;
        transition: max-height 0.3s ease-in-out, visibility 0.3s ease-in-out;
        max-height: 0;
        /* Start with height of 0 */
        overflow: hidden;
    }

    .center.active {
        max-height: 500px;
        /* Full height when active */
    }

    .centerList {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .right .contactBtn {
        padding: 5px 18px;
        border-radius: 8px;
        font-size: 12px;
    }
}

.matrixLogoNav {
    width: 152px;
    margin-bottom: 3px;
}

@media (max-width: 480px) {
    .matrixLogoNav {
        width: 123px;
    }

    .navbar {
        padding: 10px;
    }

    .left {
        margin-right: auto;
    }

    .centerList li {
        font-size: 14px;
    }

    .right .contactBtn {
        padding: 5px 18px;
        border-radius: 8px;
        font-size: 9px;
    }
}


/* Keyframes for the opening animation */
@keyframes slideDown {
    0% {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
    }

    99% {
        visibility: visible;
        opacity: 1;
    }

    100% {
        max-height: 500px;
        opacity: 1;
    }
}

/* Keyframes for the closing animation */
@keyframes slideUp {
    0% {
        max-height: 500px;
        opacity: 1;
    }

    1% {
        opacity: 1;
    }

    100% {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
    }
}

/* Media Queries for responsiveness */
@media (max-width: 1024px) {
    .toggleBtn {
        display: block;
    }

    .center {
        position: static;
        transform: none;
        visibility: hidden;
        display: none;
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
    }

    /* When navbar is active/opened */
    .center.active {
        display: flex;
        animation: slideDown 0.5s ease-in forwards;
    }

    /* When navbar is closing */
    .center.closing {
        animation: slideUp 0.5s ease-in forwards;
    }

    .centerList {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .right .contactBtn {
        padding: 5px 18px;
        border-radius: 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
  

    .navbar {
        padding: 10px;
    }

    .left {
        margin-right: auto;
    }

    .centerList li {
        font-size: 14px;
    }

    .right .contactBtn {
        padding: 5px 18px;
        border-radius: 8px;
        font-size: 9px;
    }
}