.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  z-index: 101;
  color: #1e293b;
}

.top-nav-logo:hover {
  opacity: 0.9;
}

.top-nav-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
}

.top-nav-logo-text {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0.25rem;
  line-height: 1.2;
}

.top-nav-logo-brand {
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  color: #1e293b;
}

.top-nav-logo-accent {
  color: #667eea;
  font-weight: 800;
}

.top-nav-logo-by {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  margin-top: 0.1rem;
}

/* Hamburger Menu (Mobile Only) */
.top-nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background-color: #475569;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger-line.open:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-line.open:nth-child(2) {
  opacity: 0;
}

.hamburger-line.open:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation Links */
.top-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.top-nav-links a,
.top-nav-btn {
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.top-nav-links a:hover,
.top-nav-btn:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.08);
}

.top-nav-exit-btn {
  background: #b91c1c;
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.5rem 1rem;
}
.top-nav-exit-btn:hover {
  background: #991b1b;
  color: #fff;
}

/* My Account dropdown */
.top-nav-account-dropdown {
  position: relative;
}
.top-nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.top-nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  min-width: 180px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0;
  z-index: 102;
  display: flex;
  flex-direction: column;
}
.top-nav-dropdown-menu a {
  color: #333;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  border-radius: 0;
  text-align: left;
}
.top-nav-dropdown-menu a:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  transform: none;
}
.top-nav-dropdown-menu .top-nav-dropdown-item-btn {
  appearance: none;
  background: none;
  border: none;
  color: #333;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
.top-nav-dropdown-menu .top-nav-dropdown-item-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .top-nav {
    padding: 0.75rem 1rem;
  }

  .top-nav-logo-brand {
    font-size: 1.5rem;
  }

  /* Show hamburger menu on mobile */
  .top-nav-hamburger {
    display: flex;
  }

  /* Mobile menu styles */
  .top-nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: #ffffff;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 4rem 0 2rem 0;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.12);
    border-left: 1px solid #e2e8f0;
    transition: right 0.3s ease;
    z-index: 99;
  }

  .top-nav-links.mobile-open {
    right: 0;
  }

  .top-nav-links a,
  .top-nav-btn {
    width: 100%;
    padding: 1.25rem 2rem;
    text-align: left;
    font-size: 1.05rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 0;
    font-weight: 500;
  }

  .top-nav-links a:hover,
  .top-nav-btn:hover {
    background: rgba(102, 126, 234, 0.08);
    color: #667eea;
    padding-left: 2.25rem;
  }

  /* On mobile, dropdown menu stacks below trigger */
  .top-nav-account-dropdown {
    width: 100%;
  }
  .top-nav-dropdown-menu {
    position: static;
    margin-top: 0.25rem;
    margin-left: 0;
    min-width: 100%;
    background: #f8fafc;
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }
  .top-nav-dropdown-menu a {
    color: #334155;
    padding-left: 2.5rem;
  }
  .top-nav-dropdown-menu a:hover {
    background: rgba(102, 126, 234, 0.08);
    color: #667eea;
  }

  /* Backdrop overlay when mobile menu is open */
  .top-nav-links.mobile-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
}

/* Tablet responsive */
@media (max-width: 1024px) and (min-width: 769px) {
  .top-nav-links {
    gap: 1rem;
  }

  .top-nav-links a,
  .top-nav-btn {
    font-size: 0.9rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .top-nav {
    padding: 0.5rem 0.75rem;
  }

  .top-nav-logo-brand {
    font-size: 1.35rem;
  }

  .top-nav-links {
    width: 80%;
  }
}
