@charset "UTF-8";

/* ══ Chatbot Widget — Compact Floating Bubble + Panel ════════════════════════ */
.cb-bubble{
  position:fixed;bottom:90px;left:16px;z-index:998;
  width:54px;height:54px;border-radius:50%;
  background:#fff;
  padding:3px;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;overflow:hidden;
  box-shadow:0 6px 20px rgba(99,102,241,.4),0 2px 8px rgba(0,0,0,.28),inset 0 0 0 1px rgba(255,255,255,.9);
  border:none;color:#fff;
  transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s ease;
  /* تثبيت على طبقة GPU خاصة — نفس علة "الطفو" اللي بتصيب site-bottom-nav في سفاري iOS.
     transform موجود دايما (حتى في الحالة الافتراضية) عشان الطبقة تفضل ثابتة؛
     كل transform:scale() تحت لازم يترص جنبه translateZ(0) مش يستبدله. */
  transform:translateZ(0);
  -webkit-backface-visibility:hidden;backface-visibility:hidden;
}
.cb-bubble:hover{transform:translateZ(0) scale(1.08);box-shadow:0 8px 26px rgba(99,102,241,.55),0 2px 8px rgba(0,0,0,.3)}
.cb-bubble:active{transform:translateZ(0) scale(.94)}
.cb-bubble svg{width:24px;height:24px}
/* صورة البوت داخل الفقاعة — دائرية، تملأ النص مع إطار أبيض رفيع متناسق */
.cb-bubble img{width:100%;height:100%;border-radius:50%;object-fit:cover;object-position:center top;display:block}
@keyframes cbPulse{
  0%,100%{box-shadow:0 6px 20px rgba(99,102,241,.45),inset 0 1px 0 rgba(255,255,255,.25),0 0 0 0 rgba(99,102,241,.45)}
  70%{box-shadow:0 6px 20px rgba(99,102,241,.45),inset 0 1px 0 rgba(255,255,255,.25),0 0 0 12px rgba(99,102,241,0)}
}
.cb-bubble.hidden{opacity:0;pointer-events:none;transform:translateZ(0) scale(.7)}

/* Backdrop خلف ال modal */
.cb-backdrop{
  position:fixed;inset:0;z-index:998;
  background:rgba(5,7,15,.8);
  display:none;
  animation:cbBackIn .2s ease-out;
}
.cb-backdrop.open{display:block}
@keyframes cbBackIn{from{opacity:0} to{opacity:1}}

/* Lock body scroll عند فتح المودال */
body.cb-locked{overflow:hidden!important;position:fixed;width:100%;left:0;right:0}

/* Chat Panel — مودال منبثق في المنتصف */
.cb-panel{
  position:fixed;top:50%;left:50%;z-index:999;
  transform:translate(-50%,-50%);
  width:340px;max-width:calc(100vw - 24px);
  height:480px;max-height:calc(100vh - 60px);
  background:#0d0e14;
  border-radius:20px;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 24px 60px rgba(0,0,0,.7),0 0 0 1px rgba(99,102,241,.12) inset;
  display:none;flex-direction:column;overflow:hidden;
  font-family:'Cairo',sans-serif;
  animation:cbPanelIn .28s cubic-bezier(.34,1.36,.64,1);
}
.cb-panel.open{display:flex}
@keyframes cbPanelIn{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.9)}
  100%{opacity:1;transform:translate(-50%,-50%) scale(1)}
}

