/* ================================================================= */
/* ACE Digitals Chatbot – Responsive & Polished Theme (#e63946)      */
/* ================================================================= */

/* Chat widget container */
.ace-chatbot {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 320px;
  max-height: 480px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  z-index: 9999;
  transition: all 0.3s ease;
}
.ace-chatbot.minimized {
  max-height: 56px;
}
.ace-chatbot.minimized .ace-chatbot-body,
.ace-chatbot.minimized .ace-chatbot-input {
  display: none;
}

/* Header */
.ace-chatbot-header {
  background: #e63946;
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.controls {
  display: flex;
  gap: 0.5rem;
}
.controls button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* Body */
.ace-chatbot-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  background: #fafafa;
  font-size: 0.95rem;
}

/* Messages */
.ace-chatbot-message {
  margin-bottom: 0.75rem;
  display: flex;
}
.ace-chatbot-message.bot { justify-content: flex-start; }
.ace-chatbot-message.user { justify-content: flex-end; }
.ace-chatbot-message span {
  display: inline-block;
  max-width: 80%;
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.ace-chatbot-message.bot span { background: #f1f1f1; color: #333; }
.ace-chatbot-message.user span { background: #e63946; color: #fff; }

/* Lists & emphasis */
.ace-chatbot-body p { margin: 0.5rem 0; }
.ace-chatbot-body strong { color: #e63946; }
.ace-chatbot-body ul,
.ace-chatbot-body ol {
  margin: 0.75rem 0 0.75rem 1.25rem;
  padding: 0;
}
.ace-chatbot-body ul li {
  position: relative; list-style: none; margin-bottom: 0.5rem;
}
.ace-chatbot-body ul li::before {
  content: '•';
  position: absolute; left: -1.25rem;
  color: #e63946; font-weight: bold;
}
.ace-chatbot-body ol {
  counter-reset: ace-counter;
}
.ace-chatbot-body ol li {
  position: relative; list-style: none;
  margin-bottom: 0.5rem; padding-left: 1.5rem;
}
.ace-chatbot-body ol li::before {
  counter-increment: ace-counter;
  content: counter(ace-counter) '.';
  position: absolute; left: 0;
  color: #e63946; font-weight: bold;
}

/* Typing indicator */
.ace-typing-indicator {
  display: flex; align-items: center;
  margin-bottom: 0.75rem;
}
.ace-typing-indicator .dot {
  width: 8px; height: 8px; margin-right: 4px;
  background: #e63946; border-radius: 50%;
  animation: blink 1s infinite both;
}
.ace-typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.ace-typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%,80%,100% { opacity:0; }
  40%         { opacity:1; }
}

/* Input + Send button */
.ace-chatbot-input {
  display: flex; align-items: center; gap: 0.5rem;
  border-top: 1px solid #e0e0e0; padding: 0.5rem; background: #fff;
}
.ace-chatbot-input input {
  flex: 1; padding: 0.5rem 1rem;
  border: 1px solid #ddd; border-radius: 20px;
  outline: none; font-size: 0.95rem;
}
.ace-chatbot-send {
  background: #e63946; border: none;
  border-radius: 50%; width: 36px; height: 36px;
  color: #fff; display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s;
}
.ace-chatbot-send:hover { background: #d42f3f; }

/* Launcher & bubble wrapper */
.chat-launcher-wrapper {
  position: fixed; bottom: 20px; right: 20px;
  display: inline-block; text-align: center; z-index: 9999;
}
#ace-chatbot-toggle {
  width: 58px; height: 58px; border-radius: 50%;
  background: #e63946; border: none; color: #fff;
  font-size: 1.4rem; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer; animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
/* 24/7 Available bubble (attached) */
.chat-bubble {
  position: absolute;
  top: -22px; /* just above the button */
  left: 50%;
  transform: translateX(-50%);
  background: #e63946;
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.chat-bubble i { font-size: 0.85rem; }

/* Responsive tweaks */
@media (max-width: 768px) {
  .ace-chatbot { width: 280px; right: 10px; bottom: 80px; }
  .chat-launcher-wrapper { right: 10px; bottom: 15px; }
}
@media (max-width: 576px) {
  .ace-chatbot { width: calc(100% - 20px); right: 10px; bottom: 70px; }
  .chat-bubble { top: -20px; }
  #ace-chatbot-toggle { width: 50px; height: 50px; }
  .ace-chatbot-send { width: 32px; height: 32px; }
}
