@import '../bootstrap'
@import '../theme'

/* Theme */
toolbar($material)
  background-color: $material.app-bar
  color: $material.text.primary

theme(toolbar, "vf-toolbar")

.vf-toolbar
  position: relative
  transition: .2s $transition.fast-out-slow-in
  width: 100%
  will-change: padding-left
  elevation(4)

  .vf-input-group--solo
    .vf-input-group__details
      display: none
      
  .vf-input-group--single-line:not(.vf-input-group--solo)
    padding: 0

    label
      top: auto

/** Children */
.vf-toolbar
  &__title
    font-size: $headings.h6.size
    font-weight: $headings.h6.weight
    letter-spacing: $headings.h6.letter-spacing
    margin-left: 16px
    white-space: nowrap
    overflow: hidden
    text-overflow: ellipsis

  &__content, &__extension
    align-items: center
    display: flex

    > .vf-list
      flex: 1 1 auto
      margin: 0 !important // come back to this
      max-height: 100%

    > .vf-btn:last-child, > .vf-menu:first-child
      margin-right: 8px

    > .vf-btn:first-child, > .vf-menu:first-child
      margin-left: 8px

    > *:not(.vf-btn):not(.vf-menu):first-child
      margin-left: $grid-gutters.lg

    > *:not(.vf-btn):not(.vf-menu):last-child
      margin-right: $grid-gutters.lg

  &__items
    display: flex
    height: 100%
    max-width: 100%
    padding: 0
    
    .vf-menu
      height: 100%

    > .vf-menu .vf-menu__activator
      height: 100%

      .vf-btn
        height: 100%
        margin: 0

    > .vf-btn
      height: 100%
      margin: 0

  @media $display-breakpoints.xs-only
    .vf-toolbar__content,
    .vf-toolbar__extension
      > .vf-btn:last-child
        margin-right: 17px

      > .vf-btn:first-child
        margin-left: 17px

      > *:not(.vf-btn):not(.vf-menu):first-child
        margin-left: $grid-gutters.xl

      > *:not(.vf-btn):not(.vf-menu):last-child
        margin-right: $grid-gutters.xl

  @media all and (max-width: $grid-breakpoints.sm) and (orientation: portrait)
    toolbar-content(7px)

/** Types */
.vf-toolbar
  &--card
    border-radius: $card-border-radius $card-border-radius 0 0
    elevation(0)

  &--fixed
    position: fixed
    z-index: 2

  &--fixed, &--absolute
    top: 0
    left: 0

  &--absolute
    position: absolute
    z-index 2

  &--floating
    display: inline-flex
    margin: 16px
    width: auto
  
  &--clipped
    z-index: 3

  &--prominent
    toolbar-content(15px)

  &--dense
    toolbar-content(7px)

.vf-toolbar__extension
  .vf-toolbar__title
    margin-left: 72px !important

  .vf-tabs__bar
    align-self: flex-end
    margin: 0

toolbar-content(left)
  .vf-toolbar__content,
  .vf-toolbar__extension
    > *:first-child
      margin-left: left

    > *:last-child
      margin-right: left
