﻿:root {
    --aa-purple: #3b235f;
    --aa-purple-dark: #201033;
    --aa-purple-light: #6e46a3;
    --aa-gold: #ffd86b;
    --aa-gold-dark: #b8860b;
    --aa-cream: #fffaf2;
    --aa-white: #ffffff;
    --aa-text: #2c193f;
    --aa-muted: #7c6d8e;
    --aa-danger: #d92d20;
    --aa-success: #24d366;
}

.aa-support-widget {
    position: fixed;
    right: 18px;
    bottom: 88px;
    z-index: 99999;
    font-family: inherit;
}

.aa-chat-float {
    position: relative;
    border: none;
    outline: none;
    background: linear-gradient(135deg, var(--aa-purple), var(--aa-purple-light));
    color: var(--aa-white);
    border-radius: 999px;
    padding: 10px 17px 10px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 18px 38px rgba(59, 35, 95, .38);
    cursor: pointer;
    transition: all .25s ease;
    min-width: 170px;
    border: 1px solid rgba(255, 216, 107, .35);
}

    .aa-chat-float:hover {
        transform: translateY(-3px);
    }

.aa-chat-float-hide {
    opacity: 0;
    visibility: hidden;
    transform: scale(.85);
    pointer-events: none;
}

.aa-float-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 216, 107, .16);
    color: var(--aa-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    border: 1px solid rgba(255, 216, 107, .35);
}

.aa-float-text {
    text-align: left;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
}

    .aa-float-text small {
        display: block;
        margin-top: 3px;
        color: var(--aa-gold);
        font-size: 11px;
        font-weight: 600;
    }

.aa-float-pulse {
    position: absolute;
    top: 7px;
    left: 42px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--aa-success);
    animation: aaPulse 1.7s infinite;
}

@keyframes aaPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(36, 211, 102, .7);
    }

    70% {
        box-shadow: 0 0 0 9px rgba(36, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(36, 211, 102, 0);
    }
}

.aa-chat-panel {
    width: 370px;
    max-width: calc(100vw - 24px);
    height: 560px;
    max-height: calc(100vh - 125px);
    background: var(--aa-cream);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 24px 65px rgba(18, 8, 31, .30);
    border: 1px solid rgba(184, 134, 11, .25);
    display: flex;
    flex-direction: column;
    position: absolute;
    right: 0;
    bottom: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(25px) scale(.94);
    transform-origin: bottom right;
    transition: all .28s ease;
}

    .aa-chat-panel.aa-chat-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

.aa-chat-head {
    padding: 15px;
    background: radial-gradient(circle at top left, rgba(255, 216, 107, .32), transparent 34%), linear-gradient(135deg, var(--aa-purple), var(--aa-purple-dark));
    color: var(--aa-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

    .aa-chat-head::after {
        content: "";
        position: absolute;
        left: 16px;
        right: 16px;
        bottom: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 216, 107, .75), transparent);
    }

.aa-chat-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.aa-chat-logo {
    width: 43px;
    height: 43px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--aa-gold), #fff3ba);
    color: var(--aa-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 15px;
}

.aa-chat-brand h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .2px;
}

.aa-chat-brand p {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--aa-gold);
    display: flex;
    align-items: center;
    gap: 6px;
}

.aa-online-dot {
    width: 8px;
    height: 8px;
    background: var(--aa-success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(36, 211, 102, .16);
}

.aa-chat-actions {
    display: flex;
    gap: 7px;
}

    .aa-chat-actions button {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, .18);
        background: rgba(255, 255, 255, .10);
        color: var(--aa-white);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        transition: all .2s ease;
    }

        .aa-chat-actions button:hover {
            background: rgba(255, 216, 107, .22);
            color: var(--aa-gold);
        }

.aa-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: radial-gradient(circle at top right, rgba(255, 216, 107, .23), transparent 28%), linear-gradient(180deg, #fffaf2 0%, #ffffff 100%);
}

    .aa-chat-body::-webkit-scrollbar {
        width: 5px;
    }

    .aa-chat-body::-webkit-scrollbar-thumb {
        background: rgba(59, 35, 95, .25);
        border-radius: 999px;
    }

.aa-chat-contact-card,
.aa-chat-welcome {
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(184, 134, 11, .18);
    border-radius: 22px;
    padding: 17px;
    box-shadow: 0 12px 30px rgba(59, 35, 95, .08);
    text-align: center;
    margin-bottom: 12px;
}

.aa-welcome-icon {
    width: 55px;
    height: 55px;
    border-radius: 20px;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, var(--aa-purple), var(--aa-purple-light));
    color: var(--aa-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 13px 25px rgba(59, 35, 95, .22);
}

.aa-chat-contact-card h5,
.aa-chat-welcome h5 {
    margin: 0;
    color: var(--aa-purple);
    font-size: 16px;
    font-weight: 900;
}

.aa-chat-contact-card p,
.aa-chat-welcome p {
    margin: 7px 0 14px;
    font-size: 13px;
    color: var(--aa-muted);
    line-height: 1.45;
}

