.chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;

    width: 110px;
    height: 110px;

    border: none;
    border-radius: 50%;

    cursor: pointer;

    background: #1E3A8A;

    padding: 5px;

    z-index: 9999;

    transition: .3s;

    border: 6px solid #FFD400;
}

.chatbot-button:hover{
    transform: scale(1.05);
}

.chatbot-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chat-window {
    position: fixed;

    bottom: 120px;
    right: 20px;

    width: 95%;
    max-width: 320px;
    height: 500px;

    width: min(350px, calc(100vw - 20px));

    background: white;

    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0,0,0,.25);

    display: none;
    flex-direction: column;

    opacity: 0;
    transform: translateY(20px);
    transition: .3s ease;
    pointer-events: none;

    z-index: 9998;
}

.chat-window.active {
    display: flex;
    flex-direction: column;

    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.chat-header {
    background: #002D8F;
    color: white;

    padding: 16px;

    font-weight: bold;

    display:flex;
    justify-content:space-between;
    align-items:center;

    border-radius: 16px 16px 0 0;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar{
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb{
    background: #0A58CA;
    border-radius: 10px;
}

.chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #ddd;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.chat-input button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #0a58ca;
    color: white;
    min-width: 70px;
}

#closeChat{
    background: transparent;
    border: none;

    color: white;

    font-size: 22px;
    font-weight: bold;

    cursor: pointer;

    transition: .2s;
}

#closeChat:hover{
    transform: scale(1.1);
    opacity: .8;
}

.message-row{
    display:flex;
    align-items:flex-start;
    gap:10px;
}

.message-avatar{
    width:48px;
    height:48px;
    border-radius:50%;
    flex-shrink: 0;
}

.bot-message {
    background: white;
    padding: 12px;
    border-radius: 12px;

    max-width: 75%;

    box-shadow: 0 4px 12px rgba(0,0,0,.08);

    line-height: 1.5;
}

.user-message {
    background: #0A58CA;
    color: white;

    padding: 12px;
    border-radius: 12px;

    margin-left: auto;

    width: fit-content;
    max-width: 75%;

    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.user-message,
.bot-message {
    max-width: 80%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px){

    .chatbot-button{
        width: 70px;
        height: 70px;

        right: 10px;
        bottom: 10px;
    }

    .chat-window{
        bottom: 90px;
    }

}