/* ===========================
   CHAT POPUP
=========================== */

.chat-popup{

    position:fixed;

    bottom:110px;

    right:30px;

    width:380px;

    height:600px;

    background:#ffffff;

    border-radius:20px;

    box-shadow:0 20px 50px rgba(0,0,0,.15);

    overflow:hidden;

    display:flex;

    flex-direction:column;

    opacity:0;

    visibility:hidden;

    transform:translateY(30px);

    transition:.35s ease;

    z-index:999;

}

/* Open State */

.chat-popup.active{

    opacity:1;

    visibility:visible;

    transform:translateY(0);

}

/* ===========================
   HEADER
=========================== */

.chat-header{

    height:70px;

    background:#2563eb;

    color:white;

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:0 20px;

}

.chat-title{

    display:flex;

    align-items:center;

    gap:12px;

    font-size:18px;

    font-weight:600;

}

.chat-title i{

    font-size:24px;

}

.chat-header button{

    border:none;

    background:none;

    color:white;

    font-size:22px;

    cursor:pointer;

}

/* ===========================
   CHAT BODY
=========================== */

.chat-body{

    flex:1;

    padding:18px;

    overflow-y:auto;

    background:#f8fafc;

    display:flex;

    flex-direction:column;

    gap:15px;

}

/* Scrollbar */

.chat-body::-webkit-scrollbar{

    width:6px;

}

.chat-body::-webkit-scrollbar-thumb{

    background:#cbd5e1;

    border-radius:10px;

}

/* ===========================
   BOT MESSAGE
=========================== */

.bot-message{

    background:white;

    padding:15px;

    border-radius:16px 16px 16px 5px;

    max-width:85%;

    box-shadow:0 5px 15px rgba(0,0,0,.06);

}

.bot-message strong{

    display:block;

    color:#2563eb;

    margin-bottom:8px;

}

.bot-message p{

    color:#334155;

    line-height:1.6;

}

/* ===========================
   USER MESSAGE
=========================== */

.user-message{

    align-self:flex-end;

    background:#2563eb;

    color:white;

    padding:15px;

    border-radius:16px 16px 5px 16px;

    max-width:85%;

    box-shadow:0 5px 15px rgba(37,99,235,.2);

}

.user-message p{

    line-height:1.6;

}

/* ===========================
   RESPONSE CARD
=========================== */

.ai-response{

    background:white;

    padding:15px;

    border-radius:16px;

    box-shadow:0 5px 15px rgba(0,0,0,.06);

}

.badges{

    display:flex;

    flex-wrap:wrap;

    gap:8px;

    margin-bottom:12px;

}

.badge{

    padding:6px 12px;

    border-radius:20px;

    font-size:12px;

    font-weight:600;

}

.category{

    background:#dbeafe;

    color:#2563eb;

}

.priority{

    background:#fee2e2;

    color:#dc2626;

}

.confidence{

    background:#dcfce7;

    color:#16a34a;

}

.answer{

    color:#334155;

    line-height:1.7;

}

/* ===========================
   TYPING LOADER
=========================== */

.typing{

    display:flex;

    gap:6px;

    padding:10px 0;

}

.typing span{

    width:8px;

    height:8px;

    border-radius:50%;

    background:#2563eb;

    animation:typing 1.2s infinite;

}

.typing span:nth-child(2){

    animation-delay:.2s;

}

.typing span:nth-child(3){

    animation-delay:.4s;

}

@keyframes typing{

    0%{

        opacity:.2;
        transform:translateY(0);

    }

    50%{

        opacity:1;
        transform:translateY(-5px);

    }

    100%{

        opacity:.2;
        transform:translateY(0);

    }

}

/* ===========================
   FOOTER
=========================== */

.chat-footer{

    display:flex;

    align-items:center;

    gap:10px;

    padding:15px;

    border-top:1px solid #e2e8f0;

    background:white;

}

.chat-footer input{

    flex:1;

    border:1px solid #cbd5e1;

    border-radius:12px;

    padding:12px 15px;

    outline:none;

    font-size:15px;

}

.chat-footer input:focus{

    border-color:#2563eb;

}

.chat-footer button{

    width:48px;

    height:48px;

    border:none;

    border-radius:12px;

    background:#2563eb;

    color:white;

    font-size:18px;

    cursor:pointer;

    transition:.3s;

}

.chat-footer button:hover{

    background:#1d4ed8;

}

/* ===========================
   MOBILE
=========================== */

@media(max-width:768px){

.chat-popup{

    width:calc(100% - 20px);

    height:80vh;

    right:10px;

    bottom:85px;

}

}