/* Container for the line animation and optional image */
.line-container {
    display: flex;
    align-items: center;
    margin: 20px 0;
    width: 100%;
    max-width: 600px;
}

/* Wrapper that can be flipped to reverse animation direction */
.line-wrapper {
    width: 100%;
}
.line-wrapper.flip {
    transform: scaleX(-1);
}

/* The animated line */
.line {
    position: relative;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

/* The packet (small colored block) that moves along the line */
.packet {
    position: absolute;
    width: 20px;
    height: 4px;
    border-radius: 2px;
    animation: move-left 3s linear infinite;
}

/* Animation for left-to-right movement */
@keyframes move-left {
    0% {
        left: 0;
    }
    100% {
        left: 100%;
        transform: translateX(-100%);
    }
}

/* Tooltip wrapper: positions the tooltip relative to the image */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 10px;
}

/* Icon styling: the image container */
.icon {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

/* Ensure the image appears circular */
.icon img {
    object-fit: contain;
    border-radius: 50%;
    width: 80%;
    height: 80%;
}

/* Tooltip styling: hidden by default using opacity & visibility */
.tooltip-text {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    background-color: #000;
    color: #fff;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
    white-space: nowrap;
    top: -40px; /* Adjust this value for vertical positioning */
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%; /* Arrow appears at the bottom of the tooltip */
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #000 transparent transparent transparent;
}

/* Show tooltip on hover or when active (for click trigger) */
.tooltip-wrapper:hover .tooltip-text,
.tooltip-wrapper.active .tooltip-text {
    opacity: 1;
    visibility: visible;
}

/* Adjust spacing when the image is positioned on the left */
.image-left .tooltip-wrapper {
    margin-left: 0;
    margin-right: 10px;
}
