.external-nav {
  background-color: #07122d;
  padding: 6px 16px;
  border-radius: 2rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: inline-block;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
}

.external-nav .nav-link {
  color: #ffffff;
  padding: 6px 12px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  background-color: transparent;
  border: none;
  transition: 0.3s;
}

.external-nav .nav-link:hover {
  color: #7A84EC;
  text-decoration: underline;
}

.external-nav .nav-link svg {
  margin-left: 4px;
  width: 14px;
  height: 14px;
}

/*menu button*/
.menu-toggle {
  background-color: transparent;
  color: white;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  padding: 6px 12px;
}

.menu-toggle svg.arrow-icon {
  margin-left: 6px;
  transition: transform 0.3s ease;
}

/* Rotate arrow when nav is open */
.external-nav.open .arrow-icon {
  transform: rotate(180deg);
}

/* Responsive behavior */
@media (max-width: 768px) {
  .external-nav .nav {
    display: none;
    flex-direction: column;
    background-color: #07122d;
    margin-top: 8px;
    border-radius: 0.5rem;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .external-nav.open .nav {
    display: flex;
  }
}


/* Backdrop */
.nav-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: start;
  padding-top: 100px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9999;
}

/* Shown modal */
.nav-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modal box animation */
.nav-modal-box {
  background-color: #07122d;
  color: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  width: 90%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(-10px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate box only when parent is visible */
.nav-modal.show .nav-modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Top bar */
.nav-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #b5b5b5;
  margin-bottom: 10px;
}

.nav-modal-close {
  background: none;
  color: white;
  font-size: 1.2rem;
  border: none;
  cursor: pointer;
}

/* Modal links */
.nav-modal-link {
  color: white;
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid #1c223d;
  font-size: 0.95rem;
}

.nav-modal-link:last-child {
  border-bottom: none;
}

.nav-modal-link:hover {
  color: #7A84EC;
}

#nav-modal-socials {
  width: 280px;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  padding: 10px 10px 10px 10px;
}

#nav-modal-socials img {
  height: 25px;
  filter: invert(100%) sepia(0%) saturate(25%) hue-rotate(70deg) brightness(108%) contrast(108%);
  transition: filter 0.2s linear;
}

#nav-modal-socials img:hover {
  filter: invert(55%) sepia(13%) saturate(2138%) hue-rotate(197deg) brightness(97%) contrast(91%);
}

.custom-tooltip {
  z-index: 1000;
}

/* Show modal on small screens only */
@media (max-width: 768px) {
  .external-nav .nav {
    display: none !important;
  }

  .nav-modal.show {
    display: flex;
  }
}
