/*.RCB {
    &-tooltip {
        display: inline-block;
        position: relative;

        .RCB-tooltip-body {
            &.RCB-tooltip-hover {
                display: inline-block;
            }
        
            &.RCB-tooltip-click {
                display: inline-block;
            }
        }
    }

    &-tooltip-body {
        display: none;
        position: absolute;
        z-index: 1;

        &.RCB-tooltip-right {
            top: -10px;
            &:before {
                content: " ";
                width: 0;
                height: 0;
                border-top: 10px solid transparent;
                border-bottom: 10px solid transparent;
                border-right: 10px solid #ffffff;
                position: absolute;
                left: -10px;
                filter: drop-shadow(-1px 3px 1px #e5e7e8);
            }
        }
    
        &.RCB-tooltip-left {
            right: 34px;
            top: -14px;
    
            &:after {
                content: " ";
                width: 0;
                height: 0;
                border-top: 10px solid transparent;
                border-bottom: 10px solid transparent;
                border-left: 10px solid #ffffff;
                position: absolute;
                right: -10px;
                top: 16px;
                filter: drop-shadow(2px 2px 1px #e5e7e8);
            }
        }
    
        &.RCB-tooltip-top {
    
            &:after {
                content: " ";
                width: 0;
                height: 0;
                border-top: 10px solid #ffffff;
                border-right: 10px solid transparent;
                border-left: 10px solid transparent;
                position: absolute;
                top: 100%;
                left: 50%;
                filter: drop-shadow(0px 1px 1px #e5e7e8);
            }
        }
    
        &.RCB-tooltip-bottom {
            top: 150%;
            left: -125px;

            &:after {
                content: " ";
                width: 0;
                height: 0;
                border-left: 10px solid transparent;
                border-bottom: 10px solid #ffffff;
                border-right: 10px solid transparent;
                position: absolute;
                bottom: 100%;
                left: 50%;
                filter: drop-shadow(0px -1px 1px #e5e7e8);
            }
        }
    }
}


.demo-tooltip {
    .RCB-tooltip-body {
        min-width: 235px;
    }
    .RCB-tooltip-btn {
        border: none;
        background-color: transparent;
    }
}
*/

.RCB-tooltip {
    display: inline-block;
    position: relative;

    &-btn {
        display: inline-block;
        cursor: pointer;

        // Ensure the button doesn't interfere with tooltip positioning
        position: relative;
        z-index: 1;
    }

    &-body {
        display: none; // Hidden by default
        position: absolute;
        background: #fff;
        padding: 10px;
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        max-width: 300px;
        word-wrap: break-word;

        // Add smooth transitions
        opacity: 0;
        transition: opacity 0.2s ease-in-out;

        // Show tooltip when it has these classes
        &.RCB-tooltip-hover,
        &.RCB-tooltip-click {
            display: block;
            opacity: 1;
        }

        // Prevent text selection in tooltip
        user-select: none;

        // Ensure proper text rendering
        line-height: 1.4;
        color: #333;
        font-size: 14px;
    }

    &-arrow {
        width: 0;
        height: 0;
        border-style: solid;

        // Prevent arrow from interfering with hover/click events
        pointer-events: none;

        // Ensure arrow is positioned correctly
        position: absolute;

        &-top {
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-top: 10px solid #fff;
            border-bottom: 0px solid transparent;
            filter: drop-shadow(0 1px 1px #e5e7e8);
        }

        &-bottom {
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 10px solid #fff;
            border-top: 0px solid transparent;
            filter: drop-shadow(0 -1px 1px #e5e7e8);

            /*border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-top: 8px solid #fff;
            filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));*/
        }

        &-left {
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            border-right: 0px solid transparent;
            border-left: 10px solid #fff;
            filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.1));
        }

        &-right {
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            border-right: 10px solid #fff;
            border-left: 0px solid transparent;
            filter: drop-shadow(-2px 2px 2px rgba(0, 0, 0, 0.1));
        }
    }
}

// Keep the demo styles for storybook
.demo-tooltip {
    .RCB-tooltip-body {
        min-width: 235px;
    }

    .RCB-tooltip-btn {
        border: none;
        background-color: transparent;
    }
}
