/* AAA Appointment Bot Widget */
#aaa-chat-widget {
  --aaa-primary: #2563eb;
  --aaa-primary-dark: #1d4ed8;
  --aaa-bg: #ffffff;
  --aaa-text: #1f2937;
  --aaa-text-light: #6b7280;
  --aaa-border: #e5e7eb;
  --aaa-user-bg: #2563eb;
  --aaa-bot-bg: #f3f4f6;
  
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
}

/* Chat Toggle Button */
#aaa-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--aaa-primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

#aaa-chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

#aaa-chat-toggle svg {
  width: 28px;
  height: 28px;
  fill: white;
}

/* Chat Window */
#aaa-chat-window {
  display: none;
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  height: 520px;
  background: var(--aaa-bg);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  flex-direction: column;
}

#aaa-chat-window.open {
  display: flex;
}

/* Header */
#aaa-chat-header {
  background: var(--aaa-primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#aaa-chat-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

#aaa-chat-header-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

#aaa-chat-header-text p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

#aaa-chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  opacity: 0.8;
}

#aaa-chat-close:hover {
  opacity: 1;
}

/* Messages Area */
#aaa-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aaa-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  animation: aaa-fadeIn 0.3s ease;
}

@keyframes aaa-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.aaa-message.bot {
  background: var(--aaa-bot-bg);
  color: var(--aaa-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.aaa-message.bot a {
  color: var(--aaa-primary);
  text-decoration: underline;
  word-break: break-all;
  font-weight: 500;
}

.aaa-message.bot a:hover {
  color: var(--aaa-primary-dark);
}

.aaa-message.user {
  background: var(--aaa-user-bg);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.aaa-typing {
  display: flex;
  gap: 4px;
  padding: 16px;
}

.aaa-typing span {
  width: 8px;
  height: 8px;
  background: var(--aaa-text-light);
  border-radius: 50%;
  animation: aaa-bounce 1.4s infinite;
}

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

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

/* Input Area */
#aaa-chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--aaa-border);
  display: flex;
  gap: 8px;
}

#aaa-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--aaa-border);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#aaa-chat-input:focus {
  border-color: var(--aaa-primary);
}

#aaa-chat-send {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--aaa-primary);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#aaa-chat-send:hover {
  background: var(--aaa-primary-dark);
}

#aaa-chat-send:disabled {
  background: var(--aaa-border);
  cursor: not-allowed;
}

#aaa-chat-send svg {
  width: 20px;
  height: 20px;
}

/* Powered by */
#aaa-powered {
  text-align: center;
  padding: 8px;
  font-size: 11px;
  color: var(--aaa-text-light);
}

/* Mobile Responsive */
@media (max-width: 480px) {
  #aaa-chat-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    bottom: 70px;
    right: -10px;
    border-radius: 16px 16px 0 0;
  }
}
