@import "globals";

/* HEADER */

#branding {
  display: none;
  background-color: $sidebar-contrast-background-color;
  color: $sidebar-contrast-text-color;
  padding: 14px;
  text-align: center;

  &.initialized {
    display: block;
  }

  h1, h2 {
    padding: 0;
    margin: 0;
    text-transform: uppercase;
    font-size: 11px;
  }

  a, a:visited, a:hover {
    color: $sidebar-contrast-text-color;
  }

  a:hover {
    color: $sidebar-hover-action-color;
  }
}

#user-tools {
  display: none;

  &.initialized {
    display: block;
  }
}

.user-tools {
  position: relative;

  ul {
    position: absolute;
    top: $top-height - 12px;
    right: 20px;
    border: 1px solid $top-border-color;
    border-radius: 4px;
    font-size: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    display: inline-block;
    width: 175px;
    z-index: 1;

    @include for-mobile {
      position: fixed;
      top: 0;
      right: 0;
      z-index: 4;
      width: auto;
      color: $sidebar-link-color;
      border: 0;
      border-left: 1px solid $sidebar-contrast-background-color;
      border-radius: 0;
      transform: none;
      transition: transform $transitions-duration;

      body.scroll-to-bottom & {
        transform: translate3d(0, -100%, 0);
      }
    }

    &.opened {
      background-color: $top-dropdown-background-color;
      border-color: transparent;
      color: $top-dropdown-text-color;

      @include for-mobile {
        border-radius: 0 0 0 4px;
        border: 0;
      }
    }

    li {
      display: block;
      list-style-type: none;
      margin: 0;
      padding: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    li.user-tools-welcome-msg {
      font-weight: bold;
      padding: 0 10px 0 14px;
      line-height: 30px;

      @include for-mobile {
        padding-left: 18px;
        line-height: $sidebar-header-height;
      }

      &:after {
        @include font-icon;
        content: $icon-arrow-down;
        font-weight: normal;
        float: right;
        color: #47bac1;
        font-size: 24px;
        vertical-align: middle;
        line-height: 30px;
        transition: color $transitions-duration;
        margin-left: 5px;

        @include for-mobile {
          line-height: $sidebar-header-height;
          font-size: 20px;
          font-weight: bold;
        }
      }
    }

    &.opened .user-tools-welcome-msg {
      border-bottom: 1px solid $top-dropdown-border-color;

      &:after {
        color: $top-dropdown-icon-color;
        transform: rotate(180deg);
      }
    }

    li.user-tools-link {
      display: none;

      a, a:visited, a:hover {
        display: block;
        line-height: 30px;
        padding: 0 14px;
        color: $top-dropdown-link-color;
        text-decoration: none;

        @include for-mobile {
          line-height: $sidebar-header-height;
        }
      }

      a:hover {
        color: $top-dropdown-hover-link-color;
        text-decoration: underline;
      }
    }

    &.opened li.user-tools-link {
      display: block;
    }
  }
}
