.user-card-header,
.user-card-email {
    /* Ensure the container doesn't get too wide */
    max-width: 100%;
    overflow: hidden;
}

.user-card-header .user-card-name {
    display: inline-block;
    max-width: 320px;
    /* Adjust as needed or use a responsive unit */
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card-email {
    display: inline-block;
    max-width: 250px;
    /* Adjust as needed */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

@media (max-width: 576px) {

    .user-card-header .user-card-name,
    .user-card-email {
        max-width: 160px;
    }
}

.plan-billing,
.plan-dates {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[data-bs-theme="light"] .plan-box {
    background: #f4f9ff;
    border-radius: 0.65rem;
    border: 1px solid #e3ecfa;
}

[data-bs-theme="light"] .plan-title {
    color: #212529;
}

[data-bs-theme="light"] .plan-billing,
[data-bs-theme="light"] .plan-dates {
    color: #6c757d !important;
}

[data-bs-theme="light"] .plan-price {
    color: #222 !important;
}

/* Dark mode styles */
[data-bs-theme="dark"] .plan-box {
    background: #18202c;
    border-radius: 0.65rem;
    border: 1px solid #25304b;
}

[data-bs-theme="dark"] .plan-title {
    color: #fff;
}

[data-bs-theme="dark"] .plan-billing,
[data-bs-theme="dark"] .plan-dates {
    color: #a6b1c3 !important;
}

[data-bs-theme="dark"] .plan-price {
    color: #fff !important;
}

.rounded-card-header {
    border-top-left-radius: 1rem !important;
    border-top-right-radius: 1rem !important;
}

.tab-link {
    cursor: pointer !important;
}

.tab-link.active {
    cursor: default !important;
}

.cursor-pointer {
    cursor: pointer !important;
}

.dropdown-card {
    max-height: 250px;
    overflow-y: auto;
}

/*Chat box*/

.chat-wrapper {

    width: auto;

    border-radius: 0.25rem;

    box-shadow: 0 0.1rem 0.7rem rgba(0, 0, 0, .10);

}

.chat-content {

    padding: 15px 15px 15px 15px;

}

.chat-header {

    height: 70px;
    padding: 15px;

    border-top-right-radius: 0.25rem;

    z-index: 1;

}

.chat-footer {

    left: 0px;

    right: 0;

    bottom: 0;

    padding: 15px;

    border-radius: 20px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;

}

.chat-footer textarea {
    resize: none;
}

.chat-footer-menu a {

    display: inline-block;

    width: 40px;

    height: 40px;

    line-height: 40px;

    font-size: 18px;

    color: #ffffff;

    text-align: center;

    border-radius: 50%;

    margin: 3px;

    background-color: rgb(255 255 255 / 14%);

    border: 1px solid rgb(255 255 255 / 20%);

}

.chat-tab-menu li a.nav-link {

    padding: .3rem 0.2rem;

    line-height: 1.2;

    color: rgb(255 255 255 / 63%);

}

.chat-tab-menu .nav-pills .nav-link.active,

.chat-tab-menu .nav-pills .show>.nav-link {

    color: #ffffff;

    background-color: rgb(255 255 255 / 0%);

}

.chat-title {

    font-size: 16px;
    text-transform: capitalize;

}

.chat-msg {

    font-size: 14px;

    color: rgb(255 255 255 / 63%);

}

.chat-time {

    font-size: 13px;

}

.chat-top-header-menu button {
    line-height: 40px;
    font-size: 16px;
    text-align: center;
    border-radius: 12px;
}

.chat-content {

    width: auto;
    height: 400px;
    overflow-y: scroll;

    scroll-behavior: smooth;

}

.chat-content-leftside .chat-left-msg {

    width: fit-content;

    padding: 0.80rem;

    border-radius: 12px;

    max-width: 480px;

    text-align: left;

    border-top-left-radius: 0;

}

.chat-content-rightside .chat-right-msg {

    width: fit-content;

    padding: 0.80rem;

    border-radius: 12px;

    float: right;

    max-width: 480px;

    text-align: left;

    border-bottom-right-radius: 0;

}

.btn-rounded {
    border-radius: 50% !important;
    padding: 5px;
}

.transparent {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
}

.dropdown-menu.chat-action {
    min-width: 6rem;
}


/* Modern ChatBox Footer */
.chat-footer {
    border-top: 1px solid #86898b;
    padding: 16px 20px;
    background: white;
}

.image-attachments {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.image-attachments .actions {
    display: flex;
    gap: 12px;
}

.image-attachments a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.image-attachments a:hover {
    text-decoration: underline;
}

.image-attachments .text-danger {
    color: #dc3545 !important;
}

.input-container {
    position: relative;
    background: #e9e9e9;
    border-radius: 24px;
    padding: 4px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.input-container:focus-within {
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.message-input {
    border: none !important;
    background: transparent !important;
    resize: none;
    outline: none !important;
    box-shadow: none !important;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
    width: 100%;
    max-height: 120px;
    min-height: 44px;
    overflow-y: auto;
    font-family: inherit;
}

.message-input::placeholder {
    color: #6c757d;
}

.message-input::-webkit-scrollbar {
    width: 4px;
}

.message-input::-webkit-scrollbar-track {
    background: transparent;
}

.message-input::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

.message-input::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.input-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 12px 12px 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: all 0.2s ease;
    cursor: pointer;
}

.action-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.send-btn {
    background: #007bff !important;
    color: white !important;
}

.send-btn:hover {
    background: #0056b3 !important;
}

.send-btn:disabled {
    background: #dee2e6 !important;
    color: #6c757d !important;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 16px;
    height: 16px;
}

/* Dark Mode Styles */
html[data-bs-theme=dark] .chat-footer {
    border-top: 1px solid #495057;
    background: #212529;
}

html[data-bs-theme=dark] .image-attachments {
    background: #343a40;
    color: #adb5bd;
}

html[data-bs-theme=dark] .image-attachments a {
    color: #6ea8fe;
}

html[data-bs-theme=dark] .image-attachments .text-danger {
    color: #ea868f !important;
}

html[data-bs-theme=dark] .input-container {
    background: #343a40;
    border-color: transparent;
}

html[data-bs-theme=dark] .input-container:focus-within {
    border-color: #6ea8fe;
    background: #495057;
    box-shadow: 0 0 0 3px rgba(110, 168, 254, 0.15);
}

html[data-bs-theme=dark] .message-input {
    color: #f8f9fa;
}

html[data-bs-theme=dark] .message-input::placeholder {
    color: #adb5bd;
}

html[data-bs-theme=dark] .message-input::-webkit-scrollbar-thumb {
    background: #6c757d;
}

html[data-bs-theme=dark] .message-input::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}

html[data-bs-theme=dark] .action-btn {
    color: #adb5bd;
}

html[data-bs-theme=dark] .action-btn:hover {
    background: #495057;
    color: #f8f9fa;
}

html[data-bs-theme=dark] .send-btn {
    background: #6ea8fe !important;
    color: #000 !important;
}

html[data-bs-theme=dark] .send-btn:hover {
    background: #3d8bfd !important;
    color: #fff !important;
}

html[data-bs-theme=dark] .send-btn:disabled {
    background: #495057 !important;
    color: #6c757d !important;
}

/* Image Previews Container */
.image-previews-container {
    margin-bottom: 16px;
}

.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.image-preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.image-preview-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #dc3545;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.remove-image-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.image-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #6c757d;
}

.image-count {
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-all-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.clear-all-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

html[data-bs-theme=dark] .image-preview-item {
    background: #343a40;
    border-color: #495057;
}

html[data-bs-theme=dark] .image-preview-item:hover {
    border-color: #6ea8fe;
}

html[data-bs-theme=dark] .remove-image-btn {
    background: #ea868f;
}

html[data-bs-theme=dark] .remove-image-btn:hover {
    background: #dc3545;
}

html[data-bs-theme=dark] .image-info {
    background: #343a40;
    color: #adb5bd;
}

html[data-bs-theme=dark] .clear-all-btn {
    color: #ea868f;
}

html[data-bs-theme=dark] .clear-all-btn:hover {
    background: rgba(234, 134, 143, 0.2);
}

/* Alpine-friendly visibility */
[x-cloak] {
    display: none !important;
}

.image-preview-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

/* Reduce image size so it's not too big */
.preview-full {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Content wrapper */
.image-preview-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Close button inside modal */
.close-preview-btn {
    position: absolute;
    top: -45px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
}

.close-preview-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Navigation buttons and counter */
.preview-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(8px);
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.image-counter {
    color: white;
    font-size: 14px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

html[data-bs-theme=dark] .btn.active {
    color: #000;
}

.ql-editor {
    max-height: 250px;
}

.scrollable {
    max-height: 250px;
    overflow-y: auto;
}

/* Custom Stylish Scrollbars */
/* Webkit browsers (Chrome, Safari, Edge) */
.scrollable::-webkit-scrollbar,
.users-list::-webkit-scrollbar,
.chat-content::-webkit-scrollbar,
.dropdown-card::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scrollable::-webkit-scrollbar-track,
.users-list::-webkit-scrollbar-track,
.chat-content::-webkit-scrollbar-track,
.dropdown-card::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    margin: 2px;
}

.scrollable::-webkit-scrollbar-thumb,
.users-list::-webkit-scrollbar-thumb,
.chat-content::-webkit-scrollbar-thumb,
.dropdown-card::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.scrollable::-webkit-scrollbar-thumb:hover,
.users-list::-webkit-scrollbar-thumb:hover,
.chat-content::-webkit-scrollbar-thumb:hover,
.dropdown-card::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.scrollable::-webkit-scrollbar-corner,
.users-list::-webkit-scrollbar-corner,
.chat-content::-webkit-scrollbar-corner,
.dropdown-card::-webkit-scrollbar-corner {
    background: transparent;
}

/* Dark mode scrollbars */
html[data-bs-theme="dark"] .scrollable::-webkit-scrollbar-track,
html[data-bs-theme="dark"] .users-list::-webkit-scrollbar-track,
html[data-bs-theme="dark"] .chat-content::-webkit-scrollbar-track,
html[data-bs-theme="dark"] .dropdown-card::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .scrollable::-webkit-scrollbar-thumb,
html[data-bs-theme="dark"] .users-list::-webkit-scrollbar-thumb,
html[data-bs-theme="dark"] .chat-content::-webkit-scrollbar-thumb,
html[data-bs-theme="dark"] .dropdown-card::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #6ea8fe, #3d8bfd);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

html[data-bs-theme="dark"] .scrollable::-webkit-scrollbar-thumb:hover,
html[data-bs-theme="dark"] .users-list::-webkit-scrollbar-thumb:hover,
html[data-bs-theme="dark"] .chat-content::-webkit-scrollbar-thumb:hover,
html[data-bs-theme="dark"] .dropdown-card::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #3d8bfd, #0d6efd);
}

/* Firefox scrollbars */
.scrollable,
.users-list,
.chat-content,
.dropdown-card {
    scrollbar-width: thin;
    scrollbar-color: #007bff rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .scrollable,
[data-bs-theme="dark"] .users-list,
[data-bs-theme="dark"] .chat-content,
[data-bs-theme="dark"] .dropdown-card {
    scrollbar-color: #6ea8fe rgba(255, 255, 255, 0.08);
}

/* Smooth scrolling behavior */
.scrollable,
.users-list,
.chat-content,
.dropdown-card {
    scroll-behavior: smooth;
}

/* Alternative colorful scrollbar styles */
.scrollable.rainbow::-webkit-scrollbar-thumb,
.users-list.rainbow::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7);
    background-size: 300% 300%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Success/Error themed scrollbars */
.scrollable.success::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.scrollable.warning::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #ffc107, #fd7e14);
}

.scrollable.danger::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #dc3545, #e83e8c);
}