.navbar {
    padding: 10px 20px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.navbar a {
    color: #555;
    text-decoration: none;
    font-family: 'Lexend', sans-serif;
}

header nav a:hover {
    color: #42236c;
}

#mobile-menu-button {
    display: none;
}

/* Overlay container */
.overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, left 0.4s ease-out, visibility 0.4s;
    -webkit-transition: opacity 0.4s ease-out, left 0.4s ease-out, visibility 0.4s;
    z-index: 1000;
    font-family: 'Lexend', sans-serif;
}

/* Active state for the overlay */
.overlay.active {
    left: 0;
    opacity: 1;
    visibility: visible;
}

/* Content rectangle inside the overlay */
.overlay-content {
    background-color: #f5f5f5;
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    width: 90%;
    max-width: 400px;
    box-sizing: border-box;
    transform: scale(0.9);
    -webkit-transform: scale(0.9);
    transition: transform 0.4s ease-out;
    -webkit-transition: transform 0.4s ease-out;
}

.overlay.active .overlay-content {
    transform: scale(1);
    -webkit-transform: scale(1);
}

/* Close button (X icon) */
.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #454545;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    -webkit-transition: color 0.3s ease, transform 0.2s ease;
    line-height: 1;
}

.close-button:hover {
    color: #777;
    transform: rotate(90deg);
    -webkit-transform: rotate(90deg);
}

/* List styling */
.overlay-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.overlay-content li {
    margin-bottom: 15px;
    padding: 3px;
}

.overlay-content li:last-child {
    margin-bottom: 0;
}

/* Link styling */
.overlay-content a {
    text-decoration: none;
    color: #454545;
    font-size: 18px;
    padding: 8px 5px;
    display: block;
    transition: color 0.3s ease, background-color 0.3s ease;
    -webkit-transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 5px;
}

.overlay-content a:hover {
    color: #ffffff;
    background-color: #454545;
}

/* Prevent scrolling when overlay is active */
body.overlay-active {
    overflow: hidden;
}

@media (max-width: 767px) {
    #mobile-menu-button {
        display: flex !important;
        background: transparent;
        border: none;
        flex-direction: column;
        justify-content: space-around;
        width: 60px;
        height: 56px;
        cursor: pointer;
        padding: 5px;
        margin-top: 29px;
        margin-left: 30px;
    }

    .desktop-nav {
        display: none !important;
    }

    #mobile-menu-button .line {
        display: block;
        width: 100%;
        height: 5px;
        background-color: #454545;
        border-radius: 4px;
        transition: all 0.3s ease;
        -webkit-transition: all 0.3s ease;
        margin: 4px 0px;
        flex: 0 0 auto;
    }

    #mobile-menu-button.open .line:nth-child(1) {
        transform: translateY(13px) rotate(45deg);
        -webkit-transform: translateY(13px) rotate(45deg);
    }

    #mobile-menu-button.open .line:nth-child(2) {
        opacity: 0;
    }

    #mobile-menu-button.open .line:nth-child(3) {
        transform: translateY(-13px) rotate(-45deg);
        -webkit-transform: translateY(-13px) rotate(-45deg);
    }
}