/******************
* UBIM styles
******************/

/* main grid */
.ubim-big {
    float: left;
    width: 100%;
}

.ubim-left {
    display: block;
    float: left;
    width: 20%;
}

.ubim-right {
    display: block;
    float: left;
    width: 70%;
    margin-left: 30px;
}

/* contacts */

.ubim-contacts-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    max-height: 75vh;
}


.ubim-contact {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    color: #333;
}

.ubim-contact:hover {
    background-color: #f0f0f5;
}


.ubim-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}


.ubim-contact-name {
    font-size: 12px;
    font-weight: 600;
}


.ubim-online {
    position: relative;
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.ubim-open {
    background-color: #eceaea;
    border-right: 4px solid #d84501;
}

.ubim-online::after {
    content: "";
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background-color: #4caf50;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    z-index: 2 !important;
}

.ubim-unread {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3 !important;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.5);
}


.ubim-unread:hover {
    background-color: #bbdefb;
}

.ubim-unread-label {
    margin-top: 3px;
    font-size: 6pt;
    font-weight: lighter;
    color: #3a3a3a;
}


/* chat */
.ubim-chat-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #f5f5f5;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    max-height: 60vh;
    margin-top: 5px;
}


.ubim-message {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 75%;
}


.ubim-from-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ubim-from-other {
    align-self: flex-start;
}


.ubim-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}


.ubim-message-bubble {
    background-color: #e4e6eb;
    border-radius: 15px;
    padding: 10px 15px;
    position: relative;
    word-wrap: break-word;
    flex: 1;
}

.ubim-from-user .ubim-message-bubble {
    background-color: #8dafce;
    color: white;
    border-bottom-right-radius: 2px;
}

.ubim-from-other .ubim-message-bubble {
    border-bottom-left-radius: 2px;
}

.ubim-from-user .ubim-message-author {
    display: none !important;
}

.ubim-from-other .ubim-message-author {
    font-size: 7pt;
}

.ubim-message-content {
    font-size: 16px;
    line-height: 1.4;
}


.ubim-timestamp {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    align-self: flex-end;
    margin-top: 5px;
}

.ubim-from-user .ubim-timestamp {
    font-size: 12px;
    color: #e2e2e2;
    align-self: flex-end;
    margin-top: 5px;
}


/* form */
.ubim-chat-form {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 10px;
    gap: 10px;
    border-top: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ubim-input-message {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
    color: #333;
    transition: border-color 0.2s;
    resize: none;
    height: 30px;
}

.ubim-input-message:focus {
    outline: none;
    border-color: #0084ff;
}

.ubim-send-button {
    padding: 10px 15px;
    background-color: #0084ff;
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.ubim-send-button:hover {
    background-color: #006bbf;
}

.ubim-send-button:active {
    transform: scale(0.95);
}

.ubim-avacontrol {
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}