.chat-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 10px;
}

.chat-button,
.chat-action {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--chat-main-color, #129bf4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.chat-button {
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.chat-actions {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chat-actions.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999; /* Make sure it’s above everything */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chatbot-icon {
    width: 24px;
    height: 24px;
    /*background-image: url('../img/bot.png');*/
    background-image: url('https://cdn-icons-png.flaticon.com/512/4712/4712036.png');
    background-size: cover;
    background-repeat: no-repeat;
    animation: rotateIcon 2s linear infinite;
    cursor: pointer;
}


@keyframes rotateIcon {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chat window styles */
.chat-window {
    position: fixed;
    bottom: 100px;
    left: 20px;
    width: 300px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom left;
    transition: transform 0.3s ease;
    z-index: 9998;
}

.chat-window.active {
    transform: scale(1);
}

.chat-header {
    background: var(--chat-main-color, #5C59F0);
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.chat-messages {
    height: 200px;
    padding: 15px;
    overflow-y: auto;
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.4;
}

.bot-message {
    background: #f1f1f1;
    color: #333;
    border-top-left-radius: 5px;
    align-self: flex-start;
}

.typing-indicator {
    display: inline-block;
    padding-left: 15px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #ccc;
    border-radius: 50%;
    display: inline-block;
    margin-right: 3px;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0); }
}

/* Call-to-action styles */
.cta-container {
    position: fixed;
    bottom: 90px;
    left: 90px;
    z-index: 9997;
    animation: float 3s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.cta-container.active {
    opacity: 1;
}

.cta-bubble {
    background: white;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    position: relative;
    font-size: 14px;
    max-width: 200px;
    color:black;
}

.cta-bubble:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: white transparent;
}

.hand-pointer {
    position: absolute;
    top: 50%;
    left: -40px;
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="%235C59F0" d="M336 192h-16c-8.84 0-16 7.16-16 16v192c0 8.84 7.16 16 16 16h16c8.84 0 16-7.16 16-16V208c0-8.84-7.16-16-16-16zm-160-64h-16c-8.84 0-16 7.16-16 16v256c0 8.84 7.16 16 16 16h16c8.84 0 16-7.16 16-16V144c0-8.84-7.16-16-16-16zm64 32h-16c-8.84 0-16 7.16-16 16v224c0 8.84 7.16 16 16 16h16c8.84 0 16-7.16 16-16V176c0-8.84-7.16-16-16-16zm64-64h-16c-8.84 0-16 7.16-16 16v288c0 8.84 7.16 16 16 16h16c8.84 0 16-7.16 16-16V112c0-8.84-7.16-16-16-16zM192 0C85.96 0 0 85.96 0 192v176c0 79.53 64.47 144 144 144h80c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16h-80c-61.86 0-112-50.14-112-112v-16h160c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16H32V192c0-88.22 71.78-160 160-160s160 71.78 160 160v32h-32v-32c0-70.58-57.42-128-128-128z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    transform: rotate(-30deg);
    animation: point 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes point {
    0%, 100% { transform: rotate(-30deg) translateX(0); }
    50% { transform: rotate(-30deg) translateX(5px); }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .chat-button, .chat-action {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
     .chat-widget-container {
        bottom: 15px;
        right: 15px;
    }
    .chatbot-icon {
        width: 20px;
        height: 20px;
    }
    .chat-window {
        width: 280px;
        left: 10px;
    }
    .cta-container {
        left: 70px;
        bottom: 80px;
    }
    .cta-bubble {
        max-width: 160px;
        font-size: 12px;
    }
}