.cb-header{
  padding:14px 14px;
  background:
    radial-gradient(circle at 88% 40%, rgba(255,255,255,.12), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(0,0,0,.18), transparent 45%),
    linear-gradient(135deg,#0f172a 0%,#1e293b 50%,#312e81 100%);
  display:flex;align-items:center;gap:12px;
  position:relative;flex-shrink:0;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.cb-header::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:2px;
  background:linear-gradient(90deg,transparent,rgba(99,102,241,.6),transparent);
  pointer-events:none;
}
.cb-avatar{
  width:48px;height:48px;border-radius:50%;
  background:linear-gradient(135deg,#fde68a 0%,#fbbf24 60%,#d97706 100%);
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;overflow:hidden;
  border:2.5px solid rgba(255,255,255,.85);
  box-shadow:0 4px 12px rgba(0,0,0,.4),0 0 0 1px rgba(99,102,241,.4);
  position:relative;
}
.cb-avatar svg,.cb-avatar img{width:100%;height:100%;display:block;object-fit:cover;object-position:center}
.cb-header-info{flex:1;min-width:0}
.cb-header-name{
  color:#fff;font-weight:900;font-size:16px;margin:0;line-height:1.2;
  letter-spacing:.2px;
  text-shadow:0 1px 2px rgba(0,0,0,.4);
  display:flex;align-items:center;gap:5px;
}
.cb-header-name .cb-verified{
  width:15px;height:15px;background:#0ea5e9;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:10px;color:#fff;font-weight:900;
  box-shadow:0 0 0 1.5px #0d0e14,0 0 8px rgba(14,165,233,.6);
}
.cb-header-status{color:rgba(167,243,208,.95);font-size:11px;font-weight:700;margin-top:3px;display:flex;align-items:center;gap:5px}
.cb-status-dot{width:7px;height:7px;border-radius:50%;background:#4ade80;box-shadow:0 0 6px rgba(74,222,128,.9);animation:cbDotPulse 1.8s ease-in-out infinite}
@keyframes cbDotPulse{0%,100%{box-shadow:0 0 6px rgba(74,222,128,.9),0 0 0 0 rgba(74,222,128,.5)} 50%{box-shadow:0 0 6px rgba(74,222,128,.9),0 0 0 5px rgba(74,222,128,0)}}
.cb-close{
  background:rgba(0,0,0,.18);border:none;color:#fff;
  width:26px;height:26px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
  transition:background .2s ease;
}
.cb-close:hover{background:rgba(0,0,0,.3)}
.cb-close svg{width:13px;height:13px}

.cb-messages{
  flex:1;overflow-y:auto;padding:12px 11px;
  display:flex;flex-direction:column;gap:8px;
  background:linear-gradient(180deg,#0d0e14 0%,#0a0b10 100%);
  scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent;
}
.cb-messages::-webkit-scrollbar{width:4px}
.cb-messages::-webkit-scrollbar-thumb{background:rgba(255,255,255,.15);border-radius:8px}

.cb-msg{
  max-width:88%;padding:9px 12px;border-radius:14px;
  font-size:12.5px;line-height:1.6;white-space:pre-wrap;word-wrap:break-word;
  animation:cbMsgIn .22s ease-out;
}
@keyframes cbMsgIn{from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)}}
.cb-msg.bot{
  background:rgba(255,255,255,.05);
  color:#e2e4ee;
  border:1px solid rgba(255,255,255,.06);
  border-bottom-right-radius:5px;
  align-self:flex-start;
}
.cb-msg.user{
  background:linear-gradient(135deg,#6366f1,#0ea5e9);
  color:#fff;font-weight:600;
  border-bottom-left-radius:5px;
  align-self:flex-end;
}
.cb-typing{
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.06);
  padding:11px 14px;border-radius:14px;
  align-self:flex-start;display:inline-flex;gap:3px;align-items:center;
}
.cb-typing span{
  width:6px;height:6px;border-radius:50%;background:#7a7f96;
  animation:cbDot 1.4s ease-in-out infinite;
}
.cb-typing span:nth-child(2){animation-delay:.2s}
.cb-typing span:nth-child(3){animation-delay:.4s}
@keyframes cbDot{0%,80%,100%{transform:scale(.6);opacity:.3} 40%{transform:scale(1);opacity:1}}

/* Suggestions — تابات مدمجة (chip-style) */
.cb-suggestions{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px;align-self:stretch}
.cb-suggestion-label{font-size:10px;color:#7a7f96;font-weight:700;width:100%;margin-bottom:1px}
.cb-suggestion{
  background:rgba(99,102,241,.1);
  border:1px solid rgba(99,102,241,.25);
  color:#a5b4fc;font-size:11px;font-weight:700;
  padding:5px 10px;border-radius:14px;
  cursor:pointer;text-align:right;
  transition:.18s ease;font-family:inherit;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  max-width:100%;
}
.cb-suggestion:hover{background:rgba(99,102,241,.2);color:#c7d2fe;transform:translateY(-1px)}

/* Feedback buttons — أصغر */
.cb-feedback{display:flex;gap:5px;margin-top:4px;align-self:flex-start}
.cb-fb-btn{
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  color:#a8acc0;font-size:10px;font-weight:700;
  padding:3px 9px;border-radius:7px;cursor:pointer;
  display:inline-flex;align-items:center;gap:3px;
  transition:.18s ease;font-family:inherit;
}
.cb-fb-btn:hover{background:rgba(255,255,255,.1);color:#fff}
.cb-fb-btn.selected{background:rgba(74,222,128,.15);color:#4ade80;border-color:rgba(74,222,128,.3)}
.cb-fb-btn.selected-bad{background:rgba(244,67,54,.15);color:#ff8a80;border-color:rgba(244,67,54,.3)}

/* WhatsApp button */
.cb-wa-btn{
  display:inline-flex;align-items:center;gap:5px;
  background:linear-gradient(135deg,#25d366,#128c7e);color:#fff;
  font-size:11.5px;font-weight:800;padding:6px 11px;border-radius:10px;
  text-decoration:none;align-self:flex-start;margin-top:3px;
  transition:.2s ease;
}
.cb-wa-btn:hover{transform:translateY(-1px);box-shadow:0 4px 10px rgba(37,211,102,.35)}
.cb-wa-btn svg{width:12px;height:12px}

/* Input area */
.cb-input-area{
  padding:9px 11px;
  border-top:1px solid rgba(255,255,255,.06);
  background:rgba(0,0,0,.2);
  display:flex;gap:6px;align-items:center;flex-shrink:0;
}
.cb-input{
  flex:1;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  color:#fff;
  padding:8px 13px;border-radius:20px;
  font-size:12.5px;font-family:inherit;
  outline:none;transition:border-color .2s;
}
.cb-input:focus{border-color:rgba(99,102,241,.5)}
.cb-send{
  width:34px;height:34px;border-radius:50%;
  background:linear-gradient(135deg,#06b6d4,#6366f1);
  border:none;color:#fff;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;transition:.2s ease;
}
.cb-send:hover{transform:scale(1.05);box-shadow:0 4px 10px rgba(99,102,241,.4)}
.cb-send:disabled{opacity:.5;cursor:not-allowed;transform:none}
.cb-send svg{width:15px;height:15px}

.cb-powered{
  font-size:9px;color:#5a5d72;text-align:center;
  padding:4px;border-top:1px solid rgba(255,255,255,.04);
  font-weight:600;background:rgba(0,0,0,.25);
}

@media(max-width:480px){
  .cb-bubble{width:46px;height:46px;bottom:82px;left:12px}
  .cb-bubble svg{width:22px;height:22px}
  .cb-panel{
    width:calc(100vw - 20px);
    max-width:calc(100vw - 20px);
    height:calc(100dvh - 100px);
    max-height:calc(100dvh - 100px);
  }
}
