/* =====================================
   Pundit Junction AI Chatbot
===================================== */

*{
    box-sizing:border-box;
}

:root{

    --primary:#2f4f63;
    --primary-dark:#254052;
    --secondary:#f4f6f9;
    --bot:#ffffff;
    --user:#2f4f63;
    --text:#333;
    --border:#e6e6e6;
    --shadow:0 12px 35px rgba(0,0,0,.15);
    --radius:18px;

    font-family:
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;

}

/* =====================================
Floating Button
===================================== */

#pj-chat-btn{

    position:fixed;

    right:25px;

    bottom:25px;

    width:65px;

    height:65px;

    border-radius:50%;

    background:var(--primary);

    color:#fff;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:28px;

    cursor:pointer;

    z-index:99999;

    box-shadow:var(--shadow);

    transition:.3s;

}

#pj-chat-btn:hover{

    transform:scale(1.08);

}

#pj-chat-btn .pulse{

    position:absolute;

    width:65px;

    height:65px;

    border-radius:50%;

    border:2px solid rgba(255,255,255,.4);

    animation:pulse 2s infinite;

}

@keyframes pulse{

0%{

transform:scale(1);

opacity:1;

}

100%{

transform:scale(1.8);

opacity:0;

}

}

/* =====================================
Chat Window
===================================== */

#pj-chat{

    position:fixed;

    right:25px;

    bottom:25px;

    width:340px;

    max-width:95%;

    height:420px;

    background:#fff;

    border-radius:22px;

    overflow:hidden;

    display:none;

    flex-direction:column;

    box-shadow:var(--shadow);

    z-index:99999;

}

/* =====================================
Header
===================================== */

.pj-header{

    background:linear-gradient(
    135deg,
    #36556c,
    #2f4f63
    );

    color:#fff;

    padding:16px;

    display:flex;

    justify-content:space-between;

    align-items:center;

}

.pj-header .left{

    display:flex;

    gap:12px;

    align-items:center;

}

.pj-header h3{

    margin:0;

    font-size:18px;
    color: white;

}

.pj-header span{

    font-size:13px;

    opacity:.9;

}

.online{

    width:9px;

    height:9px;

    background:#3ddb64;

    display:inline-block;

    border-radius:50%;

}

#pj-close{

    border:none;

    background:none;

    color:#fff;

    font-size:22px;

    cursor:pointer;

}

/* =====================================
Avatar
===================================== */

.avatar{

    width:38px;

    height:38px;

    border-radius:50%;

    background:#e7edf2;

    color:var(--primary);

    display:flex;

    justify-content:center;

    align-items:center;

    font-weight:bold;

    flex-shrink:0;

}

/* =====================================
Messages
===================================== */

#pj-messages{

      flex:1;

    overflow-y:auto;

    overflow-x:hidden;

    padding:20px;

    background:#f7f8fb;

    scroll-behavior:smooth;

    min-height:0;

}

.msg{

    display:flex;

    margin-bottom:18px;

    align-items:flex-end;

    gap:10px;

}

.msg.user{

    justify-content:flex-end;

}

.msg.user .avatar{

    display:none;

}

.bubble{

    max-width:78%;

    padding:14px 18px;

    border-radius:18px;

    font-size:15px;

    line-height:1.6;

    word-wrap:break-word;

}

.msg.bot .bubble{

    background:#fff;

    color:#333;

    border:1px solid var(--border);

}

.msg.user .bubble{

    background:var(--user);

    color:#fff;

    border-bottom-right-radius:5px;

}

.msg.bot .bubble{

    border-bottom-left-radius:5px;

}

/* =====================================
Timestamp
===================================== */

.time{

    font-size:11px;

    color:#888;

    margin-top:5px;

}

/* =====================================
Typing
===================================== */

#pj-typing{

    display:flex;

    align-items:center;

    padding:15px;

    background:#f7f8fb;

}

.typing{

    background:#fff;

    border-radius:16px;

    padding:10px 16px;

}

.typing span{

    display:inline-block;

    width:8px;

    height:8px;

    margin:0 2px;

    border-radius:50%;

    background:#999;

    animation:typing 1.2s infinite;

}

.typing span:nth-child(2){

animation-delay:.2s;

}

.typing span:nth-child(3){

animation-delay:.4s;

}

@keyframes typing{

0%,80%,100%{

transform:scale(.8);

opacity:.4;

}

40%{

transform:scale(1.2);

opacity:1;

}

}

/* =====================================
Footer
===================================== */

.pj-footer{

      flex-shrink:0;

    border-top:1px solid #eee;

    padding:12px;

    display:flex;

    gap:10px;

    align-items:flex-end;

    background:#fff;

}

#pj-input{

    flex:1;

    resize:none;

    border:1px solid #ddd;

    border-radius:20px;

    padding:12px 16px;

    outline:none;

    font-size:15px;

    max-height:120px;

    overflow-y:auto;

}

#pj-input:focus{

    border-color:var(--primary);

}

#pj-send{

    width:50px;

    height:50px;

    border:none;

    border-radius:50%;

    background:var(--primary);

    color:#fff;

    font-size:20px;

    cursor:pointer;

    transition:.25s;

}

#pj-send:hover{

    background:var(--primary-dark);

    transform:scale(1.05);

}

#pj-send:disabled{

    opacity:.5;

    cursor:not-allowed;

}

/* =====================================
Scrollbar
===================================== */

#pj-messages::-webkit-scrollbar{

    width:6px;

}

#pj-messages::-webkit-scrollbar-thumb{

    background:#c9c9c9;

    border-radius:20px;

}

#pj-messages::-webkit-scrollbar-track{

    background:transparent;

}

/* =====================================
Mobile
===================================== */

@media(max-width:768px){

#pj-chat{

width:100%;

height:100%;

right:0;

bottom:0;

border-radius:0;

}

#pj-chat-btn{

right:18px;

bottom:18px;

}

.bubble{

max-width:90%;

}

}

