@import (reference) "~ui/styles/variables";

.global_nav_logo {
  display: inline-block;

  &:hover {
    background-color: darken(@globalColorBlue, 15%);
  }

  &.active {
    background-color: @globalColorBlue;
  }
}

.global-nav-link {
  position: relative;
  width: @global-nav-closed-width;
  height: @app-icon-height;
  line-height: @app-line-height;

  &.is-global-nav-link-disabled {
    opacity: 0.5;

    .global-nav-link__anchor {
      cursor: default;
    }
  }

  &:hover {
    background-color: darken(@globalColorBlue, 15%);
  }

  &.active {
    background-color: @globalColorBlue;

    .global-nav-link__anchor {
      color: @white;
      text-decoration: none;
    }
  }
}

.is-global-nav-open {
  .global-nav-link {
    width: @global-nav-open-width;
  }
}

  .global-nav-link__anchor {
    display: block;
    height: 100%;
    color: @globalColorWhite;

    &:focus, &:hover {
      color: @globalColorWhite;
    }
  }

  .global-nav-link__icon {
    display: inline-block;
    width: @global-nav-closed-width;
    height: @app-icon-height;
    float: left;
    text-align: center;
    font-size: 1.7em;
  }

    /**
     * This image is used to display the icon.
     */
    .global-nav-link__icon-image {
      height: 18px;
      margin-top: 8px;
    }

    /**
     * This placeholder text gets shown if there is no specified icon.
     */
    .global-nav-link__icon-placeholder {
      line-height: @app-icon-height;
      background-position: center;
      background-size: contain;
      background-repeat: no-repeat;
    }

  .global-nav-link__title {
    display: none;
    width: calc(@global-nav-open-width - @global-nav-closed-width - 3px);
    float: right;
    font-size: 0.9em;
    text-align: left;
    padding-left: 3px;
    padding-right: 3px;
    line-height: @app-icon-height;
    white-space: nowrap;
    max-width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;

    .is-global-nav-open & {
      display: inline-block;
    }
  }

.global-nav-link--close {
  /**
   * 1. Translation accounts for the icon image being slightly off-center.
   */
  .global-nav-link__icon {
    transform: translateX(1px) scaleX(-1); /* 1 */
  }
}
