/* QualRank Unified Navigation Styles */

/* Body adjustments for fixed header */
body,
.essentialist-interface {
  padding-top: 60px !important;
}

/* Ensure main content areas don't overlap with fixed header */
.hero-section,
.main-container,
.main,
body .main,
.essentialist-interface .main-container {
  margin-top: 0 !important;
  padding-top: 20px !important;
}

/* Header Section (Fixed, Unified) - High specificity for overrides */
.header,
body .header,
.essentialist-interface .header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 60px !important;
  background: #1a1f26 !important;
  border-bottom: 1px solid #374151 !important;
  z-index: 1000 !important;
  backdrop-filter: blur(10px) !important;
  padding: 0 !important;
}

.header-content,
body .header-content,
.essentialist-interface .header-content {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
  background: transparent !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Ensure proper flex distribution for testing page */
.essentialist-interface .header-content > .logo {
  flex: 0 0 auto !important;
}

.essentialist-interface .header-content > .nav {
  flex: 1 1 auto !important;
  justify-content: center !important;
  margin: 0 20px !important;
}

.essentialist-interface .header-content > .profile-menu {
  flex: 0 0 auto !important;
}

/* Ensure proper flex distribution for leaderboard page and other pages using container */
body .header-content > .logo,
.container .header-content > .logo,
.header .container > .logo {
  flex: 0 0 auto !important;
}

body .header-content > .nav,
.container .header-content > .nav,
.header .container > .nav {
  flex: 1 1 auto !important;
  justify-content: center !important;
  margin: 0 20px !important;
}

body .header-content > .profile-menu,
.container .header-content > .profile-menu,
.header .container > .profile-menu {
  flex: 0 0 auto !important;
}

/* Also ensure container within header has proper styling - override all page-specific container styles */
.header .container,
body .header .container {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  overflow: visible !important;
  display: block !important;
}

/* Logo - High specificity for overrides */
.logo,
body .logo,
.essentialist-interface .logo {
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.logo a,
body .logo a,
.essentialist-interface .logo a {
  display: flex !important;
  align-items: center !important;
  text-decoration: none !important;
  transition: opacity 0.2s ease !important;
  color: inherit !important;
}

.logo a:hover,
body .logo a:hover,
.essentialist-interface .logo a:hover {
  opacity: 0.9 !important;
  color: inherit !important;
  text-decoration: none !important;
}

/* Ensure SVG sizing is consistent */
.logo svg,
body .logo svg,
.essentialist-interface .logo svg {
  width: 120px !important;
  height: 60px !important;
}

/* Navigation Links - High specificity for overrides */
.nav,
body .nav,
.essentialist-interface .nav {
  display: flex !important;
  gap: 32px !important;
  align-items: center !important;
}

.nav-link,
body .nav-link,
.essentialist-interface .nav-link {
  color: #9ca3af !important;
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: 'Sora', sans-serif !important;
  transition: color 0.2s ease !important;
  position: relative !important;
  padding: 8px 0 !important;
}

.nav-link:hover,
.nav-link:focus,
body .nav-link:hover,
body .nav-link:focus,
.essentialist-interface .nav-link:hover,
.essentialist-interface .nav-link:focus {
  color: #ffffff !important;
  text-decoration: none !important;
}

.nav-link-active,
body .nav-link-active,
.essentialist-interface .nav-link-active {
  color: #3b82f6 !important;
}

.nav-link-active::after,
body .nav-link-active::after,
.essentialist-interface .nav-link-active::after {
  content: '' !important;
  position: absolute !important;
  bottom: -16px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 4px !important;
  height: 4px !important;
  background: #3b82f6 !important;
  border-radius: 50% !important;
}

/* Profile Menu - High specificity for overrides */
.profile-menu,
body .profile-menu,
.essentialist-interface .profile-menu {
  position: relative !important;
  flex-shrink: 0 !important;
}

.profile-dropdown,
body .profile-dropdown,
.essentialist-interface .profile-dropdown {
  position: relative !important;
}

.profile-button,
body .profile-button,
.essentialist-interface .profile-button {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: #252b33 !important;
  color: #ffffff !important;
  border: 1px solid #374151 !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: 'Sora', sans-serif !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.profile-button:hover,
body .profile-button:hover,
.essentialist-interface .profile-button:hover {
  background: #1a1f26 !important;
  border-color: #4b5563 !important;
}

.profile-chevron {
  transition: transform 0.2s ease;
  opacity: 0.7;
}

.profile-button:hover .profile-chevron {
  transform: rotate(180deg);
}

/* Profile Dropdown Menu */
.profile-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-primary, #0a0e13);
  border: 1px solid var(--border-primary, #374151);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  overflow: hidden;
}

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

.profile-menu-item {
  display: block;
  padding: 12px 16px;
  color: var(--text-secondary, #9ca3af);
  text-decoration: none;
  font-size: var(--text-sm, 14px);
  font-weight: var(--weight-regular, 400);
  font-family: var(--body-font, 'Sora', sans-serif);
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border-primary, #374151);
}

.profile-menu-item:last-child {
  border-bottom: none;
}

.profile-menu-item:hover {
  background: var(--bg-secondary, #1a1f26);
  color: var(--text-primary, #ffffff);
  text-decoration: none;
}

.profile-menu-divider {
  height: 1px;
  background: var(--border-primary, #374151);
  margin: 4px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header-content {
    padding: 0 var(--space-md, 16px);
  }
  
  .nav {
    display: none; /* Hide main nav on mobile, could be replaced with hamburger menu */
  }
  
  .profile-button {
    padding: var(--space-xs, 4px) var(--space-sm, 8px);
    font-size: 12px;
  }
  
  .profile-menu-dropdown {
    right: 0;
    left: auto;
    min-width: 180px;
  }
}

/* Tablet: 768px - 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
  .nav {
    gap: var(--space-lg, 24px);
  }
  
  .nav-link {
    font-size: 13px;
  }
}

/* Focus Indicators for Accessibility */
.nav-link:focus,
.profile-button:focus,
.profile-menu-item:focus {
  outline: 2px solid var(--accent-primary, #3b82f6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .header {
    border-bottom-width: 2px;
  }
  
  .nav-link-active::after {
    width: 6px;
    height: 6px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .profile-button,
  .profile-chevron,
  .profile-menu-dropdown {
    transition-duration: 0.01ms !important;
  }
}