/* ============================================================================
   ClickSa Softphone — Dialer (global): الزر العائم + اللوحة المنبثقة. RTL عربي.
   (نقاط الحالة .cs-dot معرّفة في cs-popup.css)
   ============================================================================ */

.cs-dialer {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;   /* RTL: يمين الشاشة في العربي */
  z-index: 1070;
  font-family: 'Cairo', 'Tajawal', 'Segoe UI', Arial, sans-serif;
}

/* ===== الزر العائم ===== */
.cs-fab {
  width: 56px; height: 56px; border-radius: 50%;
  border: none; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-inline-start: auto;
  box-shadow: 0 6px 20px rgba(15, 41, 66, .28);
  transition: transform .18s, background .2s;
}
.cs-fab:hover { transform: scale(1.05); }
.cs-fab:active { transform: scale(.96); }
.cs-fab.ready      { background: #1D9E75; }
.cs-fab.connecting { background: #BA7517; }
.cs-fab.error      { background: #E24B4A; }
.cs-fab.active     { background: #0F2942; }

/* ===== اللوحة المنبثقة ===== */
.cs-dial-panel {
  width: 280px;
  background: #fff;
  border: 0.5px solid #E3E7EC;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 12px 40px rgba(15, 41, 66, .2);
  animation: cs-dial-in .24s cubic-bezier(.2, .8, .2, 1);
}
@keyframes cs-dial-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* شريط الحالة */
.cs-dial-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; border-bottom: 0.5px solid #E3E7EC;
}
.cs-dial-status { display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #5A6573; }
.cs-dial-close {
  background: none; border: none; cursor: pointer;
  color: #8A94A1; font-size: 18px; display: flex; padding: 2px;
}
.cs-dial-close:hover { color: #1A1A1A; }

/* خانة الرقم */
.cs-dial-display {
  display: flex; align-items: center; gap: 6px;
  margin: 12px 0;
}
.cs-dial-input {
  flex: 1; border: none; background: transparent;
  text-align: center; font-size: 22px; letter-spacing: 2px;
  color: #1A1A1A; font-family: inherit; padding: 4px 0;
  direction: ltr;  /* الأرقام LTR */
}
.cs-dial-input:focus { outline: none; }
.cs-dial-input::placeholder { color: #B7C0CC; font-size: 16px; letter-spacing: 0; }
.cs-dial-bksp {
  background: none; border: none; cursor: pointer;
  color: #8A94A1; font-size: 20px; display: flex; padding: 4px;
}
.cs-dial-bksp:hover { color: #E24B4A; }

/* لوحة الأرقام */
.cs-dial-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.cs-key {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px;
  padding: 10px 0; border: none; border-radius: 10px;
  background: #F7F8FA; cursor: pointer; font-family: inherit;
  transition: background .12s;
}
.cs-key:hover  { background: #E6F1FB; }
.cs-key:active { background: #B5D4F4; }
.cs-key-num { font-size: 20px; color: #1A1A1A; line-height: 1.1; }
.cs-key-letters { font-size: 9px; color: #8A94A1; letter-spacing: 1px; }

/* زر الاتصال */
.cs-dial-call {
  width: 100%; margin-top: 12px;
  background: #1D9E75; color: #fff; border: none;
  border-radius: 10px; padding: 12px; font-size: 15px;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s;
}
.cs-dial-call:hover { background: #0F6E56; }
.cs-dial-call.disabled {
  background: #D3D1C7; cursor: not-allowed; opacity: .7;
}

/* تجاوب الجوال */
@media (max-width: 480px) {
  .cs-dialer { inset-inline-end: 12px; bottom: 12px; }
  .cs-dial-panel { width: calc(100vw - 24px); max-width: 320px; }
}
