/* SetelanAnak WhatsApp Chat Widget */
.sawc-widget {
  position: fixed;
  bottom: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.sawc-widget.sawc-right { right: 24px; }
.sawc-widget.sawc-left  { left: 24px; }

/* Floating Button */
.sawc-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sawc-color, #25D366);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: all 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
  font-size: 14px;
  font-weight: 600;
  position: relative;
  animation: sawcPulse 2.5s infinite;
}
.sawc-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(37,211,102,0.5);
}
@keyframes sawcPulse {
  0%,100% { box-shadow: 0 4px 20px rgba(37,211,102,0.4); }
  50%      { box-shadow: 0 4px 30px rgba(37,211,102,0.7), 0 0 0 8px rgba(37,211,102,0.1); }
}
.sawc-btn-icon svg { display: block; }
.sawc-btn-label { white-space: nowrap; }
.sawc-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #FF4444;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* Popup */
.sawc-popup {
  position: absolute;
  bottom: 70px;
  width: 320px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 60px rgba(0,0,0,0.2);
  overflow: hidden;
  transform: scale(0.8) translateY(20px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
}
.sawc-widget.sawc-right .sawc-popup { right: 0; }
.sawc-widget.sawc-left  .sawc-popup { left: 0; transform-origin: bottom left; }
.sawc-popup.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.sawc-popup-header {
  background: var(--sawc-header, #075E54);
  padding: 16px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.sawc-header-icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sawc-header-text { flex: 1; }
.sawc-header-title {
  color: white;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}
.sawc-header-sub {
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  margin-top: 2px;
}
.sawc-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.sawc-close-btn:hover { background: rgba(255,255,255,0.3); }

/* Agents list */
.sawc-agents-list { max-height: 320px; overflow-y: auto; }
.sawc-agents-list::-webkit-scrollbar { width: 4px; }
.sawc-agents-list::-webkit-scrollbar-thumb { background: #25D366; border-radius: 4px; }

.sawc-agent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s;
}
.sawc-agent-item:hover {
  background: #f0fdf4;
  text-decoration: none;
  color: inherit;
}
.sawc-agent-item:last-child { border-bottom: none; }

/* Avatar */
.sawc-agent-avatar {
  position: relative;
  flex-shrink: 0;
}
.sawc-agent-avatar img,
.sawc-avatar-initials {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
}
.sawc-avatar-initials {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}
.sawc-status-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid white;
}
.sawc-status-dot.online  { background: #44b700; }
.sawc-status-dot.offline { background: #ccc; }

/* Agent info */
.sawc-agent-info { flex: 1; min-width: 0; }
.sawc-agent-name {
  font-weight: 700;
  font-size: 14px;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sawc-agent-label {
  font-size: 11px;
  color: #888;
  margin-top: 1px;
}
.sawc-agent-status {
  font-size: 11px;
  margin-top: 3px;
  font-weight: 600;
}
.sawc-agent-status.online  { color: #44b700; }
.sawc-agent-status.offline { color: #999; }

/* Arrow */
.sawc-agent-arrow { color: #ccc; flex-shrink: 0; }
.sawc-agent-item:hover .sawc-agent-arrow { color: #25D366; }

/* Footer */
.sawc-popup-footer {
  padding: 10px;
  text-align: center;
  font-size: 11px;
  color: #aaa;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-top: 1px solid #f0f0f0;
}

/* Responsive */
@media (max-width: 480px) {
  .sawc-popup { width: 290px; }
  .sawc-btn-label { display: none; }
  .sawc-btn { padding: 14px; border-radius: 50%; }
  .sawc-widget.sawc-right { right: 16px; bottom: 16px; }
  .sawc-widget.sawc-left  { left: 16px; bottom: 16px; }
}
