/* General Widget Container */
.ai-assistant-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Floating Action Button */
.ai-assistant-open-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0073aa;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.ai-assistant-open-btn:hover {
    background-color: #005a87;
    transform: scale(1.05);
}
.ai-assistant-open-btn svg {
    width: 32px;
    height: 32px;
}

/* Chat Popup Window */
.ai-assistant-popup {
    width: 370px;
    height: 80vh;
    max-height: 600px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
}

/* Header */
.ai-assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
}
.ai-assistant-title {
    font-weight: bold;
    font-size: 16px;
}
.ai-assistant-close-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

/* Messages Area */
.ai-assistant-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f9f9f9;
}
.message-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
    word-wrap: break-word;
}
.message-bubble.user {
    background-color: #0073aa;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.message-bubble.assistant {
    background-color: #e5e5e5;
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}
.message-bubble img {
    max-width: 100%;
    border-radius: 10px;
    margin-top: 5px;
}

/* Input Area */
.ai-assistant-input-area {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid #ddd;
    background-color: #f5f5f5;
}
.ai-assistant-text-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    margin-right: 10px;
}
.ai-assistant-input-btn {
    position: relative; /* Needed for the pseudo-element */
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #555;
    padding: 5px;
    transition: all 0.2s ease;
}
.ai-assistant-input-btn:hover {
    color: #000;
}

/* New pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.5); /* Much bigger pulse */
        opacity: 0;
    }
}

/* When recording, change icon color and apply the pulse animation to a pseudo-element */
#ai-assistant-record-btn.is-recording {
    color: #ff4136; /* Red icon color */
}

#ai-assistant-record-btn.is-recording::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    width: 80%; /* Start slightly smaller than the button area */
    height: 80%;
    background-color: #ff4136;
    border-radius: 50%;
    z-index: -1; /* Behind the icon */
    animation: pulse 1.2s infinite;
}

.ai-assistant-input-btn svg {
    width: 24px;
    height: 24px;
}

/* Increase icon size when recording */
#ai-assistant-record-btn.is-recording svg {
    transform: scale(5); /* 500% increase */
    transition: transform 0.2s ease;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .ai-assistant-popup {
        width: 100vw;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        position: fixed; /* Make it fixed to cover the whole screen */
        top: 0;
        left: 0;
    }
}
