:root {
    --chat-bg-opacity: 1;
    --chat-backdrop-blur: 0px;
    --chat-bg-color-base: 0, 0, 0;
    --glass-bg-opacity: 1;
    --glass-blur: 0px;
}



#chatDiv {
    background: rgba(30, 30, 30, var(--glass-bg-opacity)) !important;
    backdrop-filter: blur(var(--glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) !important;
    transition: background 0.3s, backdrop-filter 0.3s;
}

#messages {
    background: rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#chatInputArea {
    background: transparent !important;
}


@keyframes newMessage {
        0% {
        transform: translateX(-50px) scale(0.8);
        opacity: 0;
        }
        60% {
        transform: translateX(10px) scale(1.05);
        opacity: 1;
        }
        80% {
        transform: translateX(-5px) scale(0.98);
        }
        100% {
        transform: translateX(0) scale(1);
        opacity: 1;
        }
    }

    @keyframes onlinePulse {
        0%,
        100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
        }
        50% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 234, 255, 0.4);
        }
    }

    .message {
        animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        animation-fill-mode: both;
    }

    .my-message {
        animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        transform-origin: right;
    }

    .other-message {
        animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        transform-origin: left;
    }


    #uploadMenu {
        position: absolute;
        bottom: calc(100% + 8px);
        background: #2b2b2b;
        border: 1px solid #3a3a3a;
        border-radius: 10px;
        padding: 10px;
        z-index: 20;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
        width: 220px;
        animation: slideInUp 0.3s ease-out;
    }

    /* יישור לעברית (RTL) - תפריט ייפתח טיפ-טיפה שמאלה */
    html[dir="rtl"] #uploadMenu,
    body[dir="rtl"] #uploadMenu {
        right: -10px;
        left: auto;
        text-align: right;
    }

    /* יישור לאנגלית (LTR) - תפריט ייפתח טיפ-טיפה ימינה */
    html[dir="ltr"] #uploadMenu,
    body[dir="ltr"] #uploadMenu {
        left: -10px;
        right: auto;
        text-align: left;
    }

    #plusBtn:hover {
        transform: translateY(-2px) rotate(90deg);
        box-shadow: 0 8px 20px rgba(0, 153, 0, 0.6);
    }

    #sendButton:hover {
        transform: translateY(-2px) scale(1.05);
    }

