@use 'ui-design-system/src/styles/semantic/index' as *;

.ui-bottom-navigation {
  // Core Structure
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: $semantic-z-index-dropdown;
  align-items: center;
  justify-content: space-around;
  
  // Layout & Spacing
  padding: $semantic-spacing-component-sm;
  min-height: $semantic-sizing-touch-target;
  
  // Visual Design
  background: $semantic-color-surface-primary;
  border-top: $semantic-border-width-1 solid $semantic-color-border-primary;
  box-shadow: $semantic-shadow-elevation-3;
  
  // Transitions
  transition: all $semantic-motion-duration-fast $semantic-motion-easing-ease;
  
  // Size Variants
  &--sm {
    min-height: $semantic-sizing-button-height-sm;
    padding: $semantic-spacing-component-xs;
  }
  
  &--md {
    min-height: $semantic-sizing-touch-target;
    padding: $semantic-spacing-component-sm;
  }
  
  &--lg {
    min-height: $semantic-sizing-button-height-lg;
    padding: $semantic-spacing-component-md;
  }
  
  // Variant Styles
  &--primary {
    background: $semantic-color-primary;
    border-top-color: $semantic-color-primary;
    color: $semantic-color-on-primary;
    
    .ui-bottom-navigation__item {
      color: $semantic-color-on-primary;
      
      &--active {
        background: rgba(255, 255, 255, 0.1);
      }
      
      &:hover:not(&--active) {
        background: rgba(255, 255, 255, 0.05);
      }
    }
  }
  
  &--secondary {
    background: $semantic-color-secondary;
    border-top-color: $semantic-color-secondary;
    color: $semantic-color-on-secondary;
    
    .ui-bottom-navigation__item {
      color: $semantic-color-on-secondary;
      
      &--active {
        background: rgba(255, 255, 255, 0.1);
      }
      
      &:hover:not(&--active) {
        background: rgba(255, 255, 255, 0.05);
      }
    }
  }
  
  // Elevated variant
  &--elevated {
    box-shadow: $semantic-shadow-elevation-4;
  }
  
  // Hidden variant for dynamic showing/hiding
  &--hidden {
    transform: translateY(100%);
  }
  
  // BEM Element - Navigation Item
  &__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: $semantic-sizing-touch-minimum;
    min-height: $semantic-sizing-touch-minimum;
    padding: $semantic-spacing-component-xs;
    border-radius: $semantic-border-radius-sm;
    cursor: pointer;
    text-decoration: none;
    color: $semantic-color-text-secondary;
    
    // Typography
    font-family: map-get($semantic-typography-caption, font-family);
    font-size: map-get($semantic-typography-caption, font-size);
    font-weight: map-get($semantic-typography-caption, font-weight);
    line-height: map-get($semantic-typography-caption, line-height);
    
    // Transitions
    transition: all $semantic-motion-duration-fast $semantic-motion-easing-ease;
    
    // Interactive States
    &:hover:not(&--disabled):not(&--active) {
      background: $semantic-color-surface-elevated;
      color: $semantic-color-text-primary;
    }
    
    &:focus-visible {
      outline: 2px solid $semantic-color-focus;
      outline-offset: 2px;
    }
    
    &:active:not(&--disabled) {
      transform: scale(0.98);
    }
    
    // Active State
    &--active {
      background: $semantic-color-interactive-primary;
      color: $semantic-color-primary;
      font-weight: $semantic-typography-font-weight-semibold;
    }
    
    // Disabled State
    &--disabled {
      opacity: $semantic-opacity-disabled;
      cursor: not-allowed;
      pointer-events: none;
    }
    
    // Badge modifier
    &--has-badge {
      position: relative;
    }
  }
  
  // BEM Element - Icon
  &__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: $semantic-sizing-icon-navigation;
    height: $semantic-sizing-icon-navigation;
    margin-bottom: $semantic-spacing-content-line-tight;
    
    // Icon sizing variants
    .ui-bottom-navigation--sm & {
      width: $semantic-sizing-icon-inline;
      height: $semantic-sizing-icon-inline;
    }
    
    .ui-bottom-navigation--lg & {
      width: $semantic-sizing-icon-button;
      height: $semantic-sizing-icon-button;
    }
  }
  
  // BEM Element - Label
  &__label {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    
    // Typography variants by size
    .ui-bottom-navigation--sm & {
      font-family: map-get($semantic-typography-body-small, font-family);
      font-size: map-get($semantic-typography-body-small, font-size);
      font-weight: map-get($semantic-typography-body-small, font-weight);
      line-height: map-get($semantic-typography-body-small, line-height);
    }
    
    .ui-bottom-navigation--lg & {
      font-family: map-get($semantic-typography-body-medium, font-family);
      font-size: map-get($semantic-typography-body-medium, font-size);
      font-weight: map-get($semantic-typography-body-medium, font-weight);
      line-height: map-get($semantic-typography-body-medium, line-height);
    }
  }
  
  // BEM Element - Badge
  &__badge {
    position: absolute;
    top: -$semantic-spacing-component-xs;
    right: -$semantic-spacing-component-xs;
    min-width: $semantic-sizing-icon-inline;
    height: $semantic-sizing-icon-inline;
    display: flex;
    align-items: center;
    justify-content: center;
    background: $semantic-color-danger;
    color: $semantic-color-on-danger;
    border-radius: $semantic-border-radius-full;
    padding: 0 $semantic-spacing-component-xs;
    
    // Typography
    font-family: map-get($semantic-typography-caption, font-family);
    font-size: map-get($semantic-typography-caption, font-size);
    font-weight: $semantic-typography-font-weight-semibold;
    line-height: map-get($semantic-typography-caption, line-height);
    
    // Hide if no content
    &:empty {
      min-width: 8px;
      height: 8px;
      padding: 0;
    }
  }
  
  // Responsive Design
  @media (max-width: $semantic-breakpoint-sm - 1) {
    padding: $semantic-spacing-component-xs;
    
    .ui-bottom-navigation__item {
      padding: $semantic-spacing-component-xs * 0.5;
    }
    
    .ui-bottom-navigation__label {
      font-family: map-get($semantic-typography-body-small, font-family);
      font-size: map-get($semantic-typography-body-small, font-size);
      font-weight: map-get($semantic-typography-body-small, font-weight);
      line-height: map-get($semantic-typography-body-small, line-height);
    }
  }
  
  @media (max-width: $semantic-breakpoint-md - 1) {
    // Ensure touch targets remain accessible on tablets
    .ui-bottom-navigation__item {
      min-height: $semantic-sizing-touch-target;
    }
  }
}