//// navbar

.navbar {
  flex: 0 0 auto; // fixed height
  background-color: $navbar-background;
  color: #ffffff;
  padding: 1.1rem 4rem 1.1rem 4rem;
  height: 5.5rem;
  position: relative;
  z-index: 1;
  border-bottom: 1px solid $item-border;

  .navbar-elements {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .nav-buttons {
    display: flex;
    align-items: center;

    & > button,
    .group--undo-redo > button {
      // '>' because dropdown may contain other buttons
      @extend .action-button;
      @extend .button-white;
      white-space: nowrap;

      &[name='duplicate'] {
        @extend .button-white--fill;
      }
    }

    & > button,
    & > .group--undo-redo {
      margin-right: 3rem;
    }

    // undo redo buttons
    .group--undo-redo {
      display: flex;

      button {
        font-size: 1.9rem;
        min-width: 0;
        width: 3.5rem;
        height: 3.5rem;
        padding: 0;
        border: 1px solid $white;
        opacity: 0.8;
        &:hover {
          border-color: $white;
          opacity: 1;
        }
      }
      button:first-child {
        margin-right: 1rem;
      }
    }

    & > .dropdown {
      display: inline-block;

      button.context-button {
        color: white;
        &:hover {
          background-color: $light-accent--medium;
        }
      }
    }
  }

  // Brand logo

  .logo {
    display: flex;
    align-items: center;

    img.logo {
      vertical-align: middle;
      margin-right: 0.5rem;
      width: 2.3rem;
    }

    img.logo-text {
      position: relative;
      top: 0;
      width: 12.5rem;
    }
  }

  .workflow-container & .action-link {
    color: white;
    text-decoration: underline;
  }

  .workflow-container & {
    color: white;
  }

  .links {
    @include title-3;
    display: flex;
    align-items: center;
    font-weight: bold;
    letter-spacing: 0.04rem;
    font-size: 1.5rem;
    position: relative;
    left: -7.7rem;
    height: 100%;
    top: 0.8rem;
    cursor: pointer;

    a {
      display: block;
      position: relative; // for '::after' positioning
      color: $brand-text--dark;
      text-decoration: none;
      margin: 0 2rem;
      padding-top: 0.9rem;
      height: 4.5rem;
      &:hover {
        color: $brand-text--dark;
      }

      &::after {
        content: '';
        position: absolute;
        bottom: 3px;
        left: 2px;
        right: 2px;
        height: 4px;
        background-color: $workspace-action;
      }

      &.inactive {
        opacity: 0.7;
        &::after {
          opacity: 0;
          background-color: $brand-learn;
        }

        &:hover {
          opacity: 1;
          &::after {
            opacity: 1;
          }
        }
      }
    }
  }

  //// navbar in WF

  .workflow-container & {
    padding: 0.5rem 2.5rem 0.5rem 1.2rem;
    background-color: $wf-header;
    border-bottom: 0;

    .logo-navbar {
      margin-right: 1.5rem;

      img {
        width: 3.7rem;
        margin-top: 0rem;
      }
    }

    .editable-title--container {
      margin-right: 3.5rem;
      min-width: 90%;
    }
    .title-metadata-stack {
      flex-grow: 1;

      .course {
        @include title-3;
        margin-top: 0.2rem;
        margin-bottom: 0.4rem;

        a {
          color: white;
        }
      }

      .editable-title--field {
        @include title-2;
        position: relative;
        top: 0.1rem;
        min-width: 100%;
        border: none;
        outline: none;
        padding: 0;
        resize: none;
        background: none;
        line-height: 1.8rem;
        color: #ffffff;
        padding-right: 1.5rem;
        text-overflow: ellipsis;

        &:hover {
          background-color: $light-accent--strong;
        }
      }
    }
  }

  ////navbar in lesson

  .workflow-root.in-lesson & {
    button[name='duplicate'] {
      display: none;
    }

    .editable-title--field {
      cursor: default;

      &:hover {
        background-color: transparent; // FIXME The title should no be editable in lesson
      }
    }

    .metadata-container {
      cursor: default;
    }
  }

  //// Readonly signout navbar

  .nav--link {
    @include content-1;
    text-transform: uppercase;
    font-size: 1.4rem;
    cursor: pointer;
    margin-right: 5rem;
    color: $white;

    &:hover {
      text-decoration: underline;
      color: #fff;
    }
  }
}