/* מנצחים את הספציפיות של ה-ID ומרימים את השכבה מעל שאר האלמנטים */
#mainDiv .status-selector-container {
    z-index: 50;
}

    .msg-profile-pic {
        transition: all 0.3s ease;
    }

    .msg-profile-pic:hover {
        transform: scale(1.2) rotate(5deg);
    }

    .userItem.online,
    .group-item.online {
        animation: onlinePulse 2s ease-in-out infinite;
    }

    .message img {
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .message img:hover {
        transform: scale(1.05);
        box-shadow: 0 10px 30px rgba(0, 234, 255, 0.5);
    }

    #chatDiv {
        padding: 20px;
    }

    #chatHeader {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        padding: 10px;
        border-bottom: 1px solid #333;
        position: relative;
        z-index: 20;
    }

    #callButton {
        padding: 8px 15px;
        background: #0c0;
        box-shadow: 0 4px 10px rgba(0, 204, 0, 0.4);
        font-size: 1em;
        margin: 0 5px;
        display: none;
    }

    #callButton:hover {
        background: #0f0;
    }

    #callArea {
        height: auto;
        min-height: auto;
        border: 1px solid #00eaff;
        border-radius: 15px;
        width: 95%;
        margin: 15px auto;
        padding: 6px;
        background: rgba(0, 234, 255, 0.1);
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: space-around;
        gap: 10px;
        position: relative;
        
    }

    .video-placeholder {
        width: 100%;
        max-width: 160px;
        aspect-ratio: 1 / 1;
        height: 100%;
        max-height: 160px;
        min-height: unset;
        border-radius: 10px;
        background: #000;
        border: 2px solid #fd0;
        object-fit: cover;
        transition: all 0.3s ease;
        margin: 0 auto;
    }

    .group-video-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        width: 95%;
        margin: 0 auto;
        padding: 10px;
    }

    .group-video-grid.five-plus {
        grid-template-columns: repeat(3, 1fr);
    }

    .participant-video-box {
        position: relative;
        width: 100%;
        aspect-ratio: 1;
        border-radius: 15px;
        overflow: hidden;
        background: #1a1a1a;
        border: 3px solid #00eaff;
        box-shadow: 0 5px 15px rgba(0, 234, 255, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .participant-video-box.local-user {
        border-color: #fd0;
    }

    .participant-video-box video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scaleX(-1);
    }

    .participant-video-box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .participant-video-box .participant-name {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
        padding: 5px 15px;
        border-radius: 20px;
        font-size: 0.9em;
        font-weight: 700;
        z-index: 10;
        white-space: nowrap;
    }

    .participant-video-box.local-user .participant-name {
        background: rgba(255, 221, 0, 0.9);
        color: #121212;
    }

    #messages {
        height: 400px;
        overflow-y: auto;
        border: 1px solid #333;
        border-radius: 15px;
        width: 95%;
        margin: 15px auto;
        padding: 10px;
        background: rgba(var(--chat-bg-color-base), var(--chat-bg-opacity));
        transition: background-color 0.3s, backdrop-filter 0.3s;
        display: flex;
        flex-direction: column;
        gap: 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    #messages::-webkit-scrollbar {
        display: none;
    }

    .chat-active #messages {
        height: 260px;
    }

    .message {
        padding: 7px 15px;
        border-radius: 15px;
        max-width: 85%;
        position: relative;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        word-wrap: break-word;
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }

    .my-message {
    align-self: flex-end;
    background: #0078ff;
    color: #fff;
    border-radius: 15px;
    /* מחליף את ההגדרות הפיזיות: פינה ישרה תמיד בצד של הקיר החיצוני (למטה-בסוף) */
    border-end-end-radius: 0;
    flex-direction: row-reverse;
}

/* ההודעות של הצד השני - ייצמדו תמיד לתחילת הציר (שמאל באנגלית, ימין בעברית) */
.other-message {
    align-self: flex-start;
    background: #3a3a3a;
    color: #f0f0f0;
    border-radius: 15px;
    /* מחליף את ההגדרות הפיזיות: פינה ישרה תמיד בצד של הקיר החיצוני (למטה-בהתחלה) */
    border-end-start-radius: 0;
    flex-direction: row;
}

    .msg-profile-pic {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
        border: 1px solid #fd0;
        align-self: flex-start;
    }

    .other-message .msg-profile-pic {
        margin-inline-end: 10px;
    }

    .my-message .msg-profile-pic {
        margin-inline-start: 10px;
        border: 1px solid #ffeb3b;
    }

    .message-content-wrapper {
        display: flex;
        flex-direction: column;
        text-align: right;
        flex-grow: 1;
    }

     .my-message .message-content-wrapper {
    align-items: flex-end;
     }

    .other-message .message-content-wrapper {
    align-items: flex-start;
     }

    .my-message .username {
        color: #ffeb3b;
    }

    .message img {
        max-width: 100%;
        height: auto;
        border-radius: 10px;
        margin-top: 5px;
        
    }

    .message button {
        padding: 5px;
        margin: 0;
        margin-right: 5px;
        background: 0 0;
        box-shadow: none;
        font-size: 1.1em;
    }

    #chatInputArea {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        gap: 0;
        margin-top: 15px;
        width: 100%;
    }

    .chat-input-row {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        width: 100%;
        gap: 0;
    }

    #msgInput {
        flex-grow: 1;
        width: auto;
        margin: 0;
        border-radius: 0;
    }

    #chatInputArea button {
        height: 44px;
        padding: 12px;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 4px 10px rgba(0, 120, 255, 0.3);
    }

    #sendButton {
        border-top-left-radius: 10px;
        border-bottom-left-radius: 10px;
    }

    #plusBtn {
        border-top-right-radius: 0px;
        border-bottom-right-radius: 10px;
        padding: 12px 15px;
        background: #090;
        box-shadow: 0 4px 10px rgba(0, 153, 0, 0.4);
    }

    #plusBtn:hover {
        background: #0c0;
    }

