/* === Chat Circle Button === */
#chat-circle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease-in-out;
    z-index: 9999;
}
#chat-circle:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #0056b3, #00409a);
}

/* === Chat Box === */
#chat-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: 90%;
    height: 400px;
    max-height: 90%;
    display: none;
    flex-direction: column;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    background: #fff;
    z-index: 9998;
    animation: fadeIn 0.3s ease-in-out;
    overflow: hidden;
}

/* === Header === */
#chat-box .card-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-weight: bold;
    font-size: 16px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-box #close-chat {
    background: transparent;
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}
#chat-box #close-chat:hover { color: #ff9c9c; }

/* === Messages === */
#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f4f5f7;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f4f5f7;
}
#chat-messages::-webkit-scrollbar { width: 6px; }
#chat-messages::-webkit-scrollbar-thumb { background-color: #007bff; border-radius: 10px; }

.msg-user {
    align-self: flex-end;
    background: #007bff;
    color: white;
    padding: 10px 16px;
    border-radius: 18px 18px 0 18px;
    max-width: 80%;
    word-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.msg-bot {
    align-self: flex-start;
    background: #e9ecef;
    color: #000;
    padding: 10px 16px;
    border-radius: 18px 18px 18px 0;
    max-width: 80%;
    word-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* === Footer/Input === */
#chat-box .card-footer {
    border-top: 1px solid #ddd;
    padding: 10px;
    display: flex;
    align-items: center;
    background: #fafafa;
}
#chat-input {
    flex: 1;
    border: none;
    border-radius: 25px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    background: #f1f1f1;
    transition: background 0.2s ease;
}
#chat-input:focus { background: #e9ecef; }

#send-chat {
    background: #007bff;
    border-radius: 10px;
    padding: 10px 16px;
    border: none;
    margin-left: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}
#send-chat:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* === Animation === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); }
}
