﻿/* Container must be relative so the tooltip positions itself against it */
.tooltip-container {
    position: relative;
    display: inline-block;
}

/* Hide the tooltip box by default */
.tooltip-container .tooltip-box {
    visibility: hidden;
    width: 200px;
    background-color: #f9f9f9;
    text-align: center;
    text-wrap: pretty;
    border-radius: 5px;
    border: 2px solid #ddd;
    padding: 2px;
    position: absolute;
    z-index: 1000;
    bottom: 100%; /* Positions the box above the image */
    left: 50%;
    margin-left: -100px; /* Centers the box */
    opacity: 0;
}

/* Reveal the box and allow interaction when hovering over the container */
.tooltip-container:hover .tooltip-box {
    visibility: visible;
    opacity: 1;
}

/* Tooltip arrow creation */
.tooltip-container .tooltip-box::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    /* The border trick creates the triangle */
    border-width: 6px;
    border-style: solid;
    border-color: #ddd transparent transparent transparent;
}
