@use '../../styles/mixins' as *;

// =============================================================================
// AppNav — full-width navigation bar below the StatusBar
// =============================================================================

.nav {
  @include surface-panel;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;

  @include mobile {
    padding: 0 var(--space-xs);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);
  white-space: nowrap;

  &:hover {
    background: var(--bg-overlay);
    color: var(--text-primary);
  }

  &:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: -2px;
  }

  @include mobile {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    gap: var(--space-xs);
    flex-shrink: 0;
  }
}

.tabIcon {
  font-size: var(--font-size-lg);
  line-height: 1;

  @include mobile {
    font-size: var(--font-size-base);
  }
}

.tabLabel {
  @include mobile {
    // Hide labels on very small screens, show only icons
    @media (max-width: 480px) {
      display: none;
    }
  }
}

.tabActive {
  border-bottom-color: var(--accent-green);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

// Pins this tab (and any after it) to the right edge by absorbing the free
// space to its left. Inert on mobile, where the nav scrolls horizontally.
.tabEnd {
  margin-left: auto;
}