#chatDropdown {
    inset-inline-start: 0;
    inset-inline-end: auto;
}

/* --- תגית תרגום להודעות --- */
.translation-badge {
    position: absolute;
    top: -10px; /* עלינו למעלה */
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    background: #3a3a3a;
    border: 1px solid #00eaff;
}

/* כשהכיווניות היא עברית (RTL) - נצמד לשמאל למעלה */
[dir="rtl"] .translation-badge {
    left: -8px;
    right: auto;
}

/* כשהכיווניות היא אנגלית (LTR) - נצמד לימין למעלה */
[dir="ltr"] .translation-badge {
    right: -8px;
    left: auto;
}

.translation-badge:hover {
    transform: scale(1.15) rotate(5deg);
}

/* התאמת צבעים להודעות של הצד השני */
.other-message .translation-badge {
    background: #3a3a3a;
    border: 1px solid #00eaff;
}

/* התאמת צבעים להודעות שלך */
.my-message .translation-badge {
    inset-inline-start: auto;
    inset-inline-end: -10px; /* בצד שלך זה צריך לקפוץ מהצד השני */
    background: #0078ff;
    border: 1px solid #ffeb3b;
}

.msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
    width: fit-content;
}
.my-message .msg-header {
    flex-direction: row-reverse;
    justify-content: flex-start;
    margin-inline-start: auto;
}

.message .username {
    display: inline-block;
    font-size: 0.9em;
    font-weight: 700;
    margin-bottom: 0;
    color: #fd0;
}

.message-timestamp {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    user-select: none;
    position: static;
}

.message .text-body {
    position: relative;
    padding-bottom: 0;
    min-width: unset;
    font-size: 1em;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

#chatDiv .typing-container {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: 95% !important;
    margin: -5px auto 10px auto !important;
    background: linear-gradient(90deg, rgba(30, 30, 30, 0.95) 0%, rgba(45, 45, 45, 0.9) 100%) !important;
    color: #00eaff !important;
    padding: 8px 20px !important;
    border-radius: 20px !important;
    font-size: 0.95rem !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    z-index: 10 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(0, 234, 255, 0.2) !important;
    box-sizing: border-box;
}

.typing-dots {
    display: flex;
}

.typing-dots span {
    animation: typingBlink 1.4s infinite both;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0%   { opacity: 0.2; transform: translateY(0); }
    20%  { opacity: 1;   transform: translateY(-2px); }
    100% { opacity: 0.2; transform: translateY(0); }
}

#chatDiv img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    margin: 5px 0;
}

.message img.msg-profile-pic {
    cursor: pointer;
}

/* --- Chat Dropdown Items --- */
#chatDropdown div {
    white-space: nowrap;
}

#chatHeader h3#chatWith {
    margin-inline-start: 12px !important;
}

/* ==========================================================================
   Reply Badge - ממוקם שמאל למעלה, מופיע ב-Hover בלבד
   ========================================================================== */
.message {
    position: relative;
}

