/* ============================================================
   PREMIUM STICKY HEADER
   OnlineInvoicesMaker.com — Proforma Invoice Generator
   ============================================================ */

/* ---- Header Shell ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: var(--z-header);
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--space-6);
  max-width: 1440px;
  margin: 0 auto;
  gap: var(--space-4);
}

/* ---- Logo ---- */
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  text-decoration: none;
  user-select: none;
}

.header-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brand);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.header-logo:hover .header-logo-icon {
  transform: scale(1.05) rotate(-2deg);
}

.header-logo-icon svg { color: #fff; }

.header-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.header-logo-name {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header-logo-tagline {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-top: 1px;
}

/* ---- Center Nav ---- */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface-2);
}

.nav-link.active {
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  font-weight: 600;
}

.nav-link .nav-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Dropdown nav */
.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-dropdown-trigger svg.chevron {
  transition: transform var(--transition-fast);
}

.nav-dropdown-trigger:hover svg.chevron,
.nav-dropdown-trigger.open svg.chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  min-width: 240px;
  z-index: var(--z-dropdown);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
  padding: var(--space-2);
}

.nav-dropdown-trigger.open + .nav-dropdown-menu,
.nav-dropdown-menu.open {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: background var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.nav-dropdown-item:hover { background: var(--bg-surface-2); }

.nav-dropdown-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--brand-primary);
  transition: background var(--transition-fast);
}

.nav-dropdown-item:hover .nav-dropdown-icon { background: var(--brand-primary-light); }

.nav-dropdown-item-text { display: flex; flex-direction: column; }
.nav-dropdown-item-label { font-weight: 600; font-size: var(--text-sm); }
.nav-dropdown-item-desc { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 1px; }

/* ---- Header Actions ---- */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

/* Auth Buttons */
.btn-login {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4375rem var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-login:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

/* User Avatar */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  border: 2px solid var(--border-color);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.user-avatar:hover {
  border-color: var(--brand-primary);
  transform: scale(1.05);
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.mobile-menu-btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }

/* ---- Mobile Menu Drawer ---- */
.mobile-nav-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  z-index: calc(var(--z-header) - 1);
  padding: var(--space-4) var(--space-4) var(--space-6);
  transform: translateY(-100%);
  opacity: 0;
  transition: all var(--transition);
  pointer-events: none;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-height));
}

.mobile-nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.mobile-nav-link:hover { background: var(--bg-surface-2); }
.mobile-nav-link.active { background: var(--brand-primary-light); color: var(--brand-primary); }

.mobile-nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-3) 0;
}

.mobile-nav-actions {
  display: flex;
  gap: var(--space-3);
  padding-top: var(--space-4);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .header-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .btn-login { display: none; }
}

@media (max-width: 640px) {
  .header-inner { padding: 0 var(--space-4); }
  .header-logo-tagline { display: none; }
}
