/* FLOATING ACTIONS CONTAINER */
.maa-chat-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* FLOATING TRIGGER BUTTON */
.maa-chat-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #111315;
  border: 2px solid #c89b55;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.maa-chat-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(200, 155, 85, 0.3);
}

.maa-chat-trigger svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  transition: transform 0.3s;
}

.maa-chat-trigger.active svg {
  transform: rotate(90deg);
}

/* Unread message badge */
.maa-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #c89b55;
  color: #111315;
  font-size: 11px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #111315;
  animation: pulse 2s infinite;
}

/* MULTI-ACTION SUBMENU */
.maa-chat-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 15px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.maa-chat-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.maa-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: right;
  transition: transform 0.2s;
}

.maa-menu-item:hover {
  transform: translateX(-4px);
}

.maa-menu-label {
  background: rgba(17, 19, 21, 0.95);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 1px solid rgba(200, 155, 85, 0.3);
  white-space: nowrap;
}

.maa-menu-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  border: none;
  cursor: pointer;
  transition: scale 0.2s;
}

.maa-menu-btn:hover {
  transform: scale(1.05);
}

.maa-menu-btn.whatsapp {
  background: #25D366;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3);
}

.maa-menu-btn.livechat {
  background: #c89b55;
  box-shadow: 0 6px 18px rgba(200, 155, 85, 0.3);
}

.maa-menu-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* CHAT WINDOW MODAL */
.maa-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 370px;
  height: 520px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(221, 225, 227, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9) translateY(20px);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.maa-chat-window.show {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

/* HEADER */
.maa-chat-header {
  background: #111315;
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #c89b55;
}

.maa-chat-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.maa-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #c89b55;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111315;
  font-weight: 800;
  font-size: 15px;
}

.maa-chat-info h4 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.maa-chat-status {
  font-size: 11px;
  color: #8f989f;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.maa-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25d366;
}

.maa-status-dot.offline {
  background: #8f989f;
}

.maa-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.maa-chat-minimize,
.maa-chat-close {
  background: transparent;
  border: none;
  color: #8f989f;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  border-radius: 4px;
}

.maa-chat-minimize:hover,
.maa-chat-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* BODY - ONBOARDING FORM */
.maa-chat-onboard {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow-y: auto;
  justify-content: center;
}

.maa-chat-onboard p {
  font-size: 13px;
  color: #667078;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 5px;
}

.maa-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.maa-form-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8f989f;
  font-weight: 700;
}

.maa-form-group input,
.maa-form-group textarea {
  border: 1px solid #dde1e3;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.maa-form-group input:focus,
.maa-form-group textarea:focus {
  border-color: #c89b55;
}

.maa-chat-onboard button {
  background: #111315;
  color: #fff;
  border: 1px solid #111315;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}

.maa-chat-onboard button:hover {
  background: #c89b55;
  border-color: #c89b55;
}

/* BODY - CHAT THREAD */
.maa-chat-thread {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.maa-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
}

.maa-msg.user {
  background: #111315;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.maa-msg.admin {
  background: #ffffff;
  color: #111315;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid #dde1e3;
}

.maa-msg.system {
  background: rgba(221, 225, 227, 0.6);
  color: #667078;
  align-self: center;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  max-width: 90%;
  border-radius: 6px;
  padding: 4px 10px;
}

.maa-msg-time {
  font-size: 9px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
  text-align: right;
}

.maa-msg.admin .maa-msg-time {
  color: #8f989f;
}

/* TYPING INDICATOR */
.maa-typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #dde1e3;
  padding: 8px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  align-self: flex-start;
  font-size: 12px;
  color: #8f989f;
}

.maa-dot {
  width: 5px;
  height: 5px;
  background: #c89b55;
  border-radius: 50%;
  animation: bounce 1.3s infinite;
}

.maa-dot:nth-child(2) { animation-delay: 0.15s; }
.maa-dot:nth-child(3) { animation-delay: 0.3s; }

/* FOOTER INPUT AREA */
.maa-chat-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #dde1e3;
  display: flex;
  align-items: center;
  gap: 10px;
}

.maa-chat-input {
  flex: 1;
  border: 1px solid #dde1e3;
  border-radius: 20px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
  transition: border-color 0.2s;
}

.maa-chat-input:focus {
  border-color: #c89b55;
}

.maa-chat-send {
  background: #111315;
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.maa-chat-send:hover {
  background: #c89b55;
}

.maa-chat-send svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transform: translateX(1px);
}

/* KEYFRAMES Animations */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(200, 155, 85, 0.6); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(200, 155, 85, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(200, 155, 85, 0); }
}

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* Responsive adjustment for chat window */
@media(max-width: 480px) {
  .maa-chat-container {
    bottom: 20px;
    right: 20px;
  }
  .maa-chat-window {
    width: calc(100vw - 40px);
    height: 480px;
    bottom: 70px;
  }
}

/* IN-WIDGET CONFIRMATION OVERLAY */
.maa-chat-confirm-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 19, 21, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.maa-chat-confirm-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.maa-confirm-box {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  max-width: 310px;
  width: 100%;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.maa-chat-confirm-overlay.show .maa-confirm-box {
  transform: scale(1);
}

.maa-confirm-icon {
  font-size: 32px;
  margin-bottom: 8px;
  line-height: 1;
}

.maa-confirm-text {
  font-size: 14px;
  font-weight: 700;
  color: #111315;
  margin-bottom: 18px;
  line-height: 1.4;
}

.maa-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.maa-confirm-btn {
  width: 100%;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}

.maa-confirm-btn:active {
  transform: scale(0.98);
}

.maa-confirm-btn.danger {
  background: #d93025;
  color: #ffffff;
}

.maa-confirm-btn.danger:hover {
  background: #b8251b;
}

.maa-confirm-btn.cancel {
  background: #f1f3f4;
  color: #3c4043;
}

.maa-confirm-btn.cancel:hover {
  background: #e8eaed;
}

