/* ==========================================================================
   u.cash - Navigation Component
   Sticky glassmorphism navbar, mobile hamburger, theme toggle, CTA.
   ========================================================================== */

/* ---- Navbar Container ---- */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav, 100);
  height: 72px;
  display: flex;
  align-items: center;
  background: var(--color-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-glass-border);
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.navbar.scrolled {
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
}

/* ---- Navbar Inner ---- */

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ---- Logo (navbar-brand) ---- */

.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  z-index: calc(var(--z-nav, 100) + 1);
  height: 100px;
}

.navbar-brand img {
  height: 100px;
  width: auto;
}

/* Default (dark theme): show white logo, hide dark logo */
.logo-dark {
  display: block;
}

.logo-light {
  display: none;
}

/* Light theme: show dark logo, hide white logo */
[data-theme="light"] .logo-dark {
  display: none;
}

[data-theme="light"] .logo-light {
  display: block;
}

/* Dark theme: explicit to override any conflicts */
[data-theme="dark"] .logo-light {
  display: none;
}

[data-theme="dark"] .logo-dark {
  display: block;
}

/* ---- Desktop Nav Links ---- */

.navbar-links {
  display: none;
  align-items: center;
  gap: var(--space-xl, 2rem);
}

.navbar-links a {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  padding: 0.25rem 0;
}

.navbar-links a:hover {
  color: var(--color-text-primary);
}

.navbar-links a.active {
  color: var(--color-gold-primary);
}

.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold-primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.navbar-links a:hover::after,
.navbar-links a.active::after {
  width: 100%;
}

/* ---- Navbar Actions (Right) ---- */

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ---- Theme Toggle ---- */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--color-glass-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  color: var(--color-gold-primary);
  border-color: var(--color-gold-primary);
}

/* Sun visible in dark mode, moon in light */
.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

/* ---- Hamburger Button ---- */

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: calc(var(--z-nav, 100) + 1);
  padding: 0;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 999px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Mobile Navigation Panel ---- */

.nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 360px;
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg-secondary);
  z-index: calc(var(--z-nav, 100) - 1);
  padding: calc(72px + 1.5rem) 1.5rem 1.5rem;
  transform: translateX(100%);
  transition: transform 0.4s ease;
  overflow-y: auto;
  border-left: 1px solid var(--color-border);
}

.nav-panel.open {
  transform: translateX(0);
}

/* Mobile overlay backdrop */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-nav, 100) - 2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile nav links inside panel */
.nav-panel a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-panel a:hover,
.nav-panel a.active {
  color: var(--color-gold-primary);
  background: var(--color-gold-subtle);
}

.nav-panel .nav-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  margin-top: 1.5rem;
}

/* Hide hamburger on desktop */
@media (min-width: 768px) {
  .navbar {
    height: 80px;
  }

  .navbar-links {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  .nav-panel,
  .nav-overlay {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .navbar-links {
    gap: 2.5rem;
  }
}
