.chatbox
{
    width: 300px;
    background: #f0f0f0;
    display: flex;
    flex-direction: column;
}

.chatbox form
{
    margin:0px;
}

.chatbox .chatholder
{
    display: flex;
    height: 500px;
    position: relative;
    overflow: hidden;
    flex-grow: 1;
    flex-shrink: 1;
}

.chatbox .titleholder
{
    display: flex;
    width: 100%;
    box-sizing: border-box;
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
    flex-shrink: 0;
}

.chatbox .title
{
    padding: 15px 0px;
    flex: 1;
}

.chatbox .titleholder .infinity_option
{
    font-size: 1.5em;
}

.chatbox .user
{
    font-size: 1em;
    margin-bottom: 3px;
    color: #777;
}

.chatbox .messages
{
    display: flex;
    flex:1;
    gap: 10px; /* Space between bubbles */
    max-width: 400px;
    margin: auto;
    font-family: sans-serif;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior-y: contain;
    height: 100%;
    flex-direction: column;
    transform: scaleY(-1);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.chatbox .messages .loadingmore
{
    margin: auto;
    font-size: 0;
}

.chatbox .messages .loadingmore .font-icon
{
    color: #555;
    font-size: 20px;
}

.chatbox .messages .separator
{
    display: flex;
    align-items: center;
    text-align: center;
    color: #555;
}

.chatbox .scrollbar
{
    width: 16px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    height: 100%;
}

.chatbox .messages .separator::before,
.chatbox .messages .separator::after
{
    content: '';
    flex: 1;
    border-bottom: 1px solid #555;
}

.chatbox .messages .separator:not(:empty)::before
{
    margin-right: .25em;
}

.chatbox .messages .separator:not(:empty)::after
{
    margin-left: .25em;
}

.chatbox .chatwriting
{
    color: #333;
    position: absolute;
    bottom: 5px;
    left: 10px;
    padding:3px 5px;
    background: #f0f0f0;
}

.chatbox textarea
{
    width: 100%;
    height: 40px;
    min-height: 40px;
    max-height: 150px;
    padding: 8px 15px;
    line-height: 22px;
    border-radius: 20px;
    border: 1px solid #ccc;
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
    font-size: 16px;
    outline: none;
}

.chatbox form
{
    position: relative;
}

.chatbox textarea:focus {
    border-color: #007bff;
}

.chatbox .chatbubble
{
    max-width: 80%;
    padding: 10px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    align-self: flex-start;
    color: #000;
    border-radius: 5px;
    display: flex;
}

.chatbox .chatsystem
{
    max-width: 90%;
    padding: 10px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    align-self: flex-start;
    color: #000;
    border-radius: 5px;
    display: flex;
    margin: 5px auto;
}

.chatbox .chatsystem .profilepic
{
    display:none;
}

.chatbox .chatbubble.own
{
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chatbox .chatbubble.own .content
{
    background: #ACDBF4;
}

.chatbox .chatbubble .profilepic
{
    padding: 5px;
    align-self: flex-end;
    margin-right: 4px;
}

.chatbox .chatbubble.own .profilepic, .chatbox .chatbubble.own .user
{
    display:none;
}

.chatbox form[name="reply"]
{
    border-top: 1px solid #ccc;
    flex-shrink: 0;
}

.chatbox .replybox
{
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 75px;
    border: 2px solid transparent;
    background: #e5e5e5;
    padding:10px;
    flex-wrap: wrap;
    transition: all 0.3s;
}

.chatbox .replybox button
{
    transition: all 0.3s;
}

.chatbox .replybox button:disabled
{
    background: #ccc;
}

.chatbox .replybox button:disabled:hover
{
    background: #ddd;
}

.chatbox.drag-over .replybox
{
    border-color: #3498DB;
}

.chatbox .replybox .skbluebutton
{
    border-radius: 100%;
    width: 10px;
    height: 34px;
    margin: 0px 5px;
    min-height: 40px;
    min-width: 40px;
    font-size: 1.1em;
    margin: 0px;
}

.chatbox .replybox .skbluebutton:hover
{
    background: #3cb0fd;
}

.chatbox .replybox textarea:disabled
{
    background-color: #f5f5f5;
    color: #888888;
    cursor: not-allowed;
    border: 1px solid #ddd;
    resize: none;
    opacity: 1;
}

.chatbox .chatbubble .content, .chatbox .chatsystem .content
{
    border-radius: 5px;
    padding: 10px 10px 15px;
    position: relative;
    min-width: 70px;
    background-color: #fff;
    display: flex;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chatbox .chatsystem .content
{
    padding: 10px;
}

.chatbox .chatbubble .content:before
{
    content: "";
    position: absolute;
    bottom: 14px;
    left: -3px;
    width: 10px;
    height: 13px;
    background-color: #ffffff;
    border-bottom-right-radius: 100%;
    transform: rotate(43deg);
}

.chatbox .chatbubble.own .content:before
{
    display:none;
}

.chatbox .messages .chatbubble, .chatbox .messages .chatday, .chatbox .messages .separator, .chatbox .messages .chatsystem
{
    transform: scaleY(-1);
}

.chatbox .chatbubble .content .message, .chatbox .chatsystem .content .message
{
    text-align: left;
    margin-bottom: 5px;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.chatbox .chatsystem .content .message
{
    margin-bottom: 8px;
}

.chatbox .chatsystem .content .message:has(+ .chatdate:empty)
{
    margin-bottom: 0px;
}

.chatbox .chatbubble .content .chatdate, .chatbox .chatsystem .content .chatdate
{
    position: absolute;
    bottom: 8px;
    right: 5px;
    color: #777;
    line-height: 5px;
}

.chatbox .chatday
{
    position: sticky;
    bottom: 10px;
    z-index: 10;
    z-index: 10;
    margin: 10px auto;
    padding: 10px 15px;
    background: #3498db;
    color: #fff;
    border-radius: 3px;
    font-size: 1.1em;
    align-self: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.chatday.is-visible
{
    opacity: 1;
    visibility: visible;
}

.chatday.is-detached
{
    opacity: 1 !important;
    visibility: visible !important;
}

.chatbox .day-wrapper
{
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
}

.chatbox .scroll-btn
{
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbox .scroll-btn.is-active
{
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbox .scroll-btn span
{
    font-size: 18px;
}

.chatbox .messages .link-preview-card 
{
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
    margin-top: 8px;
    max-width: 320px;
}

.chatbox .messages .link-preview-card:hover
{
    text-decoration: none;
}

.chatbox .messages .preview-img 
{
    width: 100%;
    max-height: 180px;
    object-fit: cover;
}

.chatbox .messages .preview-info 
{
    padding: 8px 12px;
}

.chatbox .messages .preview-site 
{
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: #666;
}

.chatbox .messages .preview-title 
{
    display: block;
    font-size: 14px;
    margin: 2px 0;
    color: #111;
}

.chatbox .messages .preview-desc 
{
    font-size: 12px;
    color: #555;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.supportchat_scrollable .chatbox .replybox
{
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

.supportchat_scrollable .chatbox
{
    width: 100%;
    border-radius: 5px;
}

.supportchat_scrollable .chatbox .chatholder
{
    height: 580px;
}

.supportchat_scrollable.chatactive
{
    padding:0px !important;
    overflow-y: hidden !important;
}

.chatbox button
{
    cursor: pointer;
}

.chatbox .closesupport
{
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e5e5;
    padding:10px;
    flex-direction: column;
    grid-gap: 10px;
}

.chatbox .closesupport button
{
    height: 34px;
    margin: 0px 5px;
    font-size: 1em;
    background: #EC9899;
    border:1px solid #444;
    border-radius: 5px;
}

.chatbox .closesupport textarea, .chatbox .closesupport .confirm, .chatbox .closesupport.confirm .close
{
    display:none;
}

.chatbox .closesupport.confirm textarea, .chatbox .closesupport.confirm .confirm
{
    display: block;
}

.chatbox .closesupport.confirm textarea
{
    height: 150px;
}

.chatbox .replybox .skbluebutton.gen-icon:empty:before
{
    font-size: 18px;
}

.chatbox .chatbubble.seen .chatviewed
{
    color:#007BFC;
}

.chatbox .chatbubble .chatviewed
{
    margin-left: 3px;
}

.adminsite .chat
{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    padding: 10px;
}

.adminsite .chat .chatbox
{
    flex: 0 0 300px;
    width: 300px;
    min-height: 100px;
    border: 1px solid #ddd;
}

.adminsite .chat .chatbox .titleholder .back.infinity_option
{
    display: none;
}

.adminsite .chat .chatbox .chatdesc
{
    padding: 10px;
}

.adminsite .chat .chatbox .chatdesc h2
{
    font-size: 14px;
    letter-spacing: 0;
    margin: 10px auto;
    text-align: center;
}

.adminsite .chat .chatbox .chatdesc span
{
    margin: 0px auto 10px;
    display: inline-block;
    text-align: left;
    overflow-wrap: break-word;
    word-break: break-all;
}

.adminsite .chat .chatbox .chatdesc button
{
    display: block;
    margin:auto;
}

.adminsite .chat .missing:has(+ *) 
{
    display: none;
}

.adminsite .chatbox .title
{
    padding:15px;
}

.chatbox .replybox .input-wrapper 
{
    position: relative;
    border: 0px solid transparent;
    transition: all 0.3s;
    flex:1;
    line-height: 0px;
    padding: 0px 5px;
}

.chatbox .replybox .drag-overlay 
{
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #3498DB;
    z-index: 10;
    pointer-events: none;
    font-size: 1.4em;
}

.chatbox.drag-over .replybox .drag-overlay 
{
    display: flex;
}

.chatbox .replybox .preview-grid 
{
    display: flex;
    gap: 10px;
    padding: 0px 0px 10px;
    flex-basis: 100%;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.chatbox .replybox .preview-grid:empty
{
    padding:0px;
    display:none;
}

.chatbox .replybox .preview-item 
{
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chatbox .replybox .preview-item img 
{
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.chatbox .replybox .preview-item.uploaded img 
{
    opacity: 1;
}

.chatbox .replybox .progress-container 
{
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(0,0,0,0.2);
}

.chatbox .replybox .progress-bar 
{
    height: 100%;
    background: #25d366;
    width: 0%;
    transition: width 0.1s linear;
}

.chatbox .replybox .btn-remove 
{
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbox .replybox .infinity_option
{
    padding: 0px;
    font-size: 1.5em;
    width: 40px;
    min-width: 40px;
    height: 40px;
    line-height: 1.2em;
    border-radius: 100%;
    background: #ccc;
    transition: all 0.3s;
}

.chatbox .replybox .buttonhandler .buttontrigger.infinity_option.gen-icon:before
{
    left: 50%;
}

.chatbox .replybox .buttonhandler .buttontrigger:hover
{
    background: var(--buttoncolor);
    color:#fff;
}

.chatbox .general-menu-content.small
{
    width: 175px;
    font-size: 16px;
    padding: .5em 0px;
}

.chatbox .bluebirdholder
{
    display: flex;
    height: 90%;
    width: 85%;
    position: relative;
    overflow: hidden;
    flex-grow: 1;
    flex-shrink: 1;
    flex-direction: column;
    position: absolute;
    z-index: 2;
    background: #fff;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.07), 0px 0px 1px 1px rgba(0, 0, 0, 0.05);
}

.chatbox .bluebirdholder .title
{
    padding: 10px;
}

.adminsite .chatbox .bluebirdholder .titleholder .infinity_option
{
    font-size: 1em;
    min-width: 1em;
    height: 1em;
    padding-left: 0.39em;
    padding-right: 0.39em;
    margin:4px;
}

.adminsite .chatbox .bluebirdholder .titleholder .infinity_option:before
{
    left:auto;
}

.chatbox .bluebirdholder .titleholder .infinity_option
{
    font-size: 1.2em;
}

.chatbox.iframereplace .messages
{
    opacity: 0.3;
    overflow-y: hidden;
}

.chatbox.iframereplace .scrollbar
{
    overflow-y: hidden;
}

.chatbox .chatbubble .fileview:hover
{
    cursor: zoom-in;
}

.chatbox .chatbubble .fileview
{
    visibility: visible;
    font-size: 0px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.07), 0px 0px 1px 1px rgba(0, 0, 0, 0.05);
    margin:3px 0px;
}

.chatbox .chatbubble .fileview img
{
    max-width: 180px;
    max-height: 180px;
}

.chatbox .chatbubble .fileview.gotfullscreen img
{
    max-width: none;
    max-height: none;
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%,-50%);
    width: auto;
    height: auto;
}

.chatbox .chatbubble .fileview.gotfullscreen
{
    position: relative;
}

.chatbox .chatbubble .fileview.gotfullscreen:hover
{
    cursor: zoom-out;
}

@media only screen and (min-width: 0px) and (max-width:666px)
{
    .supportchat_scrollable.chatactive .chatbox .replybox
    {
        border-bottom-left-radius: 0px;
        border-bottom-right-radius: 0px;
        min-height: 126px;
    }

    .supportchat_scrollable.chatactive .chatbox
    {
        border-radius: 0px;
        height: 100%;
        background: #e5e5e5;
    }
    
    .supportchat_scrollable.chatactive .chat
    {
        height: 100%;
    }
    
    .supportchat_scrollable.chatactive .chatbox .chatholder
    {
        height: calc(100% - 175px);
    }
    
    .supportchat_scrollable.chatactive .messages
    {
        background: #f0f0f0;
        width: 100%;
        max-width: 100%;
    }
}