/* ─── Aura Intelligence — Client Portal Chat Widget ───────── */

#aura-chat {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-body, 'Outfit', sans-serif);
}

/* Toggle Button */
.aura-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border: none;
    box-shadow: 0 10px 25px rgba(74, 222, 128, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    position: relative;
}

.aura-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(74, 222, 128, 0.6);
}

.aura-chat-toggle .aura-icon-close { display: none; }

#aura-chat.open .aura-chat-toggle {
    background: #1a1a2e;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

#aura-chat.open .aura-chat-toggle .aura-icon-open { display: none; }
#aura-chat.open .aura-chat-toggle .aura-icon-close { display: block; font-size: 22px; }

/* Notification pulse */
.aura-chat-toggle::after {
    content: "";
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #fbbf24;
    border-radius: 50%;
    border: 2px solid #060606;
    animation: auraPulse 2s ease-in-out infinite;
}

#aura-chat.open .aura-chat-toggle::after { display: none; }

@keyframes auraPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* Chat Window */
.aura-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: rgba(10, 18, 32, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(74, 222, 128, 0.15);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(74, 222, 128, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

#aura-chat.open .aura-chat-window {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.aura-chat-head {
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.08), rgba(74, 222, 128, 0.02));
    border-bottom: 1px solid rgba(74, 222, 128, 0.1);
    display: flex;
    align-items: center;
    gap: 14px;
}

.aura-chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(74, 222, 128, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.aura-chat-info h4 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.aura-chat-info p {
    margin: 2px 0 0 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.aura-status-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #4ade80;
}

/* Context badge */
.aura-context-badge {
    margin-left: auto;
    padding: 4px 10px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #4ade80;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Messages Body */
.aura-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.aura-chat-body::-webkit-scrollbar { width: 5px; }
.aura-chat-body::-webkit-scrollbar-track { background: transparent; }
.aura-chat-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }

.aura-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.55;
    animation: auraFadeIn 0.3s ease;
}

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

.aura-msg-ai {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.aura-msg-ai strong {
    color: #4ade80;
}

.aura-msg-user {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    font-weight: 500;
}

/* Suggestion Chips */
.aura-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.aura-chip {
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.25);
    color: #4ade80;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.aura-chip:hover {
    background: rgba(74, 222, 128, 0.18);
    border-color: rgba(74, 222, 128, 0.5);
}

/* Input Area */
.aura-chat-input {
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
    align-items: center;
}

.aura-chat-input input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 16px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.aura-chat-input input:focus {
    border-color: rgba(74, 222, 128, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.aura-chat-input input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.aura-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.aura-send-btn:hover {
    background: #4ade80;
    color: #fff;
}

.aura-send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    margin-left: 2px;
}

/* Typing Indicator */
.aura-typing {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}

.aura-typing-dot {
    width: 6px;
    height: 6px;
    background: rgba(74, 222, 128, 0.6);
    border-radius: 50%;
    animation: auraTyping 1.4s infinite ease-in-out both;
}

.aura-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.aura-typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Disclaimer footer */
.aura-chat-disclaimer {
    padding: 8px 16px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* Mobile */
@media (max-width: 480px) {
    .aura-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: -20px;
        bottom: 70px;
        border-radius: 16px;
    }

    .aura-context-badge { display: none; }
}
