/* Copyright 2025-2026 Renofy Ltd. All rights reserved. */
/* ===== NAVIGATION COMPONENT ===== */

/* Mobile-first approach: Start with mobile styles, then enhance for desktop */

/* === BASE NAVIGATION STYLES === */

/* Base Navigation */
.nav {
  display: flex;
  gap: 0.5rem;
  z-index: var(--z-index-header);
}

/* Mobile Navigation */
.nav--mobile {
  width: 100%;
}

.nav__button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  text-decoration: none;
  color: var(--color-text-secondary);
  border-radius: var(--radius-base);
  transition: color var(--transition-fast);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  min-width: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.nav__button--mobile {
  flex-direction: column;
  gap: 0.25rem;
}

.nav__button--mobile svg {
  flex-shrink: 0;
  margin-bottom: 2px;
  /* Force GPU layer to prevent jitter during scroll */
  transform: translateZ(0);
  will-change: transform;
}

.nav__button--mobile span:not(.nav__icon-wrapper) {
  white-space: nowrap;
  overflow-x: clip;
  overflow-y: visible;
  text-overflow: ellipsis;
  max-width: 100%;
  font-size: var(--font-size-xs);
}

.nav__button--active {
  color: var(--color-pink);
}

/* Highlighted nav button - pink with subtle pulse to draw attention */
/* TODO: Pulsating highlight is just for MVP (where main usp is requesting a job spec) - remove the highlighting later */
.nav__button--highlight {
  color: var(--color-pink);
  animation: nav-pulse 2s ease-in-out infinite;
}

.nav__button--highlight.nav__button--active {
  animation: none;
}

@keyframes nav-pulse {
  0%, 100% { color: var(--color-text-secondary); }
  40%, 60% { color: var(--color-pink); }
}

/* Icon wrapper for badge positioning */
.nav__icon-wrapper {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  overflow: visible;
}

/* Desktop styles */
@media (min-width: 821px) {

  .nav:not(.nav--mobile) {
    gap: 1rem;
    padding: 1rem;
    margin-top: -1rem;
    border-radius: var(--radius-lg);
    isolation: isolate;
  }

  .nav__button:not(.nav__button--mobile) {
    flex: 1;
    padding: 0.5rem 1rem;
    justify-content: center;
    gap: 0.45rem;
    background: var(--color-bg-light);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    will-change: transform;
  }

  .nav__button:not(.nav__button--mobile):hover,
  .nav__button:not(.nav__button--mobile):focus {
    background: var(--color-white);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
  }

  .nav__button--active:not(.nav__button--mobile) {
    background: var(--color-white);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .nav__button--highlight:not(.nav__button--mobile) {
    color: var(--color-pink);
    border-color: var(--color-pink);
    animation: nav-pulse-desktop 2s ease-in-out infinite;
  }

  .nav__button--highlight.nav__button--active:not(.nav__button--mobile) {
    animation: none;
  }

  @keyframes nav-pulse-desktop {
    0%, 100% { color: var(--color-text-primary); border-color: var(--color-border); box-shadow: none; }
    40%, 60% { color: var(--color-pink); border-color: var(--color-pink); box-shadow: 0 0 12px 2px rgba(255, 0, 128, 0.15); }
  }

  /* Ensure active buttons still respond to hover */
  .nav__button--active:not(.nav__button--mobile):hover,
  .nav__button--active:not(.nav__button--mobile):focus {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
  }
}
