.custom-offcanvas {
    width: 500px;
    height: 100%;
    position: fixed;
    top: 0;
    right: -500px;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.4s ease-in-out;
    z-index: 9999;
    overflow-y: auto;
}

.custom-offcanvas.show {
    right: 0;
}

.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

.offcanvas-overlay.show {
    display: block;
}

.bg-light-orange {
    background-color: #ffedcc;
    /* border: 1px solid #ff8234; */
}

.chat-bubble {
    max-width: 75%;
    word-wrap: break-word;
    margin: 5px 0;
}

.chat-date-divider {
    text-align: center;
    margin: 10px 0;
    color: #999;
    font-weight: bold;
}

#chatContainer {
    max-height: calc(100vh - 145px);
    overflow-y: auto;
    height: inherit;
}

.offcanvas-footer {
    position: fixed;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #eee;
}

.btn-orange {
    background: #ff8234;
    color: #fff;
}

.pr-10 {
    padding-right: 10px !important;
}

.mr-10 {
    margin-right: 10px !important;
}

.gap-6 {
    gap: 10px;
}

.custom-z-index {
    z-index: 99999;
}

.bg-chat-light {
    background-color: #e9f3ff !important;
}

.custom-offcanvas-2 {
    width: 500px;
    height: 100%;
    position: fixed;
    top: 0;
    right: -500px;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.4s ease-in-out;
    z-index: 9999;
    /* overflow-y: auto; */
}

.custom-offcanvas-2.show {
    right: 0;
}

.text-light {
    color: #fff;
}

.cursor-pointer {
    cursor: pointer;
}

.f-medium {
    font-size: medium;
}

.f-small {
    font-size: small;
}

.offcanvas-header {
    padding: 15px;
    background-color: #f8f8f8;
    color: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.d-flex {
    display: flex;
}

.text-dark {
    color: #464748;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.align-items-center {
    align-items: center;
}

.close-offcanvas {
    background: transparent;
    border: none;
    color: #000000;
    font-size: 24px;
    cursor: pointer;
    outline: none;
    padding-right: 15px;
    transition: color 0.3s ease;
}

.close-offcanvas:hover {
    color: #f9dfcf;
}

.close-offcanvas-chat {
    background: transparent;
    border: none;
    color: #000000;
    font-size: 24px;
    cursor: pointer;
    outline: none;
    padding-right: 15px;
    transition: color 0.3s ease;
}

.close-offcanvas-chat:hover {
    color: #3d3d3d;
}

.user-image {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.back-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.chat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    gap: 12px;
}

.chat-item:hover {
    background: #f9f9f9;
}

.chat-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 18px;
    color: #fff;
    background: #ccc;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-details {
    flex-grow: 1;
    overflow: hidden;
}

.flex-column {
    flex-direction: column;
}

.chat-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-message {
    font-weight: 400;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* max-width: calc(100% - 30px); */
}

.chat-badge {
    flex-shrink: 0;
    background: #ed0b4c;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 50%;
    min-width: 24px;
    text-align: center;
}

.chat-item:not(:has(.chat-badge)) .chat-message {
    max-width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-offcanvas {
        width: 90%;
        right: -100%;
    }

    .chat-avatar {
        width: 40px;
        height: 40px;
    }

    .chat-name {
        font-size: 14px;
    }

    .chat-message {
        font-size: 12px;
    }

    .chat-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .chat-avatar {
        width: 35px;
        height: 35px;
    }

    .chat-name {
        font-size: 13px;
    }

    .chat-message {
        font-size: 11px;
    }

    .chat-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* skeleton css */
.chat-skeleton {
    padding: 12px;
    border-bottom: 1px solid #eee;
    animation: pulse 1.5s infinite ease-in-out;
    margin-bottom: 10px;
    border-radius: 10px;
}

.chat-skeleton .chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e0e0e0;
    margin-right: 12px;
}

.chat-skeleton .chat-name,
.chat-skeleton .chat-message {
    width: 100%;
    height: 16px;
    background: #e0e0e0;
    margin-bottom: 8px;
    border-radius: 4px;
}

