/* AMerryClean AI Chat Widget */
.amc-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0C71C3, #1B3A5C);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(12,113,195,.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.amc-chat-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(12,113,195,.55); }
.amc-chat-btn svg { width: 28px; height: 28px; fill: #fff; }
.amc-chat-btn .amc-close { display: none; }
.amc-chat-btn.open .amc-open { display: none; }
.amc-chat-btn.open .amc-close { display: block; }

/* Notification dot */
.amc-chat-btn::after {
  content: '';
  position: absolute;
  top: 2px; right: 2px;
  width: 14px; height: 14px;
  background: #ff4444;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: amc-pulse 2s infinite;
}
.amc-chat-btn.open::after { display: none; }

@keyframes amc-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: .7; }
}

/* Chat Window */
.amc-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,.18);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(.95);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.amc-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.amc-chat-header {
  background: linear-gradient(135deg, #1B3A5C, #0C71C3);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.amc-chat-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.amc-chat-avatar svg { width: 22px; height: 22px; fill: #fff; }
.amc-chat-header-info h4 {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
}
.amc-chat-header-info p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: .85;
}

/* Messages */
.amc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 340px;
  scroll-behavior: smooth;
}
.amc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  font-family: 'Open Sans', sans-serif;
  word-wrap: break-word;
}
.amc-msg a { color: #0C71C3; text-decoration: underline; }
.amc-msg-bot {
  background: #f0f4f8;
  color: #1a1a1a;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.amc-msg-user {
  background: #0C71C3;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.amc-msg-bot strong { font-weight: 600; }

/* Quick reply buttons */
.amc-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
}
.amc-quick-btn {
  background: #e8f0fe;
  color: #0C71C3;
  border: 1px solid #c4d9f2;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: 'Open Sans', sans-serif;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.amc-quick-btn:hover { background: #0C71C3; color: #fff; }

/* Typing indicator */
.amc-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: #f0f4f8;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  max-width: 60px;
}
.amc-typing span {
  width: 7px; height: 7px;
  background: #999;
  border-radius: 50%;
  animation: amc-bounce .6s infinite alternate;
}
.amc-typing span:nth-child(2) { animation-delay: .2s; }
.amc-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes amc-bounce {
  to { transform: translateY(-5px); opacity: .5; }
}

/* Input */
.amc-chat-input {
  display: flex;
  align-items: center;
  border-top: 1px solid #e5e7eb;
  padding: 10px 12px;
  gap: 8px;
}
.amc-chat-input input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: 'Open Sans', sans-serif;
  outline: none;
  transition: border-color .2s;
}
.amc-chat-input input:focus { border-color: #0C71C3; }
.amc-chat-input button {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #0C71C3;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.amc-chat-input button:hover { background: #1B3A5C; }
.amc-chat-input button svg { width: 18px; height: 18px; fill: #fff; }
.amc-chat-input button:disabled { opacity: .5; cursor: not-allowed; }

/* Mobile */
@media (max-width: 480px) {
  .amc-chat-window {
    right: 0; left: 0; bottom: 0;
    width: 100%;
    max-height: 100vh;
    border-radius: 16px 16px 0 0;
  }
  .amc-chat-btn { bottom: 16px; right: 16px; }
}
