/* TOP NAVIGATION */
nav.top-nav {
  display: flex;
  gap: 0.8rem;
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

/* NAVIGATION MENU */
.top-nav ul {
  display: flex;
  align-items: center;
  background-color: var(--pastel-color);
  list-style: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* NAV ITEMS */
.top-nav ul li {
  position: relative;
  transition: transform 0.3s ease-in-out;
}

/* NAV LINKS */
.top-nav ul li a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--primary-color);
  padding: 0.5rem;
  transition:
    color 0.3s ease-in-out,
    transform 0.3s ease-in-out;
}

/* NAV ICONS */
.top-nav ul li a .nav-icon {
  max-width: 1.4rem;
  transition: transform 0.3s ease-in-out;
}

.top-nav ul li a:hover .nav-icon {
  transform: scale(1.1);
}

/* TOOLTIP / LABEL */
.top-nav ul li a p {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--primary-color);
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  opacity: 0;
  transition:
    transform 0.2s ease-out,
    opacity 0.2s ease-out;
  display: none;
}

.top-nav ul li a:hover p {
  display: block;
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ACTIVE NAV ITEM */
.top-nav ul li a.active .nav-icon {
  filter: invert(53%) sepia(60%) saturate(371%) hue-rotate(145deg);
  transform: scale(1.1);
}

/* LET'S CONNECT BUTTON */
.top-nav a#let-connect-btn {
  position: relative;
  overflow: hidden;
  background-color: var(--accent-color);
  border: 1px solid var(--accent-color);
  width: 8rem;
  padding: 0.5rem;
  border-radius: 16px;
  text-decoration: none;
  color: var(--neutral-color);
  text-align: center;
  font-size: calc(var(--XS-Fsize) - 0.05rem);
  cursor: pointer;
  transition:
    transform 0.3s ease-in-out,
    opacity 0.3s ease-in-out;
  outline: none;
  box-shadow: none;
  white-space: nowrap;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* Ripple effect */
.top-nav a#let-connect-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition:
    width 0.4s ease-out,
    height 0.4s ease-out,
    opacity 0.6s ease-out;
  outline: none;
  box-shadow: none;
}

/* Ripple activation */
.top-nav a#let-connect-btn:active::after {
  width: 200%;
  height: 200%;
  opacity: 1;
  transition:
    width 0.3s ease-out,
    height 0.3s ease-out,
    opacity 0.4s ease-out;
}

.top-nav a#let-connect-btn:hover {
  opacity: 0.8;
  transform: translateY(-5px);
}

.top-nav a#let-connect-btn .let-connect-text {
  display: inline;
}
.top-nav a#let-connect-btn .let-connect-icon {
  display: none;
  font-size: 1.2em;
  vertical-align: middle;
  color: var(--neutral-color);
}

/* Hide Let's Connect button and show connect icon on small screens */
@media (max-width: 600px) {
  .top-nav a#let-connect-btn {
    display: none !important;
  }
  .top-nav ul li.connect-mobile {
    display: flex !important;
  }
}

/* Hide connect icon on desktop by default */
.top-nav ul li.connect-mobile {
  display: none;
}

/* RESPONSIVENESS */
@media (max-width: 768px) {
  nav.top-nav {
    top: 10px;
    width: 90%;
  }

  .top-nav ul {
    padding: 0.4rem 0.8rem;
  }

  .top-nav ul li a {
    padding: 0.4rem;
  }

  .top-nav ul li a .nav-icon {
    max-width: 1.2rem;
  }

  .top-nav a#let-connect-btn {
    width: 7rem;
    font-size: 0.75rem;
    padding: 0.45rem;
  }
}

@media (max-width: 600px) {
  .top-nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 0;
    width: 100%;
  }
  .top-nav ul li {
    margin: 0 8px;
  }
  .top-nav {
    width: 100vw;
    left: 0;
    right: 0;
    text-align: center;
  }
  .top-nav a#let-connect-btn {
    width: 3rem;
    min-width: 0;
    padding: 0.45rem 0.2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .top-nav a#let-connect-btn .let-connect-text {
    display: none;
  }
  .top-nav a#let-connect-btn .let-connect-icon {
    display: inline;
    font-size: 1.4em;
  }
}

@media (max-width: 400px) {
  .top-nav a#let-connect-btn {
    width: 95vw;
    min-width: 0;
    font-size: 0.72rem;
    padding: 0.38rem 0.2rem;
    border-radius: 10px;
    margin: 0 auto;
    display: block;
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
  }
}