.reply-badge {
    position: absolute;
    top: -16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px !important;
    border-radius: 50%;
    background: rgba(35, 35, 35, 0.85) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #b0b0b0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    z-index: 5;
    padding: 0 !important;
    margin: 0 !important;
    font-size: unset !important;

    /* מצב התחלתי מוסתר עם אפקט צמיחה קל */
    opacity: 0;
    transform: scale(0.6) translateY(5px);
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* אחרי */
[dir="rtl"] .reply-badge {
    right: 2px;
    left: auto;
}
[dir="ltr"] .reply-badge {
    left: 2px;
    right: auto;
}

/* הצגת הכפתור רק בריחוף עכבר על ההודעה */
.message:hover .reply-badge {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* אפקט ריחוף מודרני ועדין על כפתור התגובה עצמו */
.reply-badge:hover {
    background: rgba(0, 234, 255, 0.2) !important;
    border-color: #00eaff !important;
    color: #00eaff !important;
    box-shadow: 0 0 12px rgba(0, 234, 255, 0.4) !important;
    transform: scale(1) translateY(0) !important;
}

.my-message .reply-badge:hover {
    background: rgba(255, 235, 59, 0.2) !important;
    border-color: #ffeb3b !important;
    color: #ffeb3b !important;
    box-shadow: 0 0 12px rgba(255, 235, 59, 0.4) !important;
}

/* ==========================================================================
   חלונית תגובה (Replying To Bar) - צומחת ישירות מעל ה-Input
   ========================================================================== */
.message-input-container {
    display: flex;
    flex-direction: column;
    position: relative;
    flex-grow: 1;
}

#replyingToBar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 14px;
    box-sizing: border-box;

    /* Glassmorphism */
    background: rgba(25, 25, 25, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 234, 255, 0.25);
    border-bottom: none;
    border-radius: 12px 12px 0 0;

    color: #fff;
    text-align: right;

    /* מצב מוסתר עם אנימציית צמיחה מלמטה */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(8px) scaleY(0.85);
    transform-origin: bottom;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.25s ease;
}

[dir="ltr"] #replyingToBar { text-align: left; }

/* מצב פעיל - החלונית נחשפת ויוצאת בצורה אלגנטית כלפי מעלה */
#replyingToBar.active {
    max-height: 50px;
    padding: 8px 14px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scaleY(1);
}

/* יצירת חיבור ויזואלי שלם בין הבר לקלט */
#replyingToBar.active + .msg-input-wrapper #msgInput {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-top-color: transparent !important;
}

/* ארגון פנימי של תוכן התגובה */
.reply-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-grow: 1;
    text-align: right;
    border-inline-start: 3px solid #00eaff;
    padding-inline-start: 10px;
    min-width: 0; /* <--- הוסף את השורה הזו */
}

[dir="ltr"] .reply-content {
    text-align: left;
}

.reply-title {
    color: #00eaff;
    font-weight: 700;
    font-size: 0.8em;
    letter-spacing: 0.3px;
    margin-bottom: 1px;
}

.reply-text-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.75em;
    margin-top: 1px;
}

.cancel-reply-btn {
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.4) !important;
    cursor: pointer;
    padding: 4px !important;
    margin: 0 !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    height: auto !important;
    width: auto !important;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.cancel-reply-btn:hover {
    color: #ff4d4f !important;
    background: rgba(255, 77, 79, 0.1) !important;
    transform: rotate(90deg) !important;
    box-shadow: none !important;
}

/* העטיפה של שדה הטקסט וכפתור האימוג'י */
/* העטיפה של שדה הטקסט וכפתור האימוג'י */
.msg-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 44px; /* קיבוע הגובה ל-44px בדיוק כמו הכפתורים הסמוכים */
}

/* עיצוב שדה הטקסט - תוקן מגובה ופדינג שבורים לגובה מדויק ונקי */
#msgInput {
    width: 100% !important; 
    height: 100% !important; /* ממלא את העטיפה (44px) בדיוק מושלם */
    padding: 0 15px !important; /* פדינג נקי למעלה ולמטה בלי לשבור את המודל */
    margin: 0 !important;
    border-radius: 0;
    padding-inline-end: 45px !important; /* הרווח הקריטי לכפתור האימוג'י */
    box-sizing: border-box;
}

