/* ===== chat.css — צ'אט תמיכה פנים-פורטלי ===== */
/* namespace: rchat-  |  RTL  |  צף מעל כל התוכן  |  סטריפ נשלף מפינה שמאל-למטה, מעל ה-appbar */

/* ---- סטריפ משגר (docked bottom-left, מעל הבאנר התחתון) ---- */
.rchat-bubble{
  position:fixed; bottom:50px; left:0; z-index:100000;
  display:flex; align-items:center; gap:7px; padding:8px 15px 8px 12px;
  border:none; cursor:pointer; color:#fff; font:500 12.5px 'Rubik',sans-serif;
  background:linear-gradient(135deg,#22a757,#17914c);
  border-radius:0 20px 20px 0;                 /* פינות ימין מעוגלות — צמוד לקצה שמאל */
  box-shadow:0 4px 14px rgba(21,128,61,.22);
  transform:translateX(-5px);                   /* מציץ מעט מהקצה */
  transition:transform .22s cubic-bezier(.34,1.3,.64,1), box-shadow .22s, opacity .18s;
  -webkit-tap-highlight-color:transparent;
}
.rchat-bubble:hover{ transform:translateX(2px); box-shadow:0 7px 20px rgba(21,128,61,.3); }
.rchat-bubble svg{ width:18px; height:18px; stroke:#fff; flex-shrink:0; opacity:.95; }
.rchat-dock-lbl{ white-space:nowrap; line-height:1; letter-spacing:.2px; }
.rchat-bubble.rchat-open{ opacity:0; transform:translateX(-130%); pointer-events:none; }
.rchat-badge{
  position:absolute; top:-5px; right:-5px; min-width:18px; height:18px; padding:0 5px;
  border-radius:999px; background:#f05252; color:#fff; font:700 10.5px/18px 'Rubik',sans-serif;
  text-align:center; box-shadow:0 0 0 2px #fff; display:none;
}
.rchat-badge.rchat-show{ display:block; }

/* ---- חלון — נשלף מפינה שמאל-למטה ---- */
.rchat-panel{
  position:fixed; bottom:50px; left:16px; z-index:100001;
  width:358px; max-width:calc(100vw - 30px); height:min(548px, 78vh);
  background:#fff; border-radius:16px; overflow:hidden; display:none; flex-direction:column;
  box-shadow:0 14px 44px rgba(15,23,42,.15); border:1px solid #eef2f1;
  font-family:'Rubik','Tahoma',sans-serif; direction:rtl;
  opacity:0; transform:translateY(8px) scaleY(.5) scaleX(.93); transform-origin:left bottom;
  transition:opacity .18s ease, transform .3s cubic-bezier(.33,1.28,.5,1);
}
.rchat-panel.rchat-show{ opacity:1; transform:none; }

.rchat-head{
  background:linear-gradient(135deg,#22a757,#17914c); color:#fff; padding:12px 15px;
  display:flex; align-items:center; gap:10px; flex-shrink:0;
}
.rchat-head .rchat-h-ava{
  width:35px; height:35px; border-radius:50%; background:rgba(255,255,255,.16);
  display:flex; align-items:center; justify-content:center; font-weight:500; font-size:14px; flex-shrink:0;
}
.rchat-head .rchat-h-ava svg{ width:17px; height:17px; stroke:#fff; }
.rchat-head .rchat-h-tt{ flex:1; min-width:0; }
.rchat-head .rchat-h-title{ font-size:14.5px; font-weight:600; line-height:1.25; }
.rchat-head .rchat-h-sub{ font-size:11px; opacity:.82; margin-top:1px; font-weight:400; }
.rchat-head .rchat-h-btn{
  background:rgba(255,255,255,.12); border:none; color:#fff; width:28px; height:28px; border-radius:8px;
  cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s; flex-shrink:0;
}
.rchat-head .rchat-h-btn:hover{ background:rgba(255,255,255,.24); }
.rchat-head .rchat-h-btn svg{ width:16px; height:16px; stroke:#fff; }
.rchat-head .rchat-h-btn.rchat-off{ opacity:.5; }   /* פרטיות מופעלת — עין סגורה */
/* שורת סטטוס (מחובר/מקליד) */
.rchat-h-stat{ display:flex; align-items:center; gap:5px; }
.rchat-h-stat.rchat-on{ opacity:1; }
.rchat-h-dot{ width:7px; height:7px; border-radius:50%; background:#8ef0b4; box-shadow:0 0 0 0 rgba(142,240,180,.7); animation:rchat-pulse 2s infinite; flex-shrink:0; }
@keyframes rchat-pulse{ 0%{ box-shadow:0 0 0 0 rgba(142,240,180,.6); } 70%{ box-shadow:0 0 0 5px rgba(142,240,180,0); } 100%{ box-shadow:0 0 0 0 rgba(142,240,180,0); } }
/* שלוש נקודות "מקליד/ה" בכותרת */
.rchat-type-dots{ display:inline-flex; gap:3px; align-items:center; }
.rchat-type-dots i{ width:4px; height:4px; border-radius:50%; background:currentColor; opacity:.5; animation:rchat-td 1.2s infinite; }
.rchat-type-dots i:nth-child(2){ animation-delay:.2s; }
.rchat-type-dots i:nth-child(3){ animation-delay:.4s; }
@keyframes rchat-td{ 0%,60%,100%{ transform:translateY(0); opacity:.4; } 30%{ transform:translateY(-3px); opacity:1; } }
/* בועת "מקליד/ה…" בגוף השיחה */
.rchat-typing{ display:inline-flex !important; gap:4px; align-items:center; padding:10px 13px !important; }
.rchat-typing i{ width:6px; height:6px; border-radius:50%; background:#9aa6b2; animation:rchat-td 1.2s infinite; }
.rchat-typing i:nth-child(2){ animation-delay:.2s; }
.rchat-typing i:nth-child(3){ animation-delay:.4s; }

/* ---- גוף ההודעות ---- */
.rchat-body{ flex:1; overflow-y:auto; padding:15px 13px; background:#f7f9f8; display:flex; flex-direction:column; gap:7px; }
.rchat-empty{ margin:auto; text-align:center; color:#9aa6b2; font-size:12.5px; padding:20px; line-height:1.7; }
.rchat-day{ align-self:center; font-size:10px; color:#9aa6b2; background:#eef2f1; padding:3px 11px; border-radius:999px; margin:3px 0; }

.rchat-msg{ max-width:78%; padding:7px 11px; border-radius:14px; font-size:13px; line-height:1.5; word-wrap:break-word; white-space:pre-wrap; position:relative; cursor:pointer; }
.rchat-msg.rchat-mine{ align-self:flex-start; background:linear-gradient(135deg,#cdefdd,#bbe7cc); color:#0f4d35; border:1px solid #a4d9bb; border-end-start-radius:5px; }
.rchat-msg.rchat-them{ align-self:flex-end; background:#fff; color:#243041; border:1px solid #e9eef0; border-end-end-radius:5px; }
.rchat-msg .rchat-b-tx{ white-space:pre-wrap; }
.rchat-msg .rchat-mfoot{ display:flex; align-items:center; gap:6px; margin-top:3px; }
.rchat-msg .rchat-t{ flex:1; font-size:9.5px; opacity:.65; text-align:start; }
/* אישור קריאה ✓ / ✓✓ */
.rchat-msg .rchat-ck{ display:inline-flex; align-items:center; flex-shrink:0; color:#6fae91; opacity:.85; }
.rchat-msg .rchat-ck svg{ height:11px; width:auto; }
.rchat-msg .rchat-ck.rchat-seen{ color:#2d8cf0; opacity:1; }
/* כפתור תגובת-אימוג'י */
.rchat-msg .rchat-react-btn{ background:none; border:none; cursor:pointer; padding:0; width:16px; height:16px; flex-shrink:0; color:currentColor; opacity:.4; transition:opacity .15s; display:flex; align-items:center; justify-content:center; }
.rchat-msg .rchat-react-btn:hover{ opacity:1; }
.rchat-msg .rchat-react-btn svg{ width:14px; height:14px; stroke:currentColor; }
/* צ'יפים של תגובות על הבועה */
.rchat-react{ display:none; flex-wrap:wrap; gap:4px; margin-top:5px; }
.rchat-rchip{ display:inline-flex; align-items:center; gap:3px; border:none; cursor:pointer; background:rgba(18,80,58,.08); color:inherit; border-radius:999px; padding:1px 7px; line-height:1.6; }
.rchat-msg.rchat-them .rchat-rchip{ background:#eef2f1; color:#243041; }
.rchat-rchip.rchat-rmine{ box-shadow:inset 0 0 0 1.5px rgba(18,80,58,.35); }
.rchat-msg.rchat-them .rchat-rchip.rchat-rmine{ box-shadow:inset 0 0 0 1.5px #22a757; }
.rchat-rchip span{ font-size:12.5px; }
.rchat-rchip b{ font-weight:600; font-size:10px; opacity:.85; }
/* בוחר אימוג'י צף */
.rchat-rpick{ position:absolute; z-index:7; display:flex; gap:2px; background:#fff; border-radius:999px; padding:5px 7px; box-shadow:0 6px 22px rgba(15,23,42,.2); opacity:0; transform:scale(.85); transform-origin:bottom center; transition:opacity .14s, transform .16s cubic-bezier(.33,1.4,.5,1); }
.rchat-rpick.rchat-show{ opacity:1; transform:none; }
.rchat-rpick-e{ border:none; background:none; cursor:pointer; font-size:21px; line-height:1; padding:3px 4px; border-radius:9px; transition:transform .1s, background .12s; }
.rchat-rpick-e:hover{ transform:scale(1.25); background:#f1f5f3; }
/* משפחת-גופן אימוג'י מודרנית (מעדיפים את הסט של המערכת, לא ברירת-מחדל ישנה) */
.rchat-rpick-e, .rchat-rchip span{ font-family:"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","Twemoji Mozilla",sans-serif; }
.rchat-msg .rchat-del-btn{
  background:none; border:none; cursor:pointer; padding:0; width:16px; height:16px; flex-shrink:0;
  color:currentColor; opacity:.4; transition:opacity .15s; display:flex; align-items:center; justify-content:center;
}
.rchat-msg .rchat-del-btn:hover{ opacity:1; }
.rchat-msg .rchat-del-btn svg{ width:13px; height:13px; stroke:currentColor; }
/* בועת "הודעה נמחקה" */
.rchat-msg.rchat-del{ font-style:italic; opacity:.75; font-size:12px; cursor:default; }
.rchat-msg.rchat-del.rchat-them{ color:#8a95a1; }
.rchat-msg.rchat-flash{ animation:rchat-flash 1.2s ease; }
@keyframes rchat-flash{ 0%,100%{ box-shadow:none; } 30%{ box-shadow:0 0 0 3px rgba(34,167,87,.45); } }

/* ---- ציטוט מוטמע בתוך בועת ההודעה ---- */
.rchat-msg .rchat-q{
  margin-bottom:5px; padding:4px 8px; border-inline-start:3px solid currentColor;
  border-radius:7px; cursor:pointer; opacity:.9; max-height:3.4em; overflow:hidden;
}
.rchat-msg.rchat-mine .rchat-q{ background:rgba(18,80,58,.07); }
.rchat-msg.rchat-them .rchat-q{ background:#f1f5f3; border-inline-start-color:#22a757; }
.rchat-msg .rchat-q-who{ font-size:10.5px; font-weight:600; margin-bottom:1px; }
.rchat-msg.rchat-them .rchat-q-who{ color:#17914c; }
.rchat-msg .rchat-q-tx{ font-size:11px; opacity:.85; white-space:pre-wrap; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* ---- תיבת כתיבה ---- */
.rchat-foot{ flex-shrink:0; border-top:1px solid #eef2f1; padding:9px 11px; background:#fff; display:flex; flex-direction:column; gap:7px; }
.rchat-inrow{ display:flex; gap:8px; align-items:flex-end; }

/* ---- תצוגת-ציטוט מעל תיבת הכתיבה ---- */
.rchat-qbar{ display:flex; align-items:center; gap:8px; background:#f1f5f3; border-inline-start:3px solid #22a757; border-radius:8px; padding:5px 9px; }
.rchat-qbar .rchat-qbar-m{ flex:1; min-width:0; }
.rchat-qbar .rchat-qbar-who{ font-size:10.5px; font-weight:600; color:#17914c; margin-bottom:1px; }
.rchat-qbar .rchat-qbar-tx{ font-size:11px; color:#6b7786; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rchat-qbar .rchat-qbar-x{ background:none; border:none; cursor:pointer; color:#9aa6b2; width:22px; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:background .15s,color .15s; }
.rchat-qbar .rchat-qbar-x:hover{ background:#e4ebe8; color:#4a5560; }
.rchat-qbar .rchat-qbar-x svg{ width:14px; height:14px; stroke:currentColor; }
.rchat-foot textarea{
  flex:1; resize:none; border:1px solid #dde3e6; border-radius:11px; padding:8px 12px; font:400 13px 'Rubik',sans-serif;
  max-height:108px; min-height:38px; line-height:1.4; outline:none; transition:border-color .15s; color:#243041;
}
.rchat-foot textarea:focus{ border-color:#22a757; }
.rchat-send{
  width:38px; height:38px; border-radius:10px; border:none; cursor:pointer; flex-shrink:0;
  background:linear-gradient(135deg,#22a757,#17914c); color:#fff; display:flex; align-items:center; justify-content:center;
  transition:opacity .15s, transform .12s;
}
.rchat-send:hover{ transform:scale(1.06); }
.rchat-send:disabled{ opacity:.4; cursor:default; transform:none; }
.rchat-send svg{ width:17px; height:17px; stroke:#fff; transform:scaleX(-1); }   /* מצביע שמאלה — כיוון שליחה ב-RTL */

/* ---- תיבת נכנסות (מנהל) ---- */
.rchat-inbox{ flex:1; overflow-y:auto; background:#fff; }
.rchat-newbtn{
  display:flex; align-items:center; gap:8px; width:100%; padding:11px 15px; border:none; background:#f7f9f8;
  cursor:pointer; font:500 12.5px 'Rubik',sans-serif; color:#17914c; border-bottom:1px solid #eef2f1; text-align:start;
}
.rchat-newbtn:hover{ background:#eef2f1; }
.rchat-newbtn svg{ width:16px; height:16px; stroke:#17914c; }
.rchat-tr{ display:flex; align-items:center; gap:10px; padding:10px 14px; cursor:pointer; border-bottom:1px solid #f2f6f5; transition:background .12s; }
.rchat-tr:hover{ background:#f7f9f8; }
.rchat-tr .rchat-ava{ width:38px; height:38px; border-radius:50%; background:linear-gradient(135deg,#a7f3c7,#6ee7a8); color:#146c3a; display:flex; align-items:center; justify-content:center; font-weight:500; font-size:13.5px; flex-shrink:0; }
.rchat-tr .rchat-tr-m{ flex:1; min-width:0; }
.rchat-tr .rchat-tr-top{ display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.rchat-tr .rchat-tr-name{ font-weight:600; font-size:13px; color:#243041; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rchat-tr .rchat-tr-time{ font-size:10px; color:#9aa6b2; flex-shrink:0; }
.rchat-tr .rchat-tr-last{ font-size:11.5px; color:#6b7786; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.rchat-tr .rchat-tr-last.rchat-un{ color:#243041; font-weight:500; }
.rchat-tr .rchat-tr-badge{ min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:#22a757; color:#fff; font:700 10.5px/18px 'Rubik',sans-serif; text-align:center; flex-shrink:0; }
.rchat-loading{ text-align:center; color:#9aa6b2; font-size:12px; padding:24px; }

/* ---- חלונית אישור חמודה (מחיקה) ---- */
.rchat-confirm{
  position:absolute; inset:0; z-index:5; display:flex; align-items:center; justify-content:center;
  background:rgba(15,23,42,.28); backdrop-filter:blur(2px); -webkit-backdrop-filter:blur(2px);
  opacity:0; transition:opacity .18s;
}
.rchat-confirm.rchat-show{ opacity:1; }
.rchat-confirm-card{
  background:#fff; border-radius:16px; padding:20px 18px 15px; width:84%; max-width:280px; text-align:center;
  box-shadow:0 14px 40px rgba(15,23,42,.24);
  transform:translateY(10px) scale(.95); transition:transform .24s cubic-bezier(.33,1.28,.5,1);
}
.rchat-confirm.rchat-show .rchat-confirm-card{ transform:none; }
.rchat-cf-ic{ font-size:30px; line-height:1; margin-bottom:8px; }
.rchat-cf-tt{ font:600 15px 'Rubik',sans-serif; color:#243041; margin-bottom:3px; }
.rchat-cf-sub{ font:400 12px 'Rubik',sans-serif; color:#9aa6b2; margin-bottom:16px; }
.rchat-cf-row{ display:flex; gap:9px; }
.rchat-cf-row button{ flex:1; border:none; border-radius:10px; padding:9px 0; font:500 13px 'Rubik',sans-serif; cursor:pointer; transition:transform .12s, filter .15s, background .15s; }
.rchat-cf-row button:hover{ transform:translateY(-1px); }
.rchat-cf-cancel{ background:#eef2f1; color:#4a5560; }
.rchat-cf-cancel:hover{ background:#e4ebe8; }
.rchat-cf-del{ background:linear-gradient(135deg,#f87171,#ef4444); color:#fff; }
.rchat-cf-del:hover{ filter:brightness(1.05); }

/* ---- טוסט עדין ---- */
.rchat-toast{
  position:absolute; bottom:70px; left:50%; z-index:6; white-space:nowrap; pointer-events:none;
  background:#243041; color:#fff; font:500 12px 'Rubik',sans-serif; padding:8px 15px; border-radius:999px;
  box-shadow:0 6px 18px rgba(15,23,42,.25);
  opacity:0; transform:translateX(-50%) translateY(10px); transition:opacity .22s, transform .22s;
}
.rchat-toast.rchat-show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* ---- חיפוש בבחירת משתמש לשיחה חדשה ---- */
.rchat-search{ padding:9px 12px; border-bottom:1px solid #eef2f1; background:#fff; }
.rchat-search input{ width:100%; border:1px solid #dde3e6; border-radius:9px; padding:7px 11px; font:400 12.5px 'Rubik',sans-serif; outline:none; color:#243041; box-sizing:border-box; }
.rchat-search input:focus{ border-color:#22a757; }
.rchat-search input::placeholder{ color:#9aa6b2; }
