// User toolbar (login, logout...)
// (specific to this architecture)

$user-toolbar-color: $user-toolbar-color;
$user-toolbar-dropdown-background-color: $user-toolbar-dropdown-background-color;
$user-toolbar-dropdown-shadow: $user-toolbar-dropdown-shadow;
$user-toolbar-popup-background-color: $user-toolbar-popup-background-color;

.user-toolbar {
  color: $user-toolbar-color;
  font-size: 16px;
  position: relative;
  display: inline-block;
  z-index: 9992;
}

.user-toolbar-username {
  @include flex;
  flex-direction: row;
  align-items: center;
  height: 45px;
  max-height: 100%;
}

.user-toolbar .fa {
  margin: auto 5px;
}

.user-toolbar a {
  text-decoration: none;
  color: $user-toolbar-color;
}

// ## Usermenu dropdown

.user-toolbar ul {
  list-style: none;
}

.user-toolbar .dropdown-menu {
  min-width: 240px;
  background-color: $user-toolbar-dropdown-background-color;
  @if $user-toolbar-dropdown-shadow {
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
  }
  right: 0;

  li {
    height: 3.5em;
    @include flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
  }

  li:hover {
    background-color: darken($user-toolbar-dropdown-background-color, 20%);
  }

  a {
    width: 100%;
    padding: 12px 16px;
  }

}

.user-toolbar .dropside-menu {
  background-color: $user-toolbar-popup-background-color;
  @if $user-toolbar-dropdown-shadow {
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
  }
}

// ## Login Pop-Up

#login-popup {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

/* The actual popup */
#login-popup .popup-form {
  visibility: hidden;
  width: 240px;
  background-color: $user-toolbar-popup-background-color;
  border-radius: 4px;
  padding: 1em 1.6em;
  position: absolute;
  right: 0;
  top: 1em;
}

/* Toggle this class when clicking on the popup container (hide and show the popup) */
#login-popup .show {
  visibility: visible;
}

#login-popup .popup-form {
  @include flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
#login-popup .popup-form > input {
  margin: 0.6em;
}

/* Error messages */

.login-errormsg {
  text-align: center;
}
