/* ============================================
   Atlas AI Chatbot Widget Styles
   ============================================ */

/* Floating Chat Button */
#atlas-chat-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  background: #ffd200;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  outline: none;
}

#atlas-chat-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 32px rgba(0,0,0,0.35);
}

#atlas-chat-bubble svg {
  width: 28px;
  height: 28px;
  fill: #151c27;
  transition: opacity 0.2s;
}

/* Notification dot */
#atlas-chat-bubble .chat-notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: pulse-dot 2s infinite;
}

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

/* Chat Window */
#atlas-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 9998;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
  transform-origin: bottom right;
}

#atlas-chat-window.atlas-chat-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Chat Header */
#atlas-chat-header {
  background: #151c27;
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.atlas-chat-avatar {
  width: 38px;
  height: 38px;
  background: #ffd200;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.atlas-chat-avatar svg {
  width: 20px;
  height: 20px;
  fill: #151c27;
}

.atlas-chat-header-info {
  flex: 1;
}

.atlas-chat-header-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.atlas-chat-header-info p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #ffd200;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 5px;
}

.atlas-online-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
}

#atlas-chat-close {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

#atlas-chat-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

#atlas-chat-close svg {
  width: 18px;
  height: 18px;
}

/* Messages Area */
#atlas-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  background: #f9f9ff;
}

#atlas-chat-messages::-webkit-scrollbar {
  width: 4px;
}
#atlas-chat-messages::-webkit-scrollbar-thumb {
  background: #d1c6ab;
  border-radius: 4px;
}

/* Message Bubbles */
.atlas-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 88%;
  animation: msg-in 0.3s ease;
}

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

.atlas-msg.atlas-msg-bot {
  align-self: flex-start;
}

.atlas-msg.atlas-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.atlas-msg-avatar {
  width: 28px;
  height: 28px;
  background: #151c27;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.atlas-msg-avatar svg {
  width: 15px;
  height: 15px;
  fill: #ffd200;
}

.atlas-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
  word-break: break-word;
}

.atlas-msg-bot .atlas-msg-bubble {
  background: #ffffff;
  color: #151c27;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.atlas-msg-user .atlas-msg-bubble {
  background: #151c27;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.atlas-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-items: center;
}

.atlas-typing-indicator span {
  width: 7px;
  height: 7px;
  background: #aaa;
  border-radius: 50%;
  display: inline-block;
  animation: bounce-dot 1.2s infinite;
}

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

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

/* Quick Replies */
#atlas-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
  background: #f9f9ff;
}

.atlas-quick-btn {
  background: #fff;
  border: 1px solid #d1c6ab;
  color: #151c27;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.atlas-quick-btn:hover {
  background: #ffd200;
  border-color: #ffd200;
  color: #151c27;
  font-weight: 600;
}

/* Input Area */
#atlas-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e8e8e8;
  background: #fff;
  flex-shrink: 0;
}

#atlas-chat-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  color: #151c27;
  outline: none;
  background: #f9f9ff;
  resize: none;
  transition: border-color 0.2s;
  line-height: 1.4;
}

#atlas-chat-input:focus {
  border-color: #ffd200;
}

#atlas-chat-send {
  width: 40px;
  height: 40px;
  background: #ffd200;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

#atlas-chat-send:hover {
  background: #e6bd00;
  transform: scale(1.05);
}

#atlas-chat-send:disabled {
  background: #ddd;
  cursor: not-allowed;
  transform: none;
}

#atlas-chat-send svg {
  width: 18px;
  height: 18px;
  fill: #151c27;
}

/* Lead Captured Banner */
.atlas-lead-banner {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: #166534;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 12px;
}

/* Lead Collection Form */
.atlas-lead-form {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 14px;
  margin: 8px 14px 0 36px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  font-family: 'Inter', sans-serif;
  animation: msg-in 0.3s ease;
}

.atlas-lead-form h5 {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: #151c27;
  font-weight: 600;
}

.atlas-lead-form input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
  box-sizing: border-box;
}

.atlas-lead-form input:focus {
  border-color: #ffd200;
}

.atlas-lead-form button {
  width: 100%;
  background: #151c27;
  color: #ffd200;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.atlas-lead-form button:hover {
  opacity: 0.9;
}

/* Mobile responsive */
@media (max-width: 480px) {
  #atlas-chat-window {
    right: 12px;
    bottom: 90px;
    width: calc(100vw - 24px);
    height: calc(100vh - 110px);
    border-radius: 16px;
  }
  #atlas-chat-bubble {
    right: 16px;
    bottom: 20px;
  }
}
