$flag: '/images/flag-logo.png';

@mixin flag-icon{
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  @include margin-right(5px);
  top: 1px;
  background: url($flag) no-repeat transparent;
  background-size: 16px auto;
  &.ar {
    background-position: 0 3px;
  }
  &.zh {
    background-position: 0 -12px
  }
  &.en {
    background-position: 0 -28px
  }
  &.de {
    background-position: 0 -44px
  }
  &.id {
    background-position: 0 -62px
  }
  &.pt {
    background-position: 0 -79px
  }
}

.popover {
  @include palette-background-paper;
  width: 200px;
  .v-list {
    border-radius: 0
  }
}

.switch-toggle {
  margin: spacing(-4, 2, 0);
  height: 24px;
  :deep(.v-switch__thumb) {
    color: $palette-secondary-main
  }
  :deep(.v-switch__track) {
    background-color: $palette-secondary-light
  }
  :deep(.v-selection-control) {
    justify-content: center;
  }
}

.flex-menu {
  display: flex;
  align-items: center;
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-100px)
  }
  to {
    opacity: 1;
    transform: none
  }
}

.header.v-app-bar.v-toolbar {
  background-color: transparent;
  @include palette-text-primary;
  z-index: 1007 !important;
  box-shadow: none;
  transition: all 0.3s ease;
  position: fixed;
  padding: spacing(1, 0);
  @include breakpoints-down(md) {
    z-index: 90
  }
  .v-container {
    #main-wrap & {
      @include breakpoints-down(sm) {
        padding: 0
      }
    }
  }
  nav {
    transition: all 0.5s ease-out;
  }
  &.fixed {
    position: fixed;
    top: 0;
    height: auto !important;
    padding: 4px 0;
    @include shadow5;
    @include palette-background-paper;
    .logo {
      a {
        @include palette-text-primary
      }
      img {
        height: 32px;
        width: 32px
      }
    }
    .bar {
      @include breakpoints-down(sm) {
        @include palette-background-text-secondary;
        &:after, &:before {
          @include palette-background-text-secondary;
        }
      }
    }
    nav {
      padding: spacing(1.5, 0);
      ul li a {
        @include palette-text-primary
      }
    }
    :deep(.v-icon) {
      @include palette-text-secondary
    }
  }
  &.open-drawer {
    box-shadow: none !important;
    .logo {
      a {
        @include palette-text-primary
      }
    }
  }
}

.v-toolbar__content, .v-toolbar__extension {
  padding: 0
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  & nav {
    align-items: center;
    padding: $spacing2;
    display: flex;
    @include breakpoints-down(md) {
      padding: spacing(2, 0)
    }
  }
}

.v-application .v-application--wrap .logo {
  a {
    @include breakpoints-down('sm') {
      color: $palette-common-white
    }
  }
}

.logo {
  a {
    text-decoration: none;
    display: flex;
    font-size: 22px;
    align-items: center;
    font-weight: 500;
    color: $palette-common-white;
    @include breakpoints-up('md') {
      @include palette-text-primary;
    }
  }
  img {
    transition: all 0.3s ease;
    max-width: 48px;
    height: 48px;
    width: 48px;
    @include margin-right($spacing1);
  }
}

.nav-logo {
  &.invert {
    .logo a{
      @include palette-text-primary
    }
    .bar {
      @include breakpoints-down(sm) {
        @include palette-background-text-secondary;
        &:after, &:before {
          @include palette-background-text-secondary;
        }
      }
    }
  }
}

.nav-menu {
  > * {
    margin: 0;
    @include breakpoints-up(lg) {
      margin: spacing(0, 1);
    }
  }
  &.invert {
    ul li a {
      transition: all 0.3s ease-out;
      @include palette-text-primary;
    }
    .setting {
      :deep(.v-icon) {
        @include palette-text-primary;
      }
    }
  }
  .scrollactive-nav {
    list-style: none;
    @include padding-left($spacing5);
    li {
      @include breakpoints-up(lg) {
        margin: spacing(0, 2)
      }
      list-style: none;
      position: relative;
      display: inline-block;
      .v-btn  {
        color: $palette-common-white;
        text-transform: capitalize;
        font-size: 18px;
        font-weight: $font-medium;
        background: none !important;
        letter-spacing: 0.2px;
        box-shadow: none;
        position: relative;
        padding: 6px;
        margin: spacing(0, 1);
        margin-top: $spacing1 * 0.5;
        min-width: 0;
        &:before {
          content: '';
          border-bottom: 3px solid #fff;
          width: 0%;
          position: absolute;
          bottom: 0;
          @include left(50%);
          transition: all 0.2s cubic-bezier(0.42, 0.16, 0.21, 0.93);
        }
        &:hover {
          transition: all 0.3s ease-out;
          background: none;
          &:after {
            opacity: 0
          }
          &:before {
            width: 60%;
            @include left(8px);
            border-bottom-color: $palette-primary-light
          }
        }
        &.active {
          &:before {
            border-bottom-color: $palette-primary-light;
            width: 60%;
            @include left(8px);
          }
        }
      }
    }
  }
}

.lang-menu {
  text-transform: capitalize;
  .flag {
    margin: 0;
    & i {
      @include flag-icon;
    }
  }
}

.mode-menu {
  text-transform: capitalize
}

.user-menu {
  & > button {
    margin: 0 $spacing1;
  }
}

.vertical-divider {
  margin: 0 $spacing1;
  border-left: 1px solid;
  @include palette-divider;
  min-height: $spacing3;
  transition: all 0.5s ease-out
}

.setting {
  :deep(.v-icon) {
    font-size: 32px;
    transition: all 0.3s ease;
    color: $palette-common-white;
  }
  .active {
    transform: rotate(30deg)
  }
  @include breakpoints-down(sm) {
    margin: $spacing1
  }
}

.title-menu {
  text-transform: capitalize
}

.v-list-item__content {
  padding: 0
}

paper-nav {
  width: 100%;
  @media (min-width: 680px) {
    width: 300px
  }
}

.mobile-menu {
  margin: spacing(0, 1);
  .bar {
    background-color: $palette-common-white;
    &:after, &:before {
      background-color: $palette-common-white;
    }
  }
  &.is-active {
    .bar {
      @include palette-background-text-secondary;
      &:after, &:before {
        @include palette-background-text-secondary;
      }
    }
  }
}

.mobile-nav {
  @include palette-background-paper;
  z-index: 90;
  min-width: 300px;
  @include breakpoints-down(xs) {
    width: 100% !important
  }
  .menu {
    padding: spacing(0, 2);
    overflow: auto;
    top: spacing(15);
    width: 100%;
    position: absolute;
    height: calc(100% - 80px);
    a {
      @include palette-text-primary
    }
    .menu-list {
      text-transform: capitalize;
      font-size: 24px;
      margin-top: 4px;
      margin-bottom: 4px;
      font-weight: $font-regular;
      padding: spacing(1, 0);
    }
    &.menu-open {
      a {
        animation-name: slideRight;
        animation-timing-function: ease;
      }
    }
  }
}
