/* =========================================
   AVM GOLD WEBSITE CHATBOT
   Brand: Blue, Gold and White
========================================= */

:root {
    --avm-blue: #08428f;
    --avm-dark-blue: #06356f;
    --avm-gold: #d4ae17;
    --avm-white: #ffffff;
    --avm-bg: #f6f8fc;
    --avm-text: #263449;
    --avm-muted: #718096;
    --avm-border: #e5eaf1;
    --avm-shadow: 0 12px 45px rgba(0, 25, 65, 0.20);
}

/* Launcher */

#avm-chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99998;

    width: 62px;
    height: 62px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 3px solid var(--avm-white);
    border-radius: 50%;

    background: var(--avm-blue);
    color: var(--avm-white);

    cursor: pointer;
    box-shadow: var(--avm-shadow);

    transition: transform .2s ease, background .2s ease;
}

#avm-chat-launcher:hover {
    background: var(--avm-dark-blue);
    transform: translateY(-3px);
}

#avm-chat-launcher svg {
    width: 29px;
    height: 29px;
}

/* Main popup */

#avm-chat-window {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;

    width: 360px;
    height: 560px;
    max-height: calc(100dvh - 40px);

    display: none;
    flex-direction: column;

    overflow: hidden;

    background: var(--avm-white);
    border: 1px solid var(--avm-border);
    border-radius: 17px;

    box-shadow: var(--avm-shadow);

    font-family: Arial, Helvetica, sans-serif;
    color: var(--avm-text);
}

#avm-chat-window.avm-open {
    display: flex;
}

/* Header */

.avm-chat-header {
    min-height: 76px;
    padding: 13px 17px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: var(--avm-blue);
    color: var(--avm-white);
}

.avm-chat-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avm-chat-logo {
    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: var(--avm-white);
    color: var(--avm-blue);

    font-size: 15px;
    font-weight: 800;
}

.avm-chat-brand strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

.avm-chat-brand small {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-top: 5px;
    font-size: 11px;
    color: #e1eafa;
}

.avm-chat-online {
    width: 7px;
    height: 7px;
    display: inline-block;

    border-radius: 50%;
    background: #39d98a;
}

.avm-chat-header-actions button {
    width: 33px;
    height: 33px;

    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50%;

    background: transparent;
    color: var(--avm-white);

    font-size: 22px;
    cursor: pointer;
}

/* Message area */

.avm-chat-messages {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;
    gap: 11px;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 18px 14px;

    background: var(--avm-bg);
}

.avm-chat-message {
    max-width: 85%;
    width: fit-content;

    padding: 11px 14px;

    border-radius: 13px;

    font-size: 13px;
    line-height: 1.55;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.avm-chat-message.bot {
    align-self: flex-start;

    background: var(--avm-white);
    color: var(--avm-text);

    border: 1px solid var(--avm-border);
    border-bottom-left-radius: 4px;
}

.avm-chat-message.customer {
    align-self: flex-end;

    background: var(--avm-blue);
    color: var(--avm-white);

    border-bottom-right-radius: 4px;
}

/* Quick menu */

.avm-chat-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    padding: 10px 12px;

    border-top: 1px solid var(--avm-border);
    background: var(--avm-white);
}

.avm-chat-menu button {
    padding: 8px 11px;

    border: 1px solid var(--avm-blue);
    border-radius: 20px;

    background: var(--avm-white);
    color: var(--avm-blue);

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
    transition: .2s ease;
}

.avm-chat-menu button:hover {
    background: var(--avm-blue);
    color: var(--avm-white);
}

/* Input area */

.avm-chat-input-area {
    padding: 11px 12px;

    background: var(--avm-white);
}

.avm-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 5px;

    border: 1px solid var(--avm-border);
    border-radius: 30px;

    background: var(--avm-bg);
}

.avm-chat-form input {
    flex: 1;
    min-width: 0;

    padding: 10px 12px;

    border: 0;
    outline: none;

    background: transparent;
    color: var(--avm-text);

    font-size: 13px;
}

.avm-chat-form input::placeholder {
    color: var(--avm-muted);
}

.avm-chat-form button {
    width: 39px;
    height: 39px;

    flex-shrink: 0;

    border: 0;
    border-radius: 50%;

    background: var(--avm-blue);
    color: var(--avm-white);

    font-size: 18px;
    cursor: pointer;
}

.avm-chat-form button:hover {
    background: var(--avm-dark-blue);
}

.avm-chat-form button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Footer */

.avm-chat-footer {
    padding: 9px;

    border-top: 1px solid var(--avm-border);

    background: var(--avm-white);
    color: var(--avm-muted);

    text-align: center;
    font-size: 10px;
}

/* Mobile responsive */

@media (max-width: 480px) {

    #avm-chat-launcher {
        right: 17px;
        bottom: 17px;

        width: 58px;
        height: 58px;
    }

    #avm-chat-window {
        right: 10px;
        bottom: 10px;

        width: calc(100vw - 20px);
        height: min(620px, calc(100dvh - 20px));
        max-height: calc(100dvh - 20px);

        border-radius: 15px;
    }

    .avm-chat-header {
        min-height: 70px;
    }

    .avm-chat-messages {
        padding: 14px 11px;
    }

    .avm-chat-menu {
        gap: 6px;
        padding: 9px;
    }

    .avm-chat-menu button {
        font-size: 10px;
        padding: 7px 9px;
    }
}

/* Short screen */

@media (max-height: 500px) {
    #avm-chat-window {
        height: calc(100dvh - 16px);
        bottom: 8px;
    }
}
