nav {
    background-color: #81007f;
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 1000;
    border-bottom: 2px solid #6d864d;
    height: 20px;
    color: #ffffff;
}

/* Define keyframes for the moving background */
@keyframes movingBackground {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Apply the animation on hover */
nav:hover {
  background: linear-gradient(270deg, #81007f, #81007f, #035e47, #0f8a5b, #1B2631, #212121);
  background-size: 400% 400%;
  -webkit-animation: movingBackground 6s ease infinite;
  -moz-animation: movingBackground 6s ease infinite;
  animation: movingBackground 6s ease infinite;
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    color: #ffffff;
}

nav ul li {
    margin-right: 20px;
    margin-bottom: 10px;
}

nav ul li:last-child {
    margin-right: 0;
}

nav ul li a {
    color: #ffffff;
    text-decoration: none;
    padding: 5px 10px;
    transition: color 0.3s ease, font-size 0.3s ease;
}

nav ul li a:hover {
    color: white;
}