/* Robot Widget Styles - Bottom Right Position */

.aips-robot-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999999;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.aips-robot-widget:hover {
    transform: scale(1.1);
}

.aips-robot-widget:hover .aips-robot-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.aips-robot-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    animation: aips-robot-shake 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

/* Shaking animation */
@keyframes aips-robot-shake {

    0%,
    85%,
    100% {
        transform: rotate(0deg);
    }

    87% {
        transform: rotate(-12deg);
    }

    89% {
        transform: rotate(12deg);
    }

    91% {
        transform: rotate(-8deg);
    }

    93% {
        transform: rotate(8deg);
    }

    95% {
        transform: rotate(-4deg);
    }

    97% {
        transform: rotate(4deg);
    }
}

/* Pulse ring */
.aips-robot-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.5);
    animation: aips-pulse-ring 2.5s ease-out infinite;
    z-index: 1;
}

@keyframes aips-pulse-ring {
    0% {
        width: 64px;
        height: 64px;
        opacity: 1;
    }

    100% {
        width: 100px;
        height: 100px;
        opacity: 0;
    }
}

/* Tooltip - positioned to the LEFT of the icon (since icon is on right) */
.aips-robot-tooltip {
    position: absolute;
    right: 80px;
    bottom: 16px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

/* Tooltip visible state (used by JS for periodic show) */
.aips-robot-tooltip.aips-tooltip-show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Arrow pointing right (toward the icon) */
.aips-robot-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #334155;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .aips-robot-widget {
        bottom: 20px;
        right: 20px;
    }

    .aips-robot-icon {
        width: 54px;
        height: 54px;
    }

    .aips-robot-icon svg {
        width: 30px;
        height: 30px;
    }

    .aips-robot-tooltip {
        font-size: 12px;
        padding: 8px 14px;
        right: 68px;
    }

    .aips-robot-pulse {
        width: 54px;
        height: 54px;
    }

    @keyframes aips-pulse-ring {
        0% {
            width: 54px;
            height: 54px;
            opacity: 1;
        }

        100% {
            width: 85px;
            height: 85px;
            opacity: 0;
        }
    }
}