.aa-contact-input {
    width: 100%;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(59, 35, 95, .16);
    background: #fffaf2;
    padding: 0 13px;
    margin-bottom: 10px;
    outline: none;
    color: var(--aa-purple);
    font-size: 14px;
}

    .aa-contact-input:focus {
        border-color: var(--aa-purple);
        background: #ffffff;
        box-shadow: 0 0 0 4px rgba(59, 35, 95, .08);
    }

.aa-contact-error {
    color: var(--aa-danger);
    font-size: 12px;
    text-align: left;
    margin: 0 0 10px;
    font-weight: 700;
}

.aa-start-chat-btn {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 12px;
    background: linear-gradient(135deg, var(--aa-purple), var(--aa-purple-light));
    color: var(--aa-gold);
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(59, 35, 95, .20);
}

.aa-change-contact-btn {
    border: none;
    background: transparent;
    color: var(--aa-purple);
    font-size: 12px;
    font-weight: 800;
    margin-top: 10px;
    text-decoration: underline;
}

.aa-chat-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

    .aa-chat-chips button {
        border: 1px solid rgba(59, 35, 95, .13);
        background: linear-gradient(180deg, #ffffff, #fffaf2);
        color: var(--aa-purple);
        border-radius: 15px;
        padding: 10px 8px;
        font-size: 12px;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: all .2s ease;
    }

        .aa-chat-chips button:hover {
            background: var(--aa-purple);
            color: var(--aa-gold);
            transform: translateY(-2px);
        }

.aa-message-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 11px 0;
    animation: aaMsgIn .22s ease;
}

@keyframes aaMsgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aa-user-msg {
    justify-content: flex-end;
}

.aa-bot-msg {
    justify-content: flex-start;
}

.aa-avatar {
    min-width: 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--aa-purple);
    color: var(--aa-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 7px 15px rgba(59, 35, 95, .18);
}

.aa-user-avatar {
    background: linear-gradient(135deg, var(--aa-gold), #fff1a8);
    color: var(--aa-purple);
}

.aa-message-bubble {
    max-width: 78%;
}

.aa-message-text {
    padding: 11px 14px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.aa-bot-msg .aa-message-text {
    background: #ffffff;
    color: var(--aa-text);
    border: 1px solid rgba(184, 134, 11, .15);
    border-bottom-left-radius: 6px;
    box-shadow: 0 8px 22px rgba(59, 35, 95, .07);
}

.aa-user-msg .aa-message-text {
    background: linear-gradient(135deg, var(--aa-purple), var(--aa-purple-light));
    color: #ffffff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 10px 22px rgba(59, 35, 95, .20);
}

.aa-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 12px 0 2px 36px;
    color: var(--aa-muted);
    font-size: 11px;
}

    .aa-typing span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--aa-purple);
        opacity: .35;
        animation: aaTyping 1s infinite ease-in-out;
    }

        .aa-typing span:nth-child(2) {
            animation-delay: .15s;
        }

        .aa-typing span:nth-child(3) {
            animation-delay: .3s;
        }

@keyframes aaTyping {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: .3;
    }

    40% {
        transform: translateY(-4px);
        opacity: .9;
    }
}

.aa-chat-footer {
    padding: 11px;
    background: #ffffff;
    border-top: 1px solid rgba(59, 35, 95, .08);
    display: flex;
    gap: 8px;
    align-items: center;
}

    .aa-chat-footer input {
        flex: 1;
        height: 45px;
        border-radius: 999px;
        border: 1px solid rgba(59, 35, 95, .16);
        background: #fffaf2;
        padding: 0 15px;
        color: var(--aa-purple);
        font-size: 14px;
        outline: none;
    }

        .aa-chat-footer input:focus {
            border-color: var(--aa-purple);
            box-shadow: 0 0 0 4px rgba(59, 35, 95, .08);
            background: #ffffff;
        }

    .aa-chat-footer button {
        min-width: 45px;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        border: none;
        background: linear-gradient(135deg, var(--aa-purple), var(--aa-purple-light));
        color: var(--aa-gold);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 10px 22px rgba(59, 35, 95, .25);
    }

        .aa-chat-footer button:disabled {
            opacity: .45;
            cursor: not-allowed;
        }

@media (max-width: 575px) {
    .aa-support-widget {
        right: 13px;
        bottom: 82px;
    }

    .aa-chat-float {
        min-width: auto;
        padding: 10px 14px 10px 10px;
    }

    .aa-float-text {
        font-size: 12px;
    }

    .aa-chat-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 76px;
        width: auto;
        height: 74vh;
        max-height: none;
        border-radius: 24px;
    }

    .aa-message-bubble {
        max-width: 82%;
    }

    .aa-chat-chips {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 380px) {
    .aa-chat-panel {
        left: 7px;
        right: 7px;
        bottom: 72px;
        height: 76vh;
    }

    .aa-chat-head {
        padding: 13px;
    }

    .aa-chat-logo {
        width: 39px;
        height: 39px;
        border-radius: 14px;
    }

    .aa-chat-brand h6 {
        font-size: 14px;
    }

    .aa-chat-chips button {
        font-size: 11px;
        padding: 9px 6px;
    }
}
