/* צ'אט הודעות משתמשים – משתמש באותן מחלקות כמו צ'אט קריאות אחזקה.
   כרגע רק קובץ ריק לטעינה נפרדת, כל הסטיילים מגיעים מ-maintenance_calls.css */

/* באג' הודעות שלא נקראו על כפתור המעטפה בתפריט – צהוב כהה */
.xMainMenuButtonMsg {
    position: relative;
}
.xUserMessagesMenuBadge {
    position: absolute;
    top: -4px;
    inset-inline-end: -6px;
    min-width: 15px;
    height: 15px;
    padding: 0 5px;
    font-size: 9px;
    font-weight: bold;
    line-height: 15px;
    text-align: center;
    color: #1a1a1a;
    background: #b8860b;
    border-radius: 9px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    left: 10px;
}

/* קומפוזר חדש + צ'אט פופאפ: לאפשר גדילה עד ~10 שורות */
#xUserMessagesChatInput,
#xUserMessagesNewChatInput {
    max-height: 320px !important;
}

/* (ללא override יישור אווטרים; ה-layout מטופל ב-HTML כמו ב-maintenance_calls) */

/* --- רשימת שיחות בסגנון טלגרם (RTL) --- */
.xUserMessagesThreadList {
    direction: rtl;
    background: #2c2f33;
    border-radius: 8px;
    overflow: hidden;
    min-height: 120px;
    max-height: 70vh;
    overflow-y: auto;
}

.xUserMessagesThreadRow {
    direction: rtl;
    display: grid;
    grid-template-columns: 26px 180px minmax(0, 1fr) 92px;
    gap: 10px 12px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.15s ease;
}

.xUserMessagesThreadRow:hover {
    background: rgba(255, 255, 255, 0.06);
}

.xUserMessagesThreadRow:last-child {
    border-bottom: none;
}

.xUserMessagesThreadCheckWrap {
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.xUserMessagesThreadCheck {
    margin: 0;
    width: 18px;
    height: 18px;
}

.xUserMessagesThreadParticipantsWrap {
    min-width: 0;
    max-width: 100%;
    text-align: right;
    overflow: hidden;
}

.xUserMessagesThreadParticipantsLabel {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
}

.xUserMessagesThreadParticipants {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xUserMessagesThreadPreview {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
}

.xUserMessagesThreadFirst,
.xUserMessagesThreadLast {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.xUserMessagesThreadFirst {
    color: #7289da;
}

.xUserMessagesThreadLast {
    color: #fff;
}

.xUserMessagesThreadPreviewImgWrap {
    flex-shrink: 0;
    display: inline-flex;
    vertical-align: middle;
}

.xUserMessagesThreadPreviewImg {
    width: 18px;
    height: 18px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.xUserMessagesThreadPreviewFileIconWrap {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    vertical-align: middle;
}

.xUserMessagesThreadPreviewFileIconWrap .bi {
    font-size: inherit;
}

.xUserMessagesThreadMeta {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
}

.xUserMessagesThreadBadgeWrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 32px;
    flex-shrink: 0;
}

.xUserMessagesThreadBadge {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.xUserMessagesThreadBadgeOld {
    background: #6c757d;
    color: #fff;
}

.xUserMessagesThreadBadgeNew {
    background: #b8860b;
    color: #000;
}

.xUserMessagesThreadDateTime {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.75rem;
    color: #90ee90;
}

.xUserMessagesThreadTime {
    font-variant-numeric: tabular-nums;
}

.xUserMessagesThreadDate {
    opacity: 0.9;
}

/* --- קבצים מצורפים בצ'אט הודעות משתמשים --- */
/* תצוגה מקדימה של תמונה – גודל מוגבל ביחס למקום */
.xUserMessagesChatMessages .xChatAttachImgSmall {
    display: block;
    margin-top: 6px;
}

.xUserMessagesChatMessages .xChatAttachImgSmall a {
    display: inline-block;
    line-height: 0;
}

.xUserMessagesChatMessages .xChatAttachImgSmall .xChatImg {
    display: block;
    max-width: 220px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    vertical-align: top;
}

/* מסמך/וידאו/אודיו – אייקון סוג קובץ במקום תצוגה מקדימה */
.xChatAttachFileIcon {
    margin-top: 6px;
}

.xChatAttachFileIconLink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    max-width: 260px;
    transition: background 0.15s ease;
}

.xChatAttachFileIconLink:hover {
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
}

.xChatAttachFileIconIcon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 1.25rem;
}

.xChatAttachFileIconName {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

