/* Shared Header Styles */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: nowrap;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-primary);
}

.logo-cluster {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.logo-cluster:hover {
  opacity: 0.85;
}

.logo-symbol {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(236, 72, 153, 0.75));
  color: white;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.logo-symbol::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  opacity: 0.5;
}

.logo-title {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0;
}

.logo-subtitle {
  color: var(--text-tertiary);
  font-size: 0.92rem;
  margin: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.nav-link--accent {
  border-color: var(--border-tertiary);
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
}

/* User Menu & Avatar */
.user-menu-container {
  position: relative;
  margin-left: 0.5rem;
}

.user-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: 2px solid var(--border-secondary);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.user-avatar-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.user-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-secondary);
  margin: 0.5rem 0;
}

/* Theme switch wrapper */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
}

.theme-switch {
  display: inline-block;
  height: 24px;
  position: relative;
  width: 48px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: var(--border-primary);
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
}

.slider:before {
  background-color: var(--text-primary);
  bottom: 3px;
  content: "";
  height: 18px;
  left: 3px;
  position: absolute;
  transition: .4s;
  width: 18px;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent-primary);
}

input:checked+.slider:before {
  transform: translateX(24px);
  background-color: white;
}

/* ==========================================================================
   Mobile Menu Toggle (Hamburger)
   ========================================================================== */

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border-secondary);
  border-radius: 10px;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

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

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

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

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

/* ==========================================================================
   Mobile Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 1rem;
    position: relative;
  }

  .logo-cluster {
    gap: 0.6rem;
  }

  .logo-symbol {
    width: 42px;
    height: 42px;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .logo-title {
    font-size: 1rem;
  }

  .logo-subtitle {
    font-size: 0.75rem;
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-primary);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 5rem 1.5rem 2rem;
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
  }

  .nav-links.mobile-open {
    right: 0;
  }

  .nav-link {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border-radius: 12px;
    border: none;
    text-align: left;
  }

  .nav-link:hover {
    background: var(--bg-tertiary);
    border: none;
  }

  .nav-link--accent {
    background: rgba(99, 102, 241, 0.15);
    border: none;
  }

  .user-menu-container {
    margin-left: 0;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
  }

  .user-avatar-btn {
    width: 100%;
    height: auto;
    border-radius: 12px;
    padding: 1rem;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .user-avatar-btn .user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
  }

  .user-avatar-btn::after {
    content: 'Account';
    font-weight: 500;
  }

  .user-dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    background: var(--bg-secondary);
    margin-top: 0.5rem;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }

  .user-dropdown-menu.active {
    display: block;
  }

  /* Body scroll lock when menu is open */
  body.mobile-menu-open {
    overflow: hidden;
  }

  /* Mobile menu overlay */
  body.mobile-menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.5rem 0.75rem;
  }

  .logo-symbol {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }

  .logo-title {
    font-size: 0.9rem;
  }

  .nav-links {
    width: 100%;
    right: -100%;
  }
}