/* ===== NAVBAR ===== */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 48px;
  height: 64px;

  background: rgba(12, 10, 26, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  overflow: visible; /* keep dropdown visible */
}

.nav-username {
  color: #f0eaff;
  font-family: 'Geologica', sans-serif;
  font-weight: 600;
  font-size: 15px;
}

.nav-logo img {
  height: 90px;
  width: auto;
  margin-left: 10px;
  margin-top: 10px;
}

.nav-logo-text span {
  color: var(--purple2);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Social icons --- */

.nav-socials {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-socials a {
  width: 36px;
  height: 36px;
  border-radius: 9px;

  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);

  display: flex;
  align-items: center;
  justify-content: center;

  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: background 0.2s;
}

.nav-socials a:hover {
  background: var(--purple);
}

.nav-socials svg {
  width: 16px;
  height: 16px;
}

/* --- Login button --- */

.btn-login {
  padding: 9px 24px;
  border-radius: 9px;

  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.25);

  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;

  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-login:hover {
  border-color: var(--purple2);
  color: #fff;
}

/* --- Hamburger --- */

.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px 4px;
  /* larger tap target on mobile */
  min-width: 32px;
  min-height: 40px;
  justify-content: center;
}

.nav-hamburger span {
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  display: block;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Animate hamburger → X when open */
.nav-hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Dropdown --- */

.nav-dropdown {
  position: absolute;
  top: 64px;
  right: 72px;

  background: #fff;
  border-radius: 14px;

  box-shadow: 0 10px 48px rgba(0, 0, 0, 0.18);
  padding: 8px 0;
  min-width: 190px;

  display: none;
  z-index: 300;
}

.nav-dropdown.open {
  display: block;
  animation: dropIn 0.18s ease;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-dropdown a {
  display: block;
  padding: 12px 24px;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}

.nav-dropdown a:hover {
  background: var(--light-bg);
}

/* ─── Tablet (960px) ─── */

@media (max-width: 960px) {
  nav {
    padding: 0 24px;
    height: 56px;
  }

  .nav-logo img {
    height: 72px;
  }

  .nav-dropdown {
    top: 56px;
  }
}

/* ─── Mobile (640px) ─── */

@media (max-width: 640px) {
  nav {
    padding: 0 16px;
    height: 56px;
  }

  .nav-logo img {
    height: 60px;
    margin-left: 0;
    margin-top: 6px;
  }

  /* Hide social icons on mobile — they move into the dropdown */
  .nav-socials {
    display: none;
  }

  /* Compact login pill */
  .btn-login {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 8px;
    /* Truncate long usernames */
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Full-width dropdown on mobile */
  .nav-dropdown {
    top: 56px;
    right: 0;
    left: 0;
    border-radius: 0 0 18px 18px;
    min-width: unset;
    padding: 6px 0 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  }

  .nav-dropdown a {
    padding: 14px 24px;
    font-size: 16px;
    /* Comfortable touch targets */
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  /* Divider lines between items */
  .nav-dropdown a + a {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
  }

  /* Social icons row inside dropdown on mobile */
  .nav-dropdown-socials {
    display: flex;
    gap: 10px;
    padding: 12px 24px 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 4px;
  }

  .nav-dropdown-socials a {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(155, 127, 255, 0.1);
    border: 1px solid rgba(155, 127, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9B7FFF;
    text-decoration: none;
    transition: background 0.2s;
  }

  .nav-dropdown-socials a:hover,
  .nav-dropdown-socials a:active {
    background: rgba(155, 127, 255, 0.22);
  }

  .nav-dropdown-socials svg {
    width: 17px;
    height: 17px;
  }
}