@use '@/assets/styles/variables' as *;

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background: $color-surface-card;
  border-right: 1px solid $color-border;
  z-index: $z-sidebar;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease, transform 0.2s ease;

  &--mobile {
    transform: translateX(-100%);
    width: $sidebar-width !important;

    &.app-sidebar--visible {
      transform: translateX(0);
    }
  }

  &--collapsed {
    .app-sidebar__title,
    .app-sidebar__nav .p-panelmenu-header-content span,
    .app-sidebar__nav .p-menuitem-text {
      display: none;
    }
  }

  &__header {
    display: flex;
    align-items: center;
    gap: $space-sm;
    height: $topbar-height;
    padding: 0 $space-md;
    border-bottom: 1px solid $color-border;
  }

  &__logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  &__title {
    font-size: $font-size-lg;
    font-weight: 700;
    color: $color-primary;
    white-space: nowrap;
  }

  &__nav {
    padding: $space-sm 0;
  }

  &__menu .p-panelmenu {
    border: none;
    background: transparent;
  }

  &__menu .p-panelmenu-panel {
    .p-panelmenu-header-content,
    .p-menuitem-content {
      white-space: nowrap;
      overflow: visible;
    }

    .p-panelmenu-content {
      overflow: visible;
    }

    .p-menuitem-text {
      display: inline !important;
    }
  }

  // 모바일에서 서브메뉴 텍스트 표시 보장
  &--mobile &__nav {
    .p-menuitem-text,
    .p-panelmenu-header-content span {
      display: inline !important;
    }
  }
}
