/* AAES Standalone Chat Widget Styles */
:root {
    --aaes-chat-bg: rgba(20, 25, 35, 0.7); /* Deep elegant translucency */
    --aaes-chat-accent: linear-gradient(135deg, #021a36, #003061);
    --aaes-chat-user: rgba(0, 31, 63, 0.5);
    --aaes-chat-bot: rgba(255, 255, 255, 0.08);
}

#aaes-chat-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

/* Floating Bubble */
#aaes-chat-bubble {
    width: 65px;
    height: 65px;
    background: var(--aaes-chat-accent);
    border: 1px solid var(--aaes-glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

#aaes-chat-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

#aaes-chat-bubble svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* Chat Window */
#aaes-chat-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 550px;
    background: var(--aaes-chat-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--aaes-glass-border);
    border-radius: 25px;
    display: none; /* Controlled by JS */
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: aaesFadeInUp 0.4s ease-out;
}

@keyframes aaesFadeInUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.aaes-chat-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--aaes-glass-border);
    display: flex;
    align-items: center;
    gap: 15px;
}

.aaes-chat-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--aaes-glass-border);
    object-fit: cover;
}

.aaes-chat-header-info h4 {
    margin: 0;
    font-size: 15px;
    color: white;
    font-weight: 600;
}

.aaes-chat-header-info p {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--aaes-gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.aaes-chat-status-dot {
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Messages Area */
.aaes-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.aaes-message {
    max-width: 80%;
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    animation: aaesMsgScale 0.3s ease-out;
}

@keyframes aaesMsgScale {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.aaes-message.bot {
    align-self: flex-start;
    background: var(--aaes-chat-bot);
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

.aaes-message.user {
    align-self: flex-end;
    background: var(--aaes-chat-accent);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Input Area */
.aaes-chat-input-area {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--aaes-glass-border);
    display: flex;
    gap: 10px;
}

.aaes-chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--aaes-glass-border);
    border-radius: 12px;
    padding: 10px 15px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.aaes-chat-input-area input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--aaes-pink);
}

.aaes-chat-send-btn {
    background: var(--aaes-chat-accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.aaes-chat-send-btn:hover {
    transform: scale(1.05);
}

.aaes-chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Typing Indicator Animation */
.aaes-typing-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #aaa;
    border-radius: 50%;
    margin-right: 3px;
    animation: aaesTyping 1.4s infinite both;
}
.aaes-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.aaes-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aaesTyping {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    #aaes-chat-wrapper {
        bottom: 90px; /* Raised to avoid mobile browser address bars */
        right: 20px;
    }
    #aaes-chat-window {
        width: calc(100vw - 40px);
        right: -10px;
        height: calc(100vh - 160px);
        bottom: 80px;
    }
}
