.wp-ai-chatbot {
    direction: rtl;
    font-family: inherit;
}


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

.wp-ai-chatbot-toggle {

    position: fixed;

    bottom: 25px;

    right: 25px;

    width: 60px;

    height: 60px;

    border-radius: 50%;

    border: none;

    background: #2563eb;

    color: #fff;

    font-size: 28px;

    cursor: pointer;

    z-index: 99999;

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

    transition: .3s;

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

}


.wp-ai-chatbot-toggle:hover {

    transform: translateY(-4px);

}


/*
|--------------------------------------------------------------------------
| Window
|--------------------------------------------------------------------------
*/

.wp-ai-chatbot-window {

    display: none;

    position: fixed;

    right: 25px;

    bottom: 95px;

    width: 380px;

    max-width: calc(100vw - 40px);

    height: 520px;

    background: #fff;

    border-radius: 18px;

    overflow: hidden;

    z-index: 99999;

    box-shadow: 0 20px 60px rgba(0,0,0,.2);

}


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

.wp-ai-chatbot-header {

    height: 65px;

    padding: 0 20px;

    background: #09459b;

    color: #fff;

    display: flex;

    align-items: center;

    justify-content: space-between;

}


.wp-ai-chatbot-title {

    font-size: 16px;

    font-weight: 700;

}


.wp-ai-chatbot-close {

    border: none;

    background: transparent;

    color: #fff;

    font-size: 22px;

    cursor: pointer;

}


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

.wp-ai-chatbot-messages {

    height: calc(100% - 145px);

    padding: 20px;

    overflow-y: auto;

    background: #f8fafc;

}


.wp-ai-message {

    max-width: 85%;

    padding: 12px 15px;

    margin-bottom: 12px;

    line-height: 1.8;

    font-size: 14px;

    border-radius: 14px;

    word-break: break-word;

}


.wp-ai-message.user {

    margin-left: auto;

    background: #09459b;

    color: #fff;

    border-bottom-right-radius: 4px;

}


.wp-ai-message.assistant {

    margin-right: auto;

    background: #fff;

    color: #1f2937;

    border: 1px solid #e5e7eb;

    border-bottom-left-radius: 4px;

}


/*
|--------------------------------------------------------------------------
| Loading
|--------------------------------------------------------------------------
*/

.wp-ai-message.loading {

    opacity: .7;

    animation: wp-ai-loading 1.2s infinite;

}


@keyframes wp-ai-loading {

    0% {
        opacity: .3;
    }


    50% {
        opacity: 1;
    }


    100% {
        opacity: .3;
    }

}


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

.wp-ai-chatbot-footer {

    height: 80px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 10px;

    background: #fff;

    border-top: 1px solid #eee;
    position: relative;


}

.wp-ai-message.assistant p {
  margin-bottom: 10px;
  margin-top: 10px;
}

.wp-ai-message.assistant a {
  color:rgb(32, 32, 165);
}
.wp-ai-message.assistant a:hover {
    color:rgb(19, 19, 165);
}
.wp-ai-chatbot-footer textarea {

    flex: 1;

    height: 55px;

    resize: none;

    border: 1px solid #ddd;

    border-radius: 10px;

    padding: 10px;

    font-family: inherit;

    font-size: 14px;

}

[dir="rtl"] .wp-ai-chatbot-footer textarea {
    padding-left: 75px;
}
[dir="ltr"] .wp-ai-chatbot-footer textarea {
    padding-right: 75px;
}


.wp-ai-chatbot-footer textarea:focus {

    outline: none;

    border-color: #09459b;

}


.wp-ai-chatbot-footer button {

    width: 70px;

    height: 45px;

    border: none;

    border-radius: 10px;

    background: #09459b;

    color: #fff;

    cursor: pointer;
    position: absolute;
    left: 16px;

}


.wp-ai-chatbot-footer button:disabled {

    opacity: .6;

    cursor: not-allowed;

}

.wp-ai-typing {

    display: flex;

    gap: 6px;

}

.wp-ai-typing span {

    width: 8px;

    height: 8px;

    border-radius: 50%;

    background: #999;

    animation: typing .8s infinite alternate;

}

.wp-ai-typing span:nth-child(2) {

    animation-delay: .2s;

}

.wp-ai-typing span:nth-child(3) {

    animation-delay: .4s;

}

@keyframes typing{
    from{
        opacity:.2;
        transform:translateY(0);
    }

    to{
        opacity:1;
        transform:translateY(-4px);
    }

}

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

@media(max-width:600px) {


    .wp-ai-chatbot-window {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
    }


    .wp-ai-chatbot-toggle {

        right: 15px;

        bottom: 15px;

    }


}