/* Global Header Styles */
.site-header {
  background: #FFFFFF;
  border-bottom: none;
  position: fixed;
  top: 0;
  left: 56px; /* Start after sidebar corner */
  width: calc(100% - 56px); /* Full width minus sidebar */
  height: 73px;
  z-index: 1100; /* Above sidebar (999) and sidebar corner (1099) */
  padding: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

/* Add padding to body to prevent content from being hidden behind fixed header */
body {
  padding-top: 73px; /* Approx header height */
}

.site-header .container {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem; /* Increased to 32px to match dashboard padding */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

/* Header Layout */
.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-center {
  flex: 0;
  display: none; /* Hidden as search moved to right */
  padding-left: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  margin-left: auto; /* Push to right */
}

.header-right-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Logo Styles */
.site-header .logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1A1A1A;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header .logo img {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 0px rgba(99, 102, 241, 0));
}

.site-header .logo:hover {
  transform: scale(1.05);
}

.site-header .logo:hover img {
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
}

/* Breadcrumb Navigation */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

.header-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 0.9375rem;
  color: #6B7280;
  margin-left: 0.25rem;
}

.breadcrumb-separator {
  color: #9CA3AF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.125rem;
  user-select: none;
}

.breadcrumb-separator svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5;
}

.breadcrumb-item {
  color: #6B7280;
  text-decoration: none;
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  border-radius: 8px;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.breadcrumb-item:hover {
  color: #1F2937;
  background: #F3F4F6;
}

.breadcrumb-item.current {
  color: #111827;
  font-weight: 600;
  background: transparent;
}

/* Mobile breadcrumbs */
@media (max-width: 640px) {
  .header-breadcrumbs {
    display: none;
  }
}

/* Hamburger Button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.hamburger-btn:hover {
  background: #F3F4F6;
}

.hamburger-line {
  width: 18px;
  height: 2px;
  background: #1A1A1A;
  margin: 2px 0;
  transition: all 0.2s ease;
  border-radius: 2px;
}

/* Hamburger Animation */
.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

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

/* Command Palette Trigger (Magnifying Glass) */
.search-container {
  display: flex;
  align-items: center;
}

.command-palette-trigger {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: #666;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.command-palette-trigger:hover {
  background: #F3F4F6;
  color: #1A1A1A;
  transform: scale(1.05);
}

.command-palette-trigger svg {
  width: 20px;
  height: 20px;
}

/* Hide old input if present */
.search-input {
  display: none;
}

.search-icon-wrapper {
  display: none;
}

/* Profile Section */
.profile-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.profile-wrapper:hover {
  background: #F3F4F6;
}

.profile-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #1A1A1A;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #4B5563;
  object-fit: cover;
}

/* Settings Button */
.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #666;
  transition: all 0.2s ease;
  text-decoration: none;
}

.settings-btn:hover {
  background: #F3F4F6;
  color: #1A1A1A;
}

.settings-btn svg {
  width: 20px;
  height: 20px;
}

/* Dropdown Menu */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #FFFFFF;
  border: 1px solid #E6E8EC;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  padding: 0.75rem;
  min-width: 280px;
  max-width: 320px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  margin-top: 0.5rem;
}

.nav-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Category Header */
.nav-category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

/* Navigation Links */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  color: #4B5563;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-link:hover {
  background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
  color: #1A1A1A;
  transform: translateX(2px);
}

.nav-link.current-page {
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
  color: #4F46E5;
  font-weight: 600;
}

/* Sub-links in dropdown */
.nav-sublink {
  padding: 0.65rem 0.75rem;
  margin-left: 0.5rem;
}

/* Navigation Icon */
.nav-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  opacity: 0.8;
}

/* Navigation Link Content */
.nav-link-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.nav-link-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: inherit;
}

.nav-link-desc {
  font-size: 0.75rem;
  color: #9CA3AF;
  line-height: 1.3;
}

.nav-link:hover .nav-link-desc {
  color: #6B7280;
}

/* Divider */
.nav-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
  margin: 0.5rem 0;
}

.nav-divider:last-child {
  display: none;
}
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.profile-avatar.profile-image {
  background: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.profile-link:hover .profile-avatar,
.profile-link:hover .profile-avatar.profile-image {
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.profile-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
  transition: color 0.3s ease;
}

.profile-link:hover .profile-name {
  color: white;
}

/* Settings Icon Styles */
.settings-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  border-radius: 50%;
  margin-left: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 20px;
}

