#eht-chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: var(--eht-primary-color, #2563eb) !important;
    padding: 0;
    border: none !important;
}

#eht-chat-bubble:hover {
    transform: scale(1.1);
}

#eht-chat-bubble .material-icons {
    background: transparent !important;
}

#eht-chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: var(--eht-width, 380px);
    height: 550px;
    background: var(--eht-bg-color, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    transition: opacity 0.3s ease, transform 0.3s ease;
    color: var(--eht-text-color, #1e293b);
}

.eht-chat-hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

#eht-chat-header {
    padding: 15px 20px;
    background: var(--eht-bg-color);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.eht-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: white;
    padding: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    object-fit: contain;
}

.eht-title {
    font-weight: 600;
    font-size: 16px;
    flex-grow: 1;
    color: var(--eht-primary-color);
}

#eht-close-chat, #eht-detach-chat {
    background: none;
    border: none;
    color: var(--eht-primary-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: opacity 0.2s;
}

#eht-close-chat:hover, #eht-detach-chat:hover {
    opacity: 0.7;
}

.eht-header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

#eht-chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eht-chat-link {
    display: inline-block;
    background-color: var(--eht-primary-color, #2563eb) !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    margin: 8px 0 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    cursor: pointer !important;
    font-size: 13px !important;
    border: none !important;
}

.eht-chat-link:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px);
    color: white !important;
    text-decoration: none !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.eht-chat-link:active {
    transform: translateY(0);
}

.eht-message-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    animation: slideIn 0.3s ease;
}

.eht-message-container.user {
    flex-direction: row-reverse;
}

.eht-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.user-avatar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--eht-primary-color, #2563eb) !important;
    color: white !important;
}
.user-avatar .material-icons {
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Modern Typing Indicator - Wave Effect */
.eht-typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 16px;
    min-height: 40px;
    border-radius: 18px;
    background: var(--eht-secondary-color, #f1f5f9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.eht-typing-indicator span {
    width: 5px;
    height: 5px;
    background: var(--eht-primary-color, #2563eb);
    border-radius: 50%;
    display: block;
    animation: eht-typing-wave 1.2s infinite ease-in-out;
}

.eht-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.eht-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes eht-typing-wave {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-5px); opacity: 1; }
}


.eht-message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.4;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.eht-message.bot {
    background: var(--eht-secondary-color, #f1f5f9);
    color: var(--eht-text-color, #1e293b);
    border-bottom-left-radius: 2px;
}

.eht-message.user {
    background: var(--eht-primary-color);
    color: white;
    border-bottom-right-radius: 2px;
}

#eht-chat-input-area {
    padding: 15px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 10px;
}

#eht-user-input {
    flex-grow: 1;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 10px 15px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
}

#eht-user-input:focus {
    border-color: var(--eht-primary-color);
}

#eht-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none !important;
    background: var(--eht-primary-color, #2563eb) !important;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
    outline: none !important;
    box-shadow: none !important;
}

#eht-send-btn .material-icons {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(2px); /* slightly offset send icon to look visually centered */
    background: transparent !important;
    box-shadow: none !important;
}

#eht-send-btn:hover {
    opacity: 0.9;
}

/* Product Card Styling */
.eht-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.eht-product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.eht-product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.eht-product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.eht-product-name {
    font-weight: 600;
    font-size: 14px;
}

.eht-product-price {
    color: var(--eht-primary-color);
    font-weight: 700;
}

.eht-buy-btn {
    margin-top: 10px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Responsiveness */
@media screen and (max-width: 768px) {
    #eht-chat-widget {
        width: calc(100% - 40px) !important;
        right: 20px !important;
        left: 20px !important;
        bottom: 90px !important;
        height: 60vh !important;
    }
}

@media screen and (max-width: 480px) {
    #eht-chat-bubble {
        bottom: 10px !important;
        right: 10px !important;
        width: 50px !important;
        height: 50px !important;
    }
    #eht-chat-widget {
        width: 100% !important;
        height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        border-radius: 0 !important;
        top: 0 !important;
        margin-top: 0 !important;
    }

    #eht-chat-messages {
        padding: 15px;
    }

    .eht-message {
        max-width: 90%;
    }
}
.eht-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: var(--eht-secondary-color);
    border-radius: 15px;
    width: fit-content;
}

.eht-typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--eht-primary-color);
    border-radius: 50%;
    opacity: 0.4;
    animation: eht-bounce 1.4s infinite ease-in-out both;
}

.eht-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.eht-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes eht-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); opacity: 1; }
}

.eht-button-link {
    display: inline-block;
    padding: 8px 16px;
    margin: 5px 0;
    background: var(--eht-primary-color);
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

.eht-button-link:hover {
    filter: brightness(1.1);
}
