.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #0c1519;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.chatbot-widget::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(0deg, #9ff14e, #ffffff, #9ff14e);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.chatbot-widget:hover {
    transform: scale(1.1);
}

.chatbot-widget img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.chatbot-text {
    position: absolute;
    bottom: 80px;
    right: 50%;
    transform: translateX(50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    pointer-events: none;
    z-index: -1;
    background: #0c1519;
    padding: 15px 8px;
    border-radius: 25px;
    border: 2px solid #9ff14e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.chatbot-widget:hover .chatbot-text {
    max-height: 0;
    padding: 0 8px;
}

.chatbot-text span {
    color: #9ff14e;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 1;
    transform: translateY(0) scaleY(1);
    transform-origin: bottom;
    transition: all 0.3s ease;
}

.chatbot-widget:hover .chatbot-text span {
    opacity: 0;
    transform: translateY(10px) scaleY(0);
}

/* Staggered animation for each letter */
.chatbot-text span:nth-child(1) { transition-delay: 0s; }
.chatbot-text span:nth-child(2) { transition-delay: 0.02s; }
.chatbot-text span:nth-child(3) { transition-delay: 0.04s; }
.chatbot-text span:nth-child(4) { transition-delay: 0.06s; }
.chatbot-text span:nth-child(5) { transition-delay: 0.08s; }
.chatbot-text span:nth-child(6) { transition-delay: 0.1s; }
.chatbot-text span:nth-child(7) { transition-delay: 0.12s; }
.chatbot-text span:nth-child(8) { transition-delay: 0.14s; }

/* Reverse the delay on hover out for smooth opening */
.chatbot-widget:not(:hover) .chatbot-text span:nth-child(1) { transition-delay: 0.22s; }
.chatbot-widget:not(:hover) .chatbot-text span:nth-child(2) { transition-delay: 0.2s; }
.chatbot-widget:not(:hover) .chatbot-text span:nth-child(3) { transition-delay: 0.18s; }
.chatbot-widget:not(:hover) .chatbot-text span:nth-child(4) { transition-delay: 0.16s; }
.chatbot-widget:not(:hover) .chatbot-text span:nth-child(5) { transition-delay: 0.14s; }
.chatbot-widget:not(:hover) .chatbot-text span:nth-child(6) { transition-delay: 0.12s; }
.chatbot-widget:not(:hover) .chatbot-text span:nth-child(7) { transition-delay: 0.1s; }
.chatbot-widget:not(:hover) .chatbot-text span:nth-child(8) { transition-delay: 0.08s; }


@media (max-width:760px) {
    .chatbot-widget {
        width: 50px;
        height: 50px;
    }

    .chatbot-widget img {
        width: 30px;
        height: 30px;
    }

    .chatbot-text {
        bottom: 60px;
        padding: 15px 10px;
        border: 1px solid #9ff14e;
    }

    .chatbot-text span {
        font-size: 8px;
    }
    
}