/* Main Chat Widget Container */
#avta-widget-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

/* Chat Bubble */
#avta-chat-bubble {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}
#avta-chat-bubble:hover {
    transform: scale(1.1);
}

/* Chat Window */
#avta-chat-window {
    width: 90vw;
    max-width: 400px;
    height: 70vh;
    max-height: 600px;
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
    transform-origin: bottom right;
    position: absolute;
    bottom: 5rem;
    right: 0;
}

/* Header */
#avta-chat-header {
    color: white;
    padding: 1rem;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#avta-chat-header .avatar-container {
    display: flex;
    align-items: center;
}
#avta-chat-header .avatar-container img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid white;
}
#avta-chat-header h3 {
    font-weight: bold;
    font-size: 1.125rem;
}
#avta-chat-header p {
    font-size: 0.875rem;
    opacity: 0.8;
}
#avta-close-chat {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* Messages */
#avta-chat-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: #f9fafb;
}
#avta-chat-messages .message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}
#avta-chat-messages .message-user {
    align-items: flex-end;
}
#avta-chat-messages .message-ai {
    align-items: flex-start;
}
#avta-chat-messages .message-content {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    max-width: 80%;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
#avta-chat-messages .message-user .message-content {
    background-color: #3b82f6;
    color: white;
}
#avta-chat-messages .message-ai .message-content {
    background-color: #e5e7eb;
    color: #1f2937;
}

/* Typing Indicator */
#avta-typing-indicator {
    padding: 1rem;
    display: none;
}
#avta-typing-indicator .dot-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
#avta-typing-indicator .dot {
    width: 8px;
    height: 8px;
    background-color: #9ca3af;
    border-radius: 50%;
    animation: pulse 1.4s infinite ease-in-out both;
}
#avta-typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
#avta-typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Input Area */
#avta-input-area {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    background-color: white;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}
#avta-input-area .input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
#avta-chat-input {
    flex-grow: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    outline: none;
}
#avta-chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}
#avta-input-area button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
#avta-mic-button {
    background-color: #60a5fa;
    position: relative;
}
#avta-mic-button.listening {
    background-color: #ef4444;
}
#avta-mic-button.listening::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #ef4444;
    transform: translate(-50%, -50%);
    animation: mic-pulse 1.5s infinite;
    z-index: -1;
}
@keyframes mic-pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}
#avta-send-button {
    background-color: #2563eb;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
    #avta-widget-container {
        bottom: 1rem;
        right: 1rem;
    }
    #avta-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    #avta-chat-header, #avta-input-area {
        border-radius: 0;
    }
}
