#messages
{
    margin: 30px 0;
    border-bottom: 1px solid #ccc;
}
.user-message
{
    background: #eee;
    padding: 15px 20px;
    border-top: 1px solid #ccc;
}
.ai-message
{
    background: #fff;
    padding: 15px 20px;
    border-top: 1px solid #ccc;
    min-height: 47px;
}
.user-message .message, .ai-message .message
{
    position: relative;
    padding-left: 50px;
    max-width: 800px;
    margin: auto;
    text-align: left;
}
.role
{
    color: #fff;
    border-radius: 4px;
    position: absolute;
    left: 0;
    top: -5px;
}
.role-user
{
    background: #04A5EE;
    padding: 5px 7px;
}
.role-ai
{
    background: #0aa93f;
    padding: 5px 9px;
}
.prompt-container
{
    max-width: 800px;
    margin: auto;
    position: relative;
}
.prompt-container textarea
{
    border: 2px solid #eee;
    background: #fff;
    outline: none;
    padding: 10px 20px;
    border-radius: 10px;
    width: 100%;
    height: 49px;
    overflow: hidden;
    transition: 0s;
    line-height: 24px;
}
.prompt-container button, .prompt-container button:hover
{
    margin-top: 5px;
    margin-bottom: 20px;
    font-size: 18px;
    line-height: 18px;
    padding: 8px 30px;
    font-weight: normal;
    height: 42px;
    cursor: pointer;
}
@media(max-width:800px)
{
    .prompt-container
    {
        padding: 0 20px;
    }
}
#ai-loading {
    z-index: 1;
    position: absolute;
    bottom: 20px;
    width: 100%;
    height: 42px;
    background: #09A93F;
    border-radius: 5px;
    display: none;
}
@media(max-width:800px)
{
    #ai-loading {
        width: calc(100% - 40px);
    }
}

#ai-loading span {
    color: #fff;
    line-height: 42px;
    font-size: 16px;
}

#ai-loading #loader {
    position: absolute;
    display: block;
    left: calc(50% - 90px);
    top: 50%;
    height: 30px;
    width: 30px;
    border: 3px solid transparent;
    border-top-color: #fff;
    border-bottom-color: #fff;
    border-radius: 50%;
    z-index: 2;
    -webkit-animation: spin 2s linear infinite;
    -moz-animation: spin 2s linear infinite;
    -o-animation: spin 2s linear infinite;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0%   {
        -webkit-transform: translate(-50%,-50%) rotate(0deg);  /* Chrome, Opera 15+, Safari 3.1+ */
        -ms-transform: translate(-50%,-50%) rotate(0deg);  /* IE 9 */
        transform: translate(-50%,-50%) rotate(0deg);  /* Firefox 16+, IE 10+, Opera */
    }

    50% {
        -webkit-transform: translate(-50%,-50%) rotate(360deg);  /* Chrome, Opera 15+, Safari 3.1+ */
        -ms-transform: translate(-50%,-50%) rotate(360deg);  /* IE 9 */
        transform: translate(-50%,-50%) rotate(180deg);  /* Firefox 16+, IE 10+, Opera */
    }
    100% {
        -webkit-transform: translate(-50%,-50%) rotate(360deg);  /* Chrome, Opera 15+, Safari 3.1+ */
        -ms-transform: translate(-50%,-50%) rotate(360deg);  /* IE 9 */
        transform: translate(-50%,-50%) rotate(360deg);  /* Firefox 16+, IE 10+, Opera */
    }
}
#ajax-spinner
{
    display: none !important;
}

.prompt-container .prompt-question, .prompt-container .prompt-question:hover
{
    margin: 5px;
    margin-top: 0;
    margin-bottom: 15px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    text-transform: none;
}

.suggestions-container {
    display: none;
    position: absolute;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    text-align: left;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.prompt-container .prompt-question:hover, .suggestion-item:hover
{
    background: #f6f6f6;
}

.back-to-top, .scroll-to-top, #page_scroller {
    display: none !important;
}
@keyframes popIn {
    0% {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.6);
    }
    70% {
        opacity: 1;
        visibility: visible;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
}
@keyframes popOut {
    0% {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        visibility: visible;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        visibility: hidden;
        transform: scale(0.6);
    }
}
.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.6);
}
.chat-container.show-chat {
    opacity: 1;
    visibility: visible;
    animation: popIn 0.4s ease-in-out forwards;
}
.chat-container.hide-chat {
    animation: popOut 0.4s ease-in-out forwards;
}
.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: 0.3s;
    border: none;
}
.chat-button:hover {
    transform: scale(1.1);
}
.chat-button .chat-icon {
    font-size: 32px; 
    color: #fff;
    line-height: 1;
}
.chat-button .online-indicator {
    width: 15px;
    height: 15px;
    background-color: #2ecc71;
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
    right: 2px;
    border: 1px solid #fff;
}
.chat-popup {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 500px;
    background: #fff;
    border-radius: 5px;
    -webkit-filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4));
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4));
    padding: 15px;
}
.chat-popup:after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: 20px;
    border: 10px solid transparent;
    border-top-color: #fff;
}
.chat-popup .chat-inner {
    max-height: calc(100vh - 150px);
    overflow: scroll;
}
.chat-popup .input-container {
    position: relative;
}
.chat-popup #messages {
    margin: 0;
    border-bottom: none;
}
.chat-popup #prompt {
    padding-right: 50px;
    margin: 10px 0 5px;
}
.chat-popup #prompt-btn {
    position: absolute;
    background: transparent;
    border: none;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
}
.chat-popup #ai-loading {
    bottom: 10px;
    height: 50px;
}
.chat-popup #ai-loading span {
    line-height: 50px;
}
.chat-popup .prompt-container .prompt-question {
    height: 34px;
    font-size: 12px;
    line-height: 12px;
    padding: 10px;
    margin: 2px;
    margin-bottom: 5px;
}
@media(max-width: 640px) {
    .chat-popup {
        width: calc(100vw - 20px);
        right: -10px;
    }
}
.chat-popup .close-btn {
    position: absolute;
    top: -15px;
    right: 0;
    cursor: pointer;
    font-size: 28px;
    color: #888;
    line-height: 1em;
}
.chat-header {
    text-align: center;
    position: relative;
}
.chat-header h3 {
    margin-top: 10px;
    margin-bottom: 20px;
}
.chat-header img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 20px;
}
.chat-header p {
    margin-bottom: 15px;
}