/* ==========================================
   PPPP CHAT SYSTEM
   chat.css
   Version 4.0.0 Final Stable
========================================== */

/* ---------- Theme ---------- */

:root{

    --pppp-primary:#0066ff;
    --pppp-primary-dark:#0052cc;

    --pppp-bg:#ffffff;
    --pppp-border:#dddddd;

    --pppp-shadow:0 10px 35px rgba(0,0,0,.18);

    --pppp-radius:18px;

    --pppp-text:#222222;

    --pppp-admin:#ececec;
    --pppp-visitor:#0066ff;

    --pppp-system:#fff8d6;

}

/* ---------- Reset ---------- */

*{

    box-sizing:border-box;

}

html{

    scroll-behavior:smooth;

}

/* ---------- Floating Button ---------- */

#pppp-chat-button{

    position:fixed;

    right:25px;

    bottom:25px;

    width:64px;

    height:64px;

    border-radius:50%;

    background:var(--pppp-primary);

    color:#fff;

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:28px;

    cursor:pointer;

    user-select:none;

    box-shadow:var(--pppp-shadow);

    z-index:999999;

    transition:.25s;

}

#pppp-chat-button:hover{

    transform:scale(1.08);

}

/* ---------- Chat Window ---------- */

.pppp-chat-window{

    position:fixed;

    right:25px;

    bottom:100px;

    width:360px;

    max-width:95vw;

    height:560px;

    background:var(--pppp-bg);

    border-radius:20px;

    overflow:hidden;

    display:none;

    flex-direction:column;

    box-shadow:var(--pppp-shadow);

    z-index:999998;

}

.pppp-chat-window.open{

    display:flex;

}

/* ---------- Header ---------- */

.pppp-chat-header{

    background:var(--pppp-primary);

    color:#fff;

    padding:16px;

    display:flex;

    justify-content:space-between;

    align-items:center;

}

.pppp-chat-header .title{

    font-size:18px;

    font-weight:700;

}

.status{

    margin-top:4px;

    font-size:13px;

    opacity:.9;

}

#chat-close{

    background:none;

    border:none;

    color:#fff;

    cursor:pointer;

    font-size:22px;

}

/* ---------- Messages ---------- */

.pppp-chat-messages{

    flex:1;

    overflow-y:auto;

    padding:15px;

    background:#fafafa;

}

.pppp-message{

    display:flex;

    margin:10px 0;

}

.pppp-message.visitor{

    justify-content:flex-end;

}

.pppp-message.admin{

    justify-content:flex-start;

}

.pppp-message.system{

    justify-content:center;

}

.bubble{

    max-width:80%;

    padding:10px 14px;

    border-radius:16px;

    line-height:1.45;

    word-break:break-word;

}

.pppp-message.visitor .bubble{

    background:var(--pppp-visitor);

    color:#fff;

}

.pppp-message.admin .bubble{

    background:var(--pppp-admin);

    color:#222;

}

.pppp-message.system .bubble{

    background:var(--pppp-system);

    color:#555;

    font-size:13px;

}

/* ---------- Typing ---------- */

.pppp-chat-typing{

    min-height:22px;

    padding:0 15px;

    font-size:13px;

    color:#666;

    font-style:italic;

}

/* ---------- Footer ---------- */

.pppp-chat-footer{

    display:flex;

    gap:10px;

    padding:12px;

    border-top:1px solid var(--pppp-border);

    background:#fff;

}

#chat-text{

    flex:1;

    padding:12px;

    border:1px solid #ccc;

    border-radius:10px;

    outline:none;

    font-size:15px;

}

#chat-text:focus{

    border-color:var(--pppp-primary);

}

#chat-send{

    background:var(--pppp-primary);

    color:#fff;

    border:none;

    padding:0 20px;

    border-radius:10px;

    cursor:pointer;

    transition:.2s;

}

#chat-send:hover{

    background:var(--pppp-primary-dark);

}

#chat-send:disabled{

    opacity:.6;

    cursor:not-allowed;

}

/* ---------- Scrollbar ---------- */

.pppp-chat-messages::-webkit-scrollbar{

    width:6px;

}

.pppp-chat-messages::-webkit-scrollbar-thumb{

    background:#cfcfcf;

    border-radius:10px;

}

/* ---------- Mobile ---------- */

@media (max-width:600px){

    .pppp-chat-window{

        left:0;

        right:0;

        bottom:0;

        width:100%;

        height:100vh;

        max-width:100%;

        border-radius:0;

    }

    #pppp-chat-button{

        right:18px;

        bottom:18px;

    }

}