.aerl-ai-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.chat-toggle {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.chat-toggle:hover {
    background-color: #005c8a;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(calc(100% - 60px));
    transition: transform 0.3s ease;
}

.chat-window.open {
    transform: translateY(0);
}

.chat-header {
    background-color: #0073aa;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    height: 60px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.chat-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.aerl-ai-chat-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.aerl-ai-chat-toggle:hover {
    opacity: 1;
}

.toggle-icon {
    display: block;
    width: 12px;
    height: 12px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.3s ease;
}

.chat-window.open .toggle-icon {
    transform: rotate(135deg);
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

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

.aerl-ai-chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 14px;
    word-wrap: break-word;
    position: relative;
}

.aerl-ai-chat-message.user {
    background-color: #0073aa;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.aerl-ai-chat-message.assistant {
    background-color: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.aerl-ai-chat-message.system {
    background-color: #ffebee;
    color: #c62828;
    align-self: center;
    font-style: italic;
}

.chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    background: #f8f9fa;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.chat-input textarea:focus {
    outline: none;
    border-color: #0073aa;
    background: white;
}

#aerl-ai-chat-send {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #0073aa;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

#aerl-ai-chat-send:hover {
    color: #005c8a;
}

#aerl-ai-chat-send svg {
    width: 20px;
    height: 20px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Mobile responsiveness */
@media screen and (max-width: 480px) {
    .chat-window {
        width: calc(100% - 40px);
        height: calc(100% - 40px);
        bottom: 20px;
        right: 20px;
    }
}