/* קיבוע כפתור האימוג'י לשדה הטקסט תמיד! */
#emojiToggleBtn {
    position: absolute;
    inset-inline-end: 0%; /* מיושר קצת פנימה בהתאמה ל-97% */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 1.4em;
    padding: 5px;
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s;
}

/* העטיפה הראשית של כל אזור הקלט - מבטיח שהכפתורים יישארו בתחתית כשהריפליי נפתח */
.chat-input-row {
    display: flex;
    align-items: flex-end;
    width: 100%;
    min-width: 0; /* <--- הוסף את השורה הזו */
}

/* הקונטיינר של הטקסט ומנגנון התגובות */
.message-input-container {
    flex-grow: 1; /* אומר לו לתפוס את כל המקום שנשאר באמצע */
    min-width: 0; /* קריטי רצח למובייל! מונע מהאינפוט לפרוץ את המסך */
    display: flex;
    flex-direction: column;
    position: relative;
}

/* העטיפה של האינפוט עצמו (איפה שיושב גם האימוג'י) */
.msg-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

/* האינפוט עצמו - מכווץ חזרה לגבולות ולא דוחף אף אחד */
.msg-input-wrapper input {
    width: 100%;
    min-width: 0; /* מכת המחץ נגד באגים של גלילה אופקית */
    box-sizing: border-box; /* שלא ישתגע בגלל ה-Padding */
}

/* ==========================================================================
   Layout-Specific Chat Rules (Split Layout)
   ========================================================================== */
body.layout-split #chatDiv {
    position: fixed !important;
    top: 75px !important;
    height: calc(100vh - 95px) !important;
    max-width: none !important;
    width: calc(100vw - 350px) !important;
    z-index: 5;
    margin: 0 !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
    display: flex !important;
    flex-direction: column;
    background: rgba(30, 30, 30, 0.5) !important;
    backdrop-filter: blur(12px);
}

body.layout-split #messages {
    flex-grow: 1 !important;
    height: auto !important;
    max-height: none !important;
}

html[dir="rtl"] body.layout-split #chatDiv {
    right: 316px !important;
    left: 12px !important;
}

html[dir="ltr"] body.layout-split #chatDiv {
    left: 316px !important;
    right: 12px !important;
}

body.layout-split #callArea {
    max-height: 45vh !important;
    overflow-y: auto !important;
    flex-shrink: 0 !important;
}

body.layout-split #callArea:has(#screenShareArea[style*="block"]),
body.layout-split #callArea:has(#remoteScreenShareArea[style*="block"]) {
    max-height: 75vh !important;
}

body.layout-split #callArea {
    padding: 10px !important;
    gap: 10px !important;
    min-height: auto !important;
    margin: 10px auto !important;
    max-width: 100% !important;
}

body.layout-split #chatHeader {
    padding-right: 35px !important;
    padding-left: 35px !important;
}

body.layout-split #chatInputArea {
    max-width: 96.5%;
    margin: 0 auto;
}

body.layout-split #chatDiv.chat-active #deleteGroupButton,
body.layout-split #chatDiv.chat-active #leaveGroupButton {
    display: none !important;
}

body.layout-split #chatDiv.chat-active #chatHeader {
    position: absolute !important;
    top: 13x !important;
    left: 0 !important;
    right: 0 !important;
    padding-inline-start: 70px !important;
    padding-inline-end: 20px !important;
    margin: 0 !important;
    border: none !important;
    z-index: 20 !important;
    display: flex !important;
    justify-content: flex-start !important;
    pointer-events: none !important;
}

body.layout-split #chatDiv.chat-active #chatHeader button,
body.layout-split #chatDiv.chat-active #chatHeader .friend-dropdown {
    pointer-events: auto !important;
}

