#mozar-chat-widget,
#mozar-chat-widget * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#mozar-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#mozar-chat-toggle {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

#mozar-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(147, 51, 234, 0.65);
}

#mozar-chat-toggle svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}

#mozar-chat-toggle .mozar-chat-close-icon { display: none; }
#mozar-chat-toggle.mozar-chat-open .mozar-chat-close-icon { display: block; }
#mozar-chat-toggle.mozar-chat-open .mozar-chat-open-icon { display: none; }

#mozar-chat-toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(147, 51, 234, 0.4);
  animation: mozar-chat-pulse 2s infinite;
  z-index: -1;
}

@keyframes mozar-chat-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}

#mozar-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 386px;
  max-width: calc(100vw - 32px);
  height: 575px;
  max-height: calc(100vh - 130px);
  background: #0a0710;
  border: 1px solid rgba(160, 100, 220, 0.25);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
}

#mozar-chat-widget.mozar-chat-open #mozar-chat-panel {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#mozar-chat-header {
  background: linear-gradient(135deg, #3d0f5c 0%, #9333ea 100%);
  color: #fff;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(147, 51, 234, 0.3);
}

#mozar-chat-header img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  padding: 4px;
}

#mozar-chat-header-text {
  flex: 1;
}

#mozar-chat-header-text strong {
  font-size: 15px;
  display: block;
}

#mozar-chat-header-text span {
  font-size: 12px;
  opacity: 0.85;
}

#mozar-chat-header-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 3px;
}

#mozar-chat-header-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
}

#mozar-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(ellipse at top, rgba(147, 51, 234, 0.08), transparent 55%),
    #0a0710;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#mozar-chat-body::-webkit-scrollbar { width: 6px; }
#mozar-chat-body::-webkit-scrollbar-thumb { background: #2d1b42; border-radius: 3px; }

.mozar-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  animation: mozar-chat-fadein 0.25s ease;
}

@keyframes mozar-chat-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mozar-chat-msg.mozar-chat-bot {
  align-self: flex-start;
  background: #171022;
  border: 1px solid rgba(160, 100, 220, 0.18);
  border-bottom-left-radius: 6px;
  color: #e8e0f0;
}

.mozar-chat-msg.mozar-chat-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
  border-bottom-right-radius: 6px;
  color: #fff;
}

.mozar-chat-msg.mozar-chat-bot a {
  color: #c084fc;
  font-weight: 600;
  text-decoration: underline;
}

.mozar-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
}

.mozar-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a78bfa;
  animation: mozar-chat-bounce 1.2s infinite;
}

.mozar-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.mozar-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes mozar-chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

#mozar-chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
  background: #0a0710;
  border-top: 1px solid rgba(160, 100, 220, 0.15);
}

.mozar-chat-quick-btn {
  border: 1px solid rgba(147, 51, 234, 0.45);
  background: rgba(147, 51, 234, 0.1);
  color: #c084fc;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.mozar-chat-quick-btn:hover {
  background: rgba(147, 51, 234, 0.25);
  color: #fff;
}

#mozar-chat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(160, 100, 220, 0.2);
  background: #0f0a17;
}

#mozar-chat-input {
  flex: 1;
  border: 1px solid rgba(160, 100, 220, 0.3);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  background: #171022;
  color: #e8e0f0;
  transition: border-color 0.2s ease;
}

#mozar-chat-input::placeholder { color: #6d5a85; }

#mozar-chat-input:focus {
  border-color: #a855f7;
}

#mozar-chat-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

#mozar-chat-send:hover { transform: scale(1.1); }
#mozar-chat-send svg { width: 20px; height: 20px; fill: #fff; margin-left: -2px; }

@media (max-width: 480px) {
  #mozar-chat-panel {
    bottom: 90px;
    right: 12px;
    width: calc(100vw - 24px);
    height: calc(100vh - 110px);
    border-radius: 14px;
  }
  #mozar-chat-toggle { width: 56px; height: 56px; }
}