/* Secondary Sticky Header Component */

.secondary-header {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: auto;
  padding-bottom: 12px;
  overflow: visible;
  background: transparent;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When inside the main header (initial state) */
.secondary-header.secondary-inside-header {
  position: absolute;
  bottom: 0;
  transform: translateY(50%);
}

/* When sticky at top (after scrolling) */
.secondary-header.secondary-sticky-top {
  position: fixed;
  top: 9px;
  bottom: auto;
  left: 0;
  right: 0;
  transform: translateY(0);
  z-index: 101; /* Above header */
  padding-bottom: 0;
}

.secondary-header-container {
  display: flex;
  width: max-content;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 9999px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced glassmorphism when sticky */
.secondary-header.secondary-sticky-top .secondary-header-container {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Glassmorphism effect for dark mode */
[data-theme="dark"] .secondary-header-container {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .secondary-header.secondary-sticky-top .secondary-header-container {
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Navigation Item Styles */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

@keyframes slideInNavItem {
  0% {
    opacity: 0;
    transform: translateX(-15px) scale(0.9);
    max-width: 0;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
  }
  70% {
    opacity: 0.8;
    transform: translateX(5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    max-width: 200px;
  }
}

.nav-item.nav-item-animated-show {
  animation: slideInNavItem 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  overflow: hidden;
  white-space: nowrap;
}

/* Hover State */
.nav-item:hover:not(.nav-item-disabled) {
  background: var(--border);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Focus Visible State */
.nav-item:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Active State */
.nav-item.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .nav-item.active {
  box-shadow: 0 2px 8px rgba(129, 140, 248, 0.4);
}

/* Disabled State */
.nav-item-disabled {
  opacity: 0.85;
  cursor: not-allowed !important;
  pointer-events: none;
}

.nav-item-disabled:hover {
  background: transparent;
  color: var(--text-secondary);
  transform: none;
}

/* Active + disabled: keep the active look but suppress hover effects */
.nav-item.active.nav-item-disabled {
  opacity: 1;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Navigation Icon */
.nav-icon {
  font-size: 1.125rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.nav-item:hover:not(.nav-item-disabled) .nav-icon {
  transform: scale(1.1);
}

/* Navigation Label */
.nav-label {
  font-size: 0.95rem;
  transition: opacity 0.3s ease;
}

/* Coming Soon Badge */
.coming-soon-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
  .secondary-header {
    top: 68px; /* Adjusted for smaller header on mobile */
  }

  .secondary-header-container {
    margin-top: 0.75rem;
    padding: 0.375rem 0.75rem;
    gap: 0.375rem;
  }

  /* Hide labels on mobile, keep icons only */
  .nav-label {
    display: none;
  }

  .nav-item {
    padding: 0.5rem;
    min-width: 44px; /* Touch target size */
    justify-content: center;
  }

  .nav-icon {
    font-size: 1.25rem;
  }

  /* Coming soon badge remains visible */
  .coming-soon-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.5rem;
    padding: 0.1rem 0.25rem;
  }
}

/* Extra small devices */
@media (max-width: 480px) {


  .secondary-header-container {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    gap: 0.25rem;
  }

  .nav-item {
    padding: 0.375rem;
    min-width: 40px;
  }

  .nav-icon {
    font-size: 1.125rem;
  }
}

/* Smooth transition for theme changes */
.secondary-header-container,
.nav-item,
.nav-icon,
.nav-label {
  transition-property: background-color, color, border-color, transform, opacity;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .secondary-header-container {
    border-width: 2px;
  }

  .nav-item.active {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .secondary-header,
  .secondary-header-container,
  .nav-item,
  .nav-icon,
  .nav-label,
  .coming-soon-badge {
    transition: none;
    animation: none;
  }
}