.chat-skeleton .chat-name {
    width: 60%;
}

.chat-skeleton .chat-message {
    width: 80%;
}

@keyframes pulse {
    0% {
        background-color: #e0e0e0;
    }

    50% {
        background-color: #f0f0f0;
    }

    100% {
        background-color: #e0e0e0;
    }
}

.bg-color-1 {
    background: #989696 !important;
    -webkit-border-radius: 70px;
    align-items: center;
}

.bg-color-2 {
    background: #e89696 !important;
    -webkit-border-radius: 70px;
    align-items: center;
}

.bg-color-3 {
    background: #9987d5 !important;
    -webkit-border-radius: 70px;
    align-items: center;
}

.bg-color-4 {
    background: #a1e2d3 !important;
    -webkit-border-radius: 70px;
    align-items: center;
}

.bg-color-5 {
    background: #c87ac4 !important;
    -webkit-border-radius: 70px;
    align-items: center;
}

.bg-color-6 {
    background: #d2d26e !important;
    -webkit-border-radius: 70px;
    align-items: center;
}

.bg-color-7 {
    background: #6592d6 !important;
    -webkit-border-radius: 70px;
    align-items: center;
}

.bg-color-8 {
    background: #73a7af !important;
    -webkit-border-radius: 70px;
    align-items: center;
}

.bg-color-9 {
    background: #65b386 !important;
    -webkit-border-radius: 70px;
    align-items: center;
}

.bg-color-10 {
    background: #97da9f !important;
    -webkit-border-radius: 70px;
    align-items: center;
}

.options {
    margin-left: auto;
    font-size: 18px;
    cursor: pointer;
}

.chat-container {
    width: 450px;
    flex-grow: 1;
    background: white;
    border-radius: 10px;
    overflow-y: auto;
    /* padding-bottom: 50px; */
}


.message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.z-index-high {
    z-index: 999999 !important;
}
.z-index-top {
    z-index: 9999 !important;
}

.message-content {
    max-width: 70%;
}

.message-header {
    margin-bottom: 5px;
}

.sent .msg-box-ex {
    display: flex;
    justify-content: flex-end;
}

.name {
    font-weight: bold;
    font-size: 14px;
    margin-right: 10px;
}

.time {
    font-size: 12px;
    color: gray;
    padding-right: 10px;
}

.message-box {
    padding: 10px;
    /* margin-top: 10px; */
    border-radius: 10px;
    font-size: 14px;
    background: #e6e6fa;
    word-wrap: break-word;
    width: fit-content;
    max-width: 100%;
}

.sent {
    flex-direction: row-reverse;
}

.sent .avatar {
    margin-left: 10px;
}

.sent .message-content {
    align-items: flex-end;
    text-align: right;
}

.sent .message-box {
    background: #d1e7ff;
    align-self: flex-end;
}
/* Attachment preview container */
.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

/* Individual file preview */
.attachment-preview .preview-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* border: 1px solid #ccc; */
    /* border-radius: 5px; */
    /* padding: 5px; */
    background: #f9f9f9;
}

/* Image preview */
.attachment-preview .preview-item img {
    max-width: 50px;
    max-height: 50px;
    border-radius: 5px;
}

/* File name preview */
.attachment-preview .preview-item .file-name {
    font-size: 12px;
    color: #333;
    margin-left: 5px;
}

/* Remove button */
.attachment-preview .preview-item .remove-file {
    position: absolute;
    top: -5px;
    right: -5px;
    /* background: red; */
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.badge-notifications {
    background: #ed0b4c;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.chat-footer {
    width: 100%;
    display: flex;
    align-items: start;
    padding: 10px;
    background: white;
    border-top: 1px solid #ddd;
    box-sizing: border-box;
    gap: 10px; /* Space between elements */
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: #f1f1f1; */
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    width: 40px;
    height: 40px;
}

.file-label i {
    font-size: 16px;
    color: #555;
}

.file-input {
    display: none; /* Hide the actual file input */
}

/* .message-content-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    outline: none;
    border-radius: 5px;
    background: #f1f1f1;
    width: 100%;
} */

.message-content-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    outline: none;
    border-radius: 5px;
    /* background: #f1f1f1; */
    /* width: 100%;
    min-height: 40px;
    max-height: 150px; */
    resize: none; /* Allows resizing only vertically */
    overflow-y: auto; /* Enables scrolling when needed */
}