.settings-link:hover {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-link:active {
  transform: translateY(0) scale(0.98);
}

.settings-link svg {
  transition: transform 0.3s ease;
}

.settings-link:hover svg {
  transform: rotate(90deg) scale(1.1);
}

/* Search Bar Styles */
.search-container {
  position: relative;
  width: 100%;
  max-width: 350px;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  padding-right: 3rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.search-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.search-btn svg {
  width: 16px;
  height: 16px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .site-header .container {
    padding: 0 0.75rem;
    gap: 0.75rem;
  }
  
  .header-left {
    gap: 0.75rem;
  }
  
  .header-center {
    max-width: 250px;
  }
  
  .site-header .logo {
    font-size: 1.5rem;
  }
  
  .nav-dropdown {
    left: 0;
    right: auto;
    min-width: 180px;
  }
  
  .search-input {
    padding: 0.5rem 0.875rem;
    padding-right: 2.75rem;
    font-size: 0.85rem;
  }
  
  .search-btn {
    right: 0.375rem;
    padding: 0.375rem;
  }
  
  .search-btn svg {
    width: 14px;
    height: 14px;
  }
  
  .profile-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
  
  .profile-name {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.5rem 0;
  }
  
  .site-header .container {
    padding: 0 0.5rem;
    gap: 0.5rem;
  }
  
  .header-left {
    gap: 0.5rem;
  }
  
  .header-center {
    max-width: 180px;
  }
  
  .site-header .logo {
    font-size: 1.25rem;
  }
  
  .hamburger-btn {
    width: 36px;
    height: 36px;
  }
  
  .hamburger-line {
    width: 20px;
    height: 2px;
  }
  
  .nav-dropdown {
    min-width: 160px;
    left: -0.5rem;
  }
  
  .nav-link {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .search-input {
    padding: 0.45rem 0.75rem;
    padding-right: 2.5rem;
    font-size: 0.8rem;
  }
  
  .search-btn {
    right: 0.25rem;
    padding: 0.25rem;
  }
  
  .search-btn svg {
    width: 12px;
    height: 12px;
  }
  
  .profile-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  
  .profile-name {
    display: none; /* Hide name on very small screens */
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .site-header .logo,
  .site-nav a {
    transition: none;
  }
  
  .site-header .logo:hover {
    transform: none;
  }
  
  .site-nav a:hover {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .site-header {
    background: #000;
    border-bottom: 2px solid #fff;
  }
  
  .site-header .logo,
  .site-nav a {
    color: #fff;
  }
  
  .site-nav a:hover,
  .site-nav a.current {
    background: #fff;
    color: #000;
  }
}

/* Search Result Popup Styles */
.search-result {
  position: fixed;
  top: 100px;
  right: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: calc(100% - 40px);
  z-index: 1000;
  animation: slideInRight 0.3s ease;
}

.search-result-content {
  padding: 0;
}

.search-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px 12px 0 0;
  color: white;
}

.search-result-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.search-result-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.search-result-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.search-result-body {
  padding: 1.5rem;
}

.search-result-body p {
  margin: 0;
  color: #374151;
  line-height: 1.6;
  font-size: 0.95rem;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .search-result {
    top: 80px;
    right: 10px;
    left: 10px;
    width: calc(100% - 20px);
    max-width: none;
  }
}

/* Settings Button Styling */
.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s ease;
  text-decoration: none;
}

.settings-btn:hover {
  opacity: 0.8;
}

.settings-btn svg {
  width: 20px;
  height: 20px;
}

/* AI Chat and Settings buttons */
.ai-chat-toggle-btn,
.settings-btn {
  background: none;
  border: none;
  color: #4B5563;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  padding: 0;
}

.ai-chat-toggle-btn:hover,
.settings-btn:hover {
  background-color: #F3F4F6;
  color: #1A1A1A;
}

.ai-chat-toggle-btn svg,
.settings-btn svg {
  width: 20px;
  height: 20px;
}

/* Header right wrapper */
.header-right-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Profile wrapper */
.profile-wrapper {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-avatar {
  font-size: 1.2rem;
  line-height: 1;
}

.profile-name {
  color: #1A1A1A;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Profile dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  min-width: 150px;
  overflow: hidden;
}

.profile-dropdown a,
.profile-dropdown button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  color: #333;
  text-decoration: none;
  border: none;
  background: none;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.profile-dropdown a:last-child,
.profile-dropdown button:last-child {
  border-bottom: none;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
  background-color: #f5f5f5;
}

.profile-dropdown button#logout-btn {
  color: #ea4335;
}

/* Dark Mode for Command Palette Trigger */
[data-theme="dark"] .command-palette-trigger {
  color: #AAA;
}

[data-theme="dark"] .command-palette-trigger:hover {
  background: #333;
  color: #FFF;
}

