/** tooltip styles
  * based on http://www.flatypo.net/tutorials/how-to-create-animated-tooltips-css3-hiperlink/ 
 **/
a.tooltipe{
  position: relative;
  display: inline;
}
a.tooltipe:after{
  display: block;
  visibility: hidden;
  position: absolute;
  bottom: 0;
  left: 20%;
  opacity: 0;
  content: attr(data-tool); /* might also use attr(title) */
  height: auto;
  min-width: 400px;
  padding: 5px 8px;
  z-index: 999;
  color: #fff;
  text-decoration: none;
  text-align: center;
  background: rgba(0,0,0,0.85);
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
}

a.tooltipe:before {
  position: absolute;
  visibility: hidden;
  width: 0;
  height: 0;
  left: 50%;
  bottom: 0px;
  opacity: 0;
  content: "";
  border-style: solid;
  border-width: 6px 6px 0 6px;
  border-color: rgba(0,0,0,0.85) transparent transparent transparent;
}
a.tooltipe:hover:after{ visibility: visible; opacity: 1; bottom: 20px; }
a.tooltipe:hover:before{ visibility: visible; opacity: 1; bottom: 14px; }

a.tooltipe.animate:after, a.tooltipe.animate:before {
  -webkit-transition: all 0.2s ease-in-out;
  -moz-transition: all 0.2s ease-in-out;
  -ms-transition: all 0.2s ease-in-out;
  -o-transition: all 0.2s ease-in-out;
  transition: all 0.2s ease-in-out;
}


/* tips on bottom */
a.tooltipe.bottom:after { bottom: auto; top: 0; }
a.tooltipe.bottom:hover:after { top: 28px; }
a.tooltipe.bottom:before {
  border-width: 0 5px 8.7px 5px;
  border-color: transparent transparent rgba(0,0,0,0.85) transparent;
  top: 0px
}
a.tooltipe.bottom:hover:before { top: 20px; }


/* tips on the right */
a.tooltipe.right:after { left: 100%; bottom: -45%; }
a.tooltipe.right:hover:after { left: 110%; bottom: -45%; }
a.tooltipe.right:before {
  border-width: 5px 10px 5px 0;
  border-color: transparent rgba(0,0,0,0.85) transparent transparent;
  left: 90%;
  bottom: 2%;
}
a.tooltipe.right:hover:before { left: 100%; bottom: 2%; }


/* tips on the left */
a.tooltipe.left:after { left: auto; right: 100%; bottom: -45%; }
a.tooltipe.left:hover:after { right: 110%; bottom: -45%; }
a.tooltipe.left:before {
  border-width: 5px 0 5px 10px;
  border-color: transparent transparent transparent rgba(0,0,0,0.85);
  left: auto;
  right: 90%;
  bottom: 2%;
}
a.tooltipe.left:hover:before { right: 100%; bottom: 2%; }


/* tooltip colors (add your own!) */
a.tooltipe.blue:after { background:#5f87c2; }
a.tooltipe.blue:before { border-color: #5f87c2 transparent transparent transparent; }
a.tooltipe.bottom.blue:before{ border-color: transparent transparent #5f87c2 transparent; }
a.tooltipe.right.blue:before { border-color: transparent #5f87c2 transparent transparent; }
a.tooltipe.left.blue:before { border-color: transparent transparent transparent #5f87c2; }



/* input field tooltips */
input + .fieldtip {
  visibility: hidden;
  position: relative;
  bottom: 0;
  left: 15px;
  opacity: 0;
  content: attr(data-tool);
  height: auto;
  min-width: 100px;
  padding: 5px 8px;
  z-index: 9999;
  color: #fff;
  font-size: 1.2em;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  background: rgba(0,0,0,0.85);
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  -webkit-transition: all 0.2s ease-in-out;
  -moz-transition: all 0.2s ease-in-out;
  -ms-transition: all 0.2s ease-in-out;
  -o-transition: all 0.2s ease-in-out;
  transition: all 0.2s ease-in-out;
}

input + .fieldtip:after {
  display: block;
  position: absolute;
  visibility: hidden;
  content:'';
  width: 0;
  height: 0;
  top: 8px;
  left: -8px;
  border-style: solid;
  border-width: 4px 8px 4px 0;
  border-color: transparent rgba(0,0,0,0.75) transparent transparent;
  -webkit-transition: all 0.2s ease-in-out;
  -moz-transition: all 0.2s ease-in-out;
  -ms-transition: all 0.2s ease-in-out;
  -o-transition: all 0.2s ease-in-out;
  transition: all 0.2s ease-in-out;
}

input:focus + .fieldtip, input:focus + .fieldtip:after {
  visibility: visible;
  opacity: 1;
}