:root {
  --mpcl-color: #28a745;
}

.mpcl-launcher {
  position: fixed;
  bottom: 22px;
  width: 66px;
  height: 66px;
  border-radius: 33px;
  background: var(--mpcl-color);
  z-index: 999999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mpcl-launcher:hover {
  transform: scale(1.05);
}

.mpcl-launcher svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}

.mpcl-right {
  right: 22px;
}

.mpcl-left {
  left: 22px;
}

.mpcl-window {
  position: fixed;
  bottom: 100px;
  width: 380px;
  height: 600px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(0, 0, 0, .15);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, .08);
  transition: all 0.3s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mpcl-window.mpcl-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.mpcl-header {
  background: var(--mpcl-color);
  background: linear-gradient(135deg, var(--mpcl-color) 0%, #1a8a3a 100%);
  color: #fff;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mpcl-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mpcl-avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.mpcl-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.mpcl-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #4cd137;
  border-radius: 50%;
  border: 2px solid var(--mpcl-color);
  box-shadow: 0 0 0 1px #fff;
}

.mpcl-assistant-details {
  display: flex;
  flex-direction: column;
}

.mpcl-assistant-name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 2px;
}

.mpcl-online-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  opacity: 0.9;
}

.mpcl-pulse {
  width: 6px;
  height: 6px;
  background: #4cd137;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(76, 209, 55, 0.4);
  animation: mpcl-pulse-anim 2s infinite;
}

@keyframes mpcl-pulse-anim {
  0% {
    box-shadow: 0 0 0 0px rgba(76, 209, 55, 0.7);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(76, 209, 55, 0);
  }

  100% {
    box-shadow: 0 0 0 0px rgba(76, 209, 55, 0);
  }
}

.mpcl-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0 5px;
}

.mpcl-close:hover {
  opacity: 1;
}

.mpcl-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.mpcl-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.mpcl-user-wrap {
  align-self: flex-end;
  align-items: flex-end;
}

.mpcl-bot-wrap {
  align-self: flex-start;
  align-items: flex-start;
}

.mpcl-bubble {
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
}

.mpcl-user .mpcl-bubble {
  background: var(--mpcl-color);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.mpcl-bot .mpcl-bubble {
  background: #fff;
  color: #2c3e50;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

/* Links and Images in bubbles */
.mpcl-bubble a {
  color: var(--mpcl-color);
  text-decoration: underline;
  font-weight: 600;
}

.mpcl-bubble a:hover {
  opacity: 0.8;
}

.mpcl-user .mpcl-bubble a {
  color: #fff;
}

.mpcl-bubble img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 8px;
  display: block;
  border: 1px solid #eee;
}

.mpcl-meta {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 5px;
  padding: 0 6px;
}

.mpcl-typing {
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  background: #fff;
  padding: 12px 18px;
  display: none;
  width: fit-content;
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 10px;
}

.mpcl-typing .mpcl-dot {
  height: 7px;
  width: 7px;
  background-color: #9ca3af;
  border-radius: 50%;
  display: inline-block;
  animation: mpcl-bounce 1.3s infinite ease-in-out;
  margin-right: 4px;
}

.mpcl-typing .mpcl-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.mpcl-typing .mpcl-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes mpcl-bounce {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.mpcl-input-area {
  padding: 16px 20px;
  background: #fff;
  border-top: 1px solid #f3f4f6;
}

.mpcl-input-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
}

#mpcl-text {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 25px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#mpcl-text:focus {
  border-color: var(--mpcl-color);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

#mpcl-send {
  background: var(--mpcl-color);
  border: 0;
  color: #fff;
  height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s;
  gap: 8px;
}

#mpcl-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

#mpcl-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

#mpcl-send span {
  display: inline;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .mpcl-window {
    width: 100vw;
    height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }

  #mpcl-send span {
    display: none;
  }

  #mpcl-send {
    width: 44px;
    padding: 0;
    border-radius: 50%;
  }
}