/* ===== HEADER STYLES ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(from var(--bg) l c h / 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid oklch(from var(--border) l c h / 0.6);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 64px;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  flex-shrink: 0;
}

.logo-img {
  height: 32px;
  width: auto;
}

.search-container {
  flex: 1;
  max-width: 480px;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: var(--text-base);
  color: var(--fg);
  transition: all var(--duration-fast) var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / 0.1);
}

.search-input::placeholder {
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

#guest-nav {
  display: flex;
  gap: var(--space-3);
}

#auth-nav {
  display: none;
  gap: var(--space-3);
  align-items: center;
}

.profile-dropdown {
  position: relative;
}

.profile-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, oklch(from var(--accent) calc(l * 0.9) c calc(h + 20)) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: 700;
  color: white;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all var(--duration-fast) var(--transition);
}

.profile-avatar-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.profile-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: none;
  z-index: 1000;
}

.profile-menu.active {
  display: block;
  animation: menuSlideIn var(--duration-fast) var(--transition);
}

@keyframes menuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-menu-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-2);
}

.profile-menu-username {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--transition);
  text-decoration: none;
}

.profile-menu-item:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.profile-menu-separator {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) 0;
}

/* Guest nav link (Features) */
.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}

.nav-link:hover {
  color: var(--fg);
}

/* Hide search bar by default — shown via JS when logged in */
#header-search {
  display: none;
}

/* Button base (needed on pages that don't load app styles) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 var(--space-4, 16px);
  border-radius: 980px;
  font-size: 14px;
  font-weight: 510;
  font-family: var(--font-sans, -apple-system, sans-serif);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent, oklch(56% 0.18 250));
  color: white;
}

.btn-primary:hover {
  background: oklch(51% 0.18 250);
}

.btn-ghost {
  background: transparent;
  color: var(--fg, oklch(18% 0.012 60));
  border: 1px solid var(--border, oklch(90% 0.006 60));
}

.btn-ghost:hover {
  background: var(--surface, oklch(99.5% 0.004 60));
}
