/* =========================
   🌌 DEFI NAVBAR - SKYROCKET
   ========================= */

.menu {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 1320px;
  height: 72px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-sizing: border-box;

  background: rgba(10, 12, 24, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;

  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(0, 234, 255, 0.05);
}

/* Glow border effect */
.menu::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(
    90deg,
    rgba(0, 234, 255, 0.7),
    rgba(142, 45, 226, 0.6),
    rgba(255, 46, 191, 0.7)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

.menu-left,
.menu-center,
.menu-right {
  display: flex;
  align-items: center;
}

.menu-left {
  min-width: 180px;
}

.menu-center {
  flex: 1;
  justify-content: center;
}

.menu-right {
  min-width: 180px;
  justify-content: flex-end;
  gap: 12px;
}

/* Logo */
.menu-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #00eaff, #8a2be2, #ff2ebf);
  box-shadow:
    0 0 18px rgba(0, 234, 255, 0.35),
    0 0 28px rgba(255, 46, 191, 0.18);
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* riempie bene lo spazio */
  display: block;
  border-radius: 12px;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffffff, #00eaff, #ff2ebf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Menu desktop */
.menu-items {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-items a {
  position: relative;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 10px 14px;
  border-radius: 12px;
  transition: all 0.25s ease;
}

.menu-items a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 16px rgba(0, 234, 255, 0.12);
}

.menu-items a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00eaff, #ff2ebf);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.menu-items a:hover::after {
  transform: scaleX(1);
}

/* Wallet button premium */
#connectButton {
  font-family: "Electrolize", sans-serif;
  font-weight: 700;
  border: 0;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 0.8rem;
  
  text-transform: uppercase;
  color: white;
  cursor: pointer;
  transition: all 0.25s ease;

background: linear-gradient(
  135deg,
  #00cfff,
  #5a2cff,
  #ff2ebf
);
  box-shadow:
    0 8px 20px rgba(123, 44, 255, 0.28),
    0 0 20px rgba(0, 234, 255, 0.18);
}

#connectButton:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 28px rgba(123, 44, 255, 0.38),
    0 0 22px rgba(0, 234, 255, 0.3);
  filter: brightness(1.08);
}

#connectButton:active {
  transform: scale(0.98);
}

/* Hamburger */
.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.2rem;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(0, 234, 255, 0.35);
  box-shadow: 0 0 14px rgba(0, 234, 255, 0.15);
}



/* =========================
   📱 MOBILE
   ========================= */
@media (max-width: 980px) {
  .menu {
    top: 10px;
    height: 64px;
    padding: 0 14px;
  }

  .menu-center {
    position: static;
  }

  .menu-items {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px;
    background: rgba(9, 11, 20, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
      0 18px 45px rgba(0, 0, 0, 0.45),
      0 0 20px rgba(0, 234, 255, 0.08);
  }

  .menu-items a {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 1rem;
  }

  .menu-items.show-menu {
    display: flex;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .menu-right {
    min-width: auto;
  }

  #connectButton {
    padding: 10px 14px;
    font-size: 0.72rem;
  }
}

@media (max-width: 640px) {
  .logo-text {
    font-size: 0.95rem;
  }

  #connectButton {
    font-size: 0.68rem;
    padding: 9px 12px;
  }

  .menu-left {
    min-width: auto;
  }
}


/* SUBMENU */

/* =========================
   SUB MENU AGGANCIATO
   ========================= */

.sub-menu {
  position: fixed;
  top: 78px; /* 14px top + 72px altezza menu - piccola sovrapposizione */
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 1320px;
  min-height: 54px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  box-sizing: border-box;

  background: rgba(10, 12, 24, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: none;

  border-radius: 0 0 18px 18px;

  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(0, 234, 255, 0.04);
}

/* bordo glow coerente col menu principale */
.sub-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0 0 18px 18px;
  padding: 1px;
  background: linear-gradient(
    90deg,
    rgba(0, 234, 255, 0.55),
    rgba(142, 45, 226, 0.5),
    rgba(255, 46, 191, 0.55)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.55;
}

/* Piccolo "ponte" grafico con il menu sopra */
.sub-menu::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 24px;
  right: 24px;
  height: 10px;
  background: rgba(10, 12, 24, 0.82);
  border-radius: 10px 10px 0 0;
  z-index: -1;
}

.sub-menu-items {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  padding: 8px 0;
}

.sub-menu-items a {
  position: relative;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 9px 14px;
  border-radius: 10px;
  transition: all 0.25s ease;
}

.sub-menu-items a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 12px rgba(0, 234, 255, 0.10);
}

.sub-menu-items a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00eaff, #ff2ebf);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.sub-menu-items a:hover::after,
.sub-menu-items a.active::after {
  transform: scaleX(1);
}

.sub-menu-items a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 14px rgba(0, 234, 255, 0.12);
}