﻿/* ================= CHAT ICON ================= */
#mg-chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100001;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
    box-shadow: 0 14px 35px rgba(0,0,0,.35);
}

    #mg-chat-fab.show {
        opacity: 1;
        transform: translateY(0);
    }

    #mg-chat-fab svg {
        width: 30px;
        height: 30px;
    }


/* ================= CHAT WINDOW ================= */
#mg-chat-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    height: 420px;
    background: #f4f7fb;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    z-index: 100000;
    /* hidden state */
    opacity: 0;
    transform: translateY(40px);
    pointer-events: none;
    transition: opacity .5s ease, transform .5s ease;
}

    /* SHOW STATE */
    #mg-chat-window.show {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }


/* ================= HEADER ================= */
.mg-chat-header {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 16px 16px 0 0;
}

.avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn {
    margin-left: auto;
    cursor: pointer;
}


/* ================= BODY ================= */
.mg-chat-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #eef2f7;
}


/* ================= MESSAGES ================= */
.bot-msg,
.user-msg {
    max-width: 75%;
    padding: 9px 13px;
    border-radius: 14px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.bot-msg {
    background: #ffffff;
}

.user-msg {
    background: #25D366;
    color: #ffffff;
    margin-left: auto;
}


/* ================= FOOTER ================= */
.mg-chat-footer {
    display: flex;
    padding: 8px;
    background: #fff;
    border-top: 1px solid #ddd;
    border-radius: 0 0 16px 16px;
}

    .mg-chat-footer input {
        flex: 1;
        border-radius: 20px;
        border: 1px solid #ccc;
        padding: 8px 12px;
        font-size: 14px;
        outline: none;
    }

    .mg-chat-footer button {
        background: #25D366;
        border: none;
        color: white;
        border-radius: 50%;
        width: 38px;
        height: 38px;
        margin-left: 6px;
        cursor: pointer;
    }


/* ================= MOBILE ================= */
@media (max-width: 600px) {

    #mg-chat-window {
        width: 300px;
        height: 380px;
        bottom: 80px;
        right: 12px;
    }

    #mg-chat-fab {
        bottom: 18px;
        right: 18px;
    }
}
