#chat-backdrop { display: none; position: fixed; inset: 0px; background-color: rgba(0, 0, 0, 0.5); z-index: 1049; }
#chat-widget-toggle { position: fixed; bottom: 20px; width: 60px; height: 60px; background-color: #007bff; color: white; border-radius: 50%; border: none; font-size: 24px; cursor: pointer; z-index: 1051; box-shadow: 0 2px 10px rgba(0,0,0,0.2); display: flex; justify-content: center; align-items: center; }
#chat-widget-toggle .unread-badge { position: absolute; top: 0; right: 0; min-width: 22px; height: 22px; padding: 0 4px; background-color: #dc3545; border-radius: 11px; font-size: 12px; line-height: 22px; text-align: center; border: 2px solid white; }
@keyframes flash { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
#chat-widget-toggle.flashing { animation: flash 1.2s infinite; }
#chat-widget-container { position: fixed; bottom: 90px; width: 370px; height: 500px; background-color: #fff; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); z-index: 1050; display: none; flex-direction: column; overflow: hidden; border: 1px solid #ccc; }
#chat-widget-container.open { display: flex; }
.chat-widget-header { padding: 10px 15px; border-bottom: 1px solid #ddd; font-weight: bold; background-color: #f8f9fa; flex-shrink: 0; display: flex; align-items: center; gap: 10px; }
.chat-widget-header .back-btn { cursor: pointer; display: none; }
.chat-widget-header .close-btn { margin-right: auto; cursor: pointer; font-size: 20px; }
.chat-widget-body { flex-grow: 1; height: 100%; overflow: hidden; display: flex; flex-direction: column; }
#contact-list-view { height: 100%; overflow-y: auto; }
#conversation-view { height: 100%; display: none; flex-direction: column; }
#message-list { flex-grow: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 2px; }
.chat-widget-footer { padding: 10px; border-top: 1px solid #ddd; flex-shrink: 0; background-color: #f0f0f0; }
#contact-list { list-style: none; padding: 0; margin: 0; }
#contact-list li { display: flex; align-items: center; gap: 10px; padding: 10px 15px; cursor: pointer; border-bottom: 1px solid #eee; }
#contact-list li:hover { background-color: #f1f1f1; }
.contact-name { flex-grow: 1; }
.avatar { font-size: 1.5em; color: #aaa; position: relative; }
.badge { color: white; font-size: 12px; font-weight: bold; border-radius: 10px; padding: 2px 8px; }
.message-bubble { padding: 8px 12px 22px 12px; border-radius: 8px; margin-bottom: 2px; max-width: 80%; width: fit-content; word-wrap: break-word; position: relative; }
.message-bubble.sent { background-color: #dcf8c6; align-self: flex-start; } /* הודעות שלך בצד ימין (flex-start ב-RTL) */
.message-bubble.received { background-color: #f0f0f0; align-self: flex-end; } /* הודעות נכנסות בצד שמאל (flex-end ב-RTL) */
.message-time { font-size: 11px; color: #999; position: absolute; bottom: 5px; right: 10px; }
.date-separator { text-align: center; font-size: 12px; color: #888; background-color: #e9ecef; padding: 4px 10px; border-radius: 10px; margin: 10px auto; }
#message-form { display: flex; gap: 10px; }
#message-input { flex-grow: 1; border: 1px solid #ccc; border-radius: 20px; padding: 10px 15px; outline: none; }
#message-form button { background: #007bff; color: white; border: none; border-radius: 50%; width: 40px; height: 40px; font-size: 16px; cursor: pointer; flex-shrink: 0; }
#contact-list-view::-webkit-scrollbar, #message-list::-webkit-scrollbar { display: none; }
#contact-list-view, #message-list { -ms-overflow-style: none; scrollbar-width: none; }