/* static/css/components/header.css */

/* —— Header wrapper —— */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--neutral-950); /* Fixed: was var(--color-bg) which doesn't exist */
  padding: var(--space-2) var(--space-16);
  border-bottom: 1px solid var(--neutral-700);
  margin-bottom: 0;
}

/* —— Logo —— */
.site-header .logo img {
  height: 3.125rem;           /* 50px */
  padding: var(--space-2) 0;   /* 16px top/bottom */
}

/* —— Nav —— */
.nav-bar {
  margin-left: auto;
  margin-right: var(--space-4); /* 16px */
  padding-top: var(--space-1);   /* 4px */
}
.nav-bar ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-bar li {
  margin-right: var(--space-6); /* 24px */
}
.nav-bar a {
  color: var(--neutral-50);
  text-decoration: none;
  font-size: 1.125rem;            /* 18px */
  font-family: var(--font-body);
}
.nav-bar a:hover {
  text-decoration: underline;
  color: var(--primary-500); /* Changed from neutral-900 for better contrast */
}

/* —— User actions (desktop only) —— */
.user-actions {
  margin-left: var(--space-4);
}

/* —— User icon (handles both img and svg) —— */
.user-icon {
  height: 2rem;        
  width: 2rem;         
  vertical-align: middle;
  padding-bottom: var(--space-1); /* 4px */
  border-radius: 50%;     /* Make images circular */
  object-fit: cover;      /* For images */
  color: var(--neutral-50); /* For SVG fallback */
  transition: opacity 0.2s ease;
}

/* —— User icon (handles both img and svg) —— */
.user-svg {
  height: 1.75rem;        
  width: 1.75rem;         
  vertical-align: middle;
  padding-bottom: var(--space-1); /* 4px */
  border-radius: 50%;     /* Make images circular */
  object-fit: cover;      /* For images */
  color: var(--neutral-50); /* For SVG fallback */
  transition: opacity 0.2s ease;
}

.user-icon:hover {
  opacity: 0.8;
}

/* Ensure SVG fills the container properly */
svg.user-icon {
  display: block;
}

/* ——————————————————————————————————————————————
   MOBILE-ONLY STYLES (max-width: 767px)
   —————————————————————————————————————————————— */

/* Mobile menu toggle - hidden on desktop */
.mobile-menu-toggle {
  display: none;
}

/* Mobile overlay - hidden on desktop */
.mobile-menu-overlay {
  display: none;
}

@media (max-width: 767px) {
  /* Adjust header for mobile */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    padding: var(--space-2) var(--space-4);
    height: 60px;
    background-color: var(--neutral-950); /* Ensure solid background on mobile */
    backdrop-filter: none; /* Remove any blur effects */
  }
  
  /* Smaller logo on mobile */
  .site-header .logo img {
    height: 2.5rem; /* 40px */
    padding: var(--space-1) 0;
  }
  
  /* Mobile menu toggle button */
  .mobile-menu-toggle {
    display: block;
    position: relative;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto; /* Push to right side */
    order: 2; /* Ensure it's after logo */
  }
  
  .hamburger-line {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--neutral-50);
    margin: 6px auto;
    transition: all 0.3s ease;
    transform-origin: center;
  }
  
  /* Hamburger animation */
  .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  /* Mobile navigation drawer */
  .nav-bar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background-color: var(--neutral-900);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 998;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin: 0;
    padding: 0;
    overflow-y: auto;
  }
  
  .nav-bar.active {
    transform: translateX(0);
  }
  
  .nav-bar ul {
    flex-direction: column;
    padding: var(--space-4) 0;
  }
  
  .nav-bar li {
    margin: 0;
    border-bottom: 1px solid var(--neutral-800);
  }
  
  .nav-bar li:last-child {
    border-bottom: none;
  }
  
  .nav-bar a {
    display: block;
    padding: var(--space-4) var(--space-6);
    font-size: var(--space-4);
    color: var(--neutral-50);
  }
  
  .nav-bar a:hover,
  .nav-bar a:active {
    background-color: var(--neutral-800);
    text-decoration: none;
    color: var(--neutral-50);
  }
  
  /* Hide user actions on mobile */
  .user-actions {
    display: none;
  }
  
  /* Mobile menu overlay */
  .mobile-menu-overlay {
    display: block;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 997;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  
  .mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}