.chat-footer button {
    padding: 8px 12px;
    background: #ff8234;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.chat-footer button:hover {
    background: #e87d3b;
}

/* Responsive Design */
@media (max-width: 480px) {
    .chat-footer {
        flex-wrap: wrap;
    }
    .file-label, .chat-footer button {
        width: 40px;
        height: 40px;
    }
    .message-content-input {
        flex: auto;
        width: calc(100% - 100px);
    }
}


/* Skeleton Animation */
@keyframes pulse {
    0% {
        background-color: #e0e0e0;
    }
    50% {
        background-color: #f0f0f0;
    }
    100% {
        background-color: #e0e0e0;
    }
}

/* General Skeleton Styling */
.message-skeleton {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite ease-in-out;
    border-radius: 10px;
}

/* Avatar Skeleton */
.avatar-skeleton {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    flex-shrink: 0;
}

/* Message Content Skeleton */
.message-content-skeleton {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    margin-left: 10px;
    width: 100%;
}

/* Header Skeleton (Name & Time) */
.message-header-skeleton {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

/* Name Skeleton */
.name-skeleton {
    width: 200px;
    height: 14px;
    background: #e0e0e0;
    border-radius: 4px;
}

/* Time Skeleton */
.time-skeleton {
    width: 90px;
    height: 12px;
    background: #e0e0e0;
    border-radius: 4px;
}

/* Message Box Skeleton */
.message-box-skeleton {
    width: 100%;
    height: 40px;
    background: #e0e0e0;
    border-radius: 8px;
    margin-top: 5px;
}

/* Received Message (Align Left) */
.received {
    flex-direction: row;
}

/* Sent Message (Align Right) */
.sent {
    flex-direction: row-reverse;
    text-align: right;
}

.sent .message-content-skeleton {
    align-items: flex-end;
    text-align: right;
    margin-right: 10px;
}

.sent .message-box-skeleton {
    align-self: flex-end;
}

.sent .msg-box-ex-skeleton {
    width: 100%;
    height: 40px;
    background: #e0e0e0;
    border-radius: 8px;
    margin-top: 5px;
}

.sent .message-header-skeleton {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

/* Skeleton Animation */
@keyframes pulse-a {
    0% {
        background-color: #e0e0e0;
    }
    50% {
        background-color: #f0f0f0;
    }
    100% {
        background-color: #e0e0e0;
    }
}

/* Skeleton Container */
#chatHeaderSkeleton {
    padding: 12px;
    display: flex;
    align-items: center;
    width: -webkit-fill-available;
    animation: pulse-a 1.5s infinite ease-in-out;
}

/* Back Button Skeleton */
.back-button-skeleton {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff8234;
    margin-right: 12px;
}

/* Avatar Skeleton */
.header-avatar-skeleton {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ff8234;
    flex-shrink: 0;
    margin-right: 12px;
}

/* User Details Skeleton */
.header-user-details-skeleton {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Name Skeleton */
.header-name-skeleton {
    width: 120px;
    height: 18px;
    background: #ff8234;
    border-radius: 4px;
    margin-bottom: 5px;
}

/* Role Skeleton */
.header-role-skeleton {
    width: 80px;
    height: 14px;
    background: #ff8234;
    border-radius: 4px;
}

.input-group {
	width: 100% !important;
	column-gap: 10px;
	flex-wrap: nowrap;
}

/* .sidebar-heading{
	color: #303840 !important;
} */

.select2-container {
    z-index: 9999999;
}

.chat-file-preview {
    display: inline-block;
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-file-preview img {
    width: 250px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.chat-file-preview:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
