/*
CSS-only tooltip
================
How to use:
1. Add the class `simple-tooltip` to the element that you want to have a tooltip.
2. Add the class `simple-tooltip_text` to the element that will contain the tooltip text.

<div class="simple-tooltip">
  Hover over me
  <span class="simple-tooltip_text">Tooltip text</span>
</div>

Position the tooltip text:
- Top: Add the class `simple-tooltip--top` to the element that contains the tooltip text.
- Bottom: Add the class `simple-tooltip--bottom` to the element that contains the tooltip text.
- Left: Add the class `simple-tooltip--left` to the element that contains the tooltip text.
- Right: Add the class `simple-tooltip--right` to the element that contains the tooltip text.

*/

.simple-tooltip,
.simple-tooltip--top,
.simple-tooltip--bottom,
.simple-tooltip--left,
.simple-tooltip--right {
  position: relative;
  display: inline-block;
}

/* Tooltip text */
.simple-tooltip_text {
  visibility: hidden;
  width: 120px;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;

  /* Position the tooltip text - see examples below! */
  position: absolute;
  z-index: 1;
}

/* Show the tooltip text when you mouse over the tooltip container */
.simple-tooltip:hover .simple-tooltip_text,
.simple-tooltip--top:hover .simple-tooltip_text,
.simple-tooltip--bottom:hover .simple-tooltip_text,
.simple-tooltip--left:hover .simple-tooltip_text,
.simple-tooltip--right:hover .simple-tooltip_text {
  visibility: visible;
}

.simple-tooltip .simple-tooltip_text,
.simple-tooltip--top .simple-tooltip_text {
  width: 120px;
  bottom: 100%;
  left: 50%;
  margin-left: -60px; /* Use half of the width (120/2 = 60), to center the tooltip */
}

.simple-tooltip--bottom .simple-tooltip_text {
  width: 120px;
  top: 100%;
  left: 50%;
  margin-left: -60px; /* Use half of the width (120/2 = 60), to center the tooltip */
}

.simple-tooltip--left .simple-tooltip_text {
  width: 120px;
  top: 50%;
  right: 100%;
  margin-top: -60px; /* Use half of the height (120/2 = 60), to center the tooltip */
}

.simple-tooltip--right .simple-tooltip_text {
  width: 120px;
  top: 50%;
  left: 100%;
  margin-top: -60px; /* Use half of the height (120/2 = 60), to center the tooltip */
}

.simple-tooltip .simple-tooltip_text::after,
.simple-tooltip--top .simple-tooltip_text::after {
  content: " ";
  position: absolute;
  top: 100%; /* At the bottom of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: black transparent transparent transparent;
}

.simple-tooltip--bottom .simple-tooltip_text::after {
  content: " ";
  position: absolute;
  bottom: 100%; /* At the bottom of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent black transparent;
}

.simple-tooltip--left .simple-tooltip_text::after {
  content: " ";
  position: absolute;
  top: 50%;
  right: 100%; /* At the right of the tooltip */
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent transparent black;
}

.simple-tooltip--right .simple-tooltip_text::after {
  content: " ";
  position: absolute;
  top: 50%;
  left: 100%; /* At the right of the tooltip */
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent black transparent transparent;
}
