/* =========================================================================
   Phone Plugin — Floating Softphone Widget
   /plugins/phone/phone.css
   ========================================================================= */

/* ── AppBar Button ──────────────────────────────────────────────────────── */
#phonePluginAppBarBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s, transform 0.15s;
  margin-right: 10px;
  flex-shrink: 0;
}

#phonePluginAppBarBtn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.08);
}

#phonePluginAppBarBtn .phone-icon {
  font-size: 16px;
  color: #fff;
  transition: color 0.3s;
}

/* Status dot on AppBar button */
#phonePluginStatusDot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #1a2035;
  background: #6b7280;
  transition: background 0.4s;
}

#phonePluginStatusDot.status-available { background: #22c55e; }
#phonePluginStatusDot.status-dnd       { background: #ef4444; }
#phonePluginStatusDot.status-away      { background: #f59e0b; }
#phonePluginStatusDot.status-unavailable { background: #6b7280; }

.phone-status-available .phone-icon { color: #22c55e; }
.phone-status-dnd .phone-icon       { color: #ef4444; }

/* Pulse animation for active call */
@keyframes phonePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.phone-pulse { animation: phonePulse 1.4s ease-out infinite; }

@keyframes phonePulseRed {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.phone-pulse-red { animation: phonePulseRed 1.4s ease-out infinite; }

/* ── Floating Widget ────────────────────────────────────────────────────── */
#phonePluginWidget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 320px;
  z-index: 99999;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  transform: translateY(30px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
}

#phonePluginWidget.phone-widget-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.phone-card {
  background: linear-gradient(145deg, #1a2035 0%, #121827 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  overflow: hidden;
}

/* Header */
.phone-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.phone-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22c55e;
  font-size: 14px;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.phone-header-icon.calling {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.phone-header-icon.active {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.phone-header-icon.on-hold {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.phone-header-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
}

.phone-header-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 1px;
}

.phone-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  transition: background 0.2s, color 0.2s;
}

.phone-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Body */
.phone-card-body {
  padding: 20px 18px;
}

/* Customer Display (masked — name only, no number) */
.phone-customer-display {
  text-align: center;
  margin-bottom: 20px;
}

.phone-customer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 12px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.phone-customer-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-call-status-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.phone-call-status-text.status-calling { color: #fbbf24; }
.phone-call-status-text.status-active  { color: #22c55e; }
.phone-call-status-text.status-hold    { color: #f59e0b; }

/* Call Timer */
#phoneCallTimer {
  font-size: 24px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.08em;
  text-align: center;
  margin: 6px 0 18px;
  font-variant-numeric: tabular-nums;
  display: none;
}

/* Calling animation dots */
.phone-calling-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}
.phone-calling-dots span {
  width: 4px;
  height: 4px;
  background: #fbbf24;
  border-radius: 50%;
  animation: bounceDot 1.2s ease-in-out infinite;
}
.phone-calling-dots span:nth-child(2) { animation-delay: 0.15s; }
.phone-calling-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* Action Buttons */
.phone-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.phone-actions.phone-actions-single {
  grid-template-columns: 1fr;
}

.phone-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 8px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.phone-btn i {
  font-size: 18px;
  margin-bottom: 1px;
}

.phone-btn:hover {
  transform: translateY(-2px);
}

.phone-btn:active {
  transform: scale(0.96);
}

.phone-btn-end {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  grid-column: 1 / -1;
}
.phone-btn-end:hover {
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.5);
}

.phone-btn-hold {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fbbf24;
}
.phone-btn-hold:hover {
  background: rgba(251, 191, 36, 0.18);
}
.phone-btn-hold.active {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.5);
}

.phone-btn-panel {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
}
.phone-btn-panel:hover {
  background: rgba(99, 102, 241, 0.18);
}

.phone-btn-mute {
  background: rgba(156, 163, 175, 0.1);
  border: 1px solid rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}
.phone-btn-mute:hover {
  background: rgba(156, 163, 175, 0.18);
}
.phone-btn-mute.muted {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Divider */
.phone-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 16px 0 14px;
}

/* Extension Badge */
.phone-extension-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.03em;
}

.phone-extension-badge i {
  font-size: 10px;
}

/* ── Ghost iFrame Tamper-Proofing ────────────────────────────────────────── */
.phone-ghost-3cx {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  top: -9999px !important;
  left: -9999px !important;
  opacity: 0.001 !important;
  pointer-events: none !important;
  z-index: -9999 !important;
  border: none !important;
  visibility: visible !important;
  display: block !important;
}