body.layout-split #chatDiv.chat-active #chatHeader h2 {
    background: #1a1a1a;
    border: 1px solid #00eaff;
    color: #00eaff;
    padding: 2px 14px;
    border-radius: 12px;
    font-size: 0.8em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    margin: 0;
    transform: translateY(0) !important;
    white-space: nowrap !important;
}

body.layout-split #chatDiv.chat-active #callArea {
    margin-top: 0 !important;
    padding-top: 20px !important;
    position: relative;
}

body.layout-split #chatDiv.chat-active #messages {
    flex-grow: 1 !important;
    height: auto !important;
    max-height: none !important;
    margin-top: 10px !important;
}

body.layout-split.is-in-call #callButton {
    display: none !important;
}

body.layout-split.no-active-chat #chatDiv {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
}

body.layout-split.no-active-chat #chatHeader,
body.layout-split.no-active-chat #callArea,
body.layout-split.no-active-chat #messages,
body.layout-split.no-active-chat #chatInputArea,
body.layout-split.no-active-chat button[onclick*="back()"] {
    display: none !important;
}

.empty-chat-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background-color: transparent;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
}

body.layout-split.no-active-chat .empty-chat-state {
    display: flex;
}

.waving-emoji {
    font-size: 100px;
    animation: wave-animation 2.5s infinite;
    transform-origin: 70% 70%;
}

.empty-chat-text {
    color: #00eaff;
    font-size: 1.5rem;
    margin-top: 20px;
    font-weight: 600;
    text-align: center;
}

.mockup-ui {
    width: 80px;
    height: 100px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    padding: 6px;
    box-sizing: border-box;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.mockup-bubble {
    height: 10px;
    border-radius: 6px;
    margin-bottom: 4px;
}
.mockup-bubble.left {
    width: 60%;
    background: #e0e0e0;
    align-self: flex-start;
}
.mockup-bubble.right {
    width: 50%;
    background: #00eaff;
    align-self: flex-end;
}

.mockup-classic {
    flex-direction: column;
    justify-content: flex-end;
}

.mockup-split {
    flex-direction: row;
    gap: 4px;
}
.mockup-sidebar {
    width: 30%;
    height: 100%;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px;
}
.mockup-line {
    height: 4px;
    background: #ccc;
    border-radius: 2px;
}
.mockup-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* =========================================
   Hover Tooltip - מי בשיחה הפעילה
   ========================================= */
.active-call-tooltip {
    position: absolute;
    top: 50%;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #00eaff;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 234, 255, 0.3);
    backdrop-filter: blur(10px);
    z-index: 100;
    min-width: 140px;
}

/* התאמה לעברית - הפופאפ מחליק שמאלה מהכפתור */
[dir="rtl"] .active-call-tooltip {
    right: auto;
    left: calc(100% + 15px);
    transform: translateY(-50%) translateX(-20px);
}

/* התאמה לאנגלית - מחליק ימינה מהכפתור */
[dir="ltr"] .active-call-tooltip {
    left: auto;
    right: calc(100% + 15px);
    transform: translateY(-50%) translateX(20px);
}

/* הטריגר שמקפיץ את החלונית במעבר עכבר - אל תשכח שהכפתור חייב להיות relative */
#groupCallButton {
    position: relative;
    overflow: visible !important; /* זה מה שישחרר את הטולטיפ מהכלא */
}

#groupCallButton:hover .active-call-tooltip {
    opacity: 1;
    visibility: visible;
    /* מבטל את סטיית האנימציה כדי שזה ינחת בול במקום */
    transform: translateY(-50%) translateX(0);
}

/* שורת משתמש בתוך הפופאפ */
.tooltip-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tooltip-user-row:last-child {
    border-bottom: none;
}

.tooltip-user-row img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #00eaff;
    object-fit: cover;
    box-shadow: 0 0 8px rgba(0, 234, 255, 0.3);
}

.tooltip-user-row span {
    color: #fff;
    font-size: 0.9em;
    font-weight: 600;
    white-space: nowrap;
}
