/* ============================================================
   Elite Graphix — Chatbot Widget CSS
   Drop into your styles/ folder
   Include in footer before </body>
   ============================================================ */

#eg-chatbot {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 2;
  font-family: 'Segoe UI', Ubuntu, system-ui, sans-serif;
}

/* ── Toggle Button ─────────────────────────────────────────── */
#eg-chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #222;
  border: 2px solid #444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  bottom: 0;
  right: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: background 0.2s, transform 0.2s;
  z-index: 2;
}
#eg-chat-toggle:hover { background: #333; transform: scale(1.08); }
#eg-chat-toggle svg { width: 24px; height: 24px; fill: #fff; }
#eg-chat-toggle .eg-close-icon { display: none; }
#eg-chatbot.eg-open #eg-chat-toggle .eg-chat-icon { display: none; }
#eg-chatbot.eg-open #eg-chat-toggle .eg-close-icon { display: block; }

/* Pulse ring on toggle */
#eg-chat-toggle::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #555;
  animation: eg-pulse 2s infinite;
}
@keyframes eg-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  70% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}
#eg-chatbot.eg-open #eg-chat-toggle::before { display: none; }

/* Notification dot */
#eg-chat-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #222;
}
#eg-chatbot.eg-open #eg-chat-toggle::after { display: none; }

/* ── Chat Window ───────────────────────────────────────────── */
#eg-chat-window {
  width: 340px;
  max-height: 520px;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  position: absolute;
  bottom: 68px;
  right: 0;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
#eg-chatbot.eg-open #eg-chat-window {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ────────────────────────────────────────────────── */
#eg-chat-header {
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #222;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.eg-header-info { flex: 1; }
.eg-header-name { font-size: 13px; font-weight: 600; color: #f0f0f0; }
.eg-header-status { font-size: 11px; color: #22c55e; display: flex; align-items: center; gap: 4px; }
.eg-header-status::before { content: ''; display: inline-block; width: 6px; height: 6px; background: #22c55e; border-radius: 50%; }
#eg-chat-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.15s;
}
#eg-chat-close:hover { color: #ccc; }

/* ── Messages ──────────────────────────────────────────────── */
#eg-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  scroll-behavior: smooth;
}
#eg-chat-msgs::-webkit-scrollbar { width: 4px; }
#eg-chat-msgs::-webkit-scrollbar-track { background: transparent; }
#eg-chat-msgs::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.eg-msg { display: flex; max-width: 88%; }
.eg-msg-bot { align-self: flex-start; }
.eg-msg-user { align-self: flex-end; flex-direction: row-reverse; }

.eg-bubble {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #e8e8e8;
  word-break: break-word;
}
.eg-msg-bot .eg-bubble {
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-bottom-left-radius: 3px;
}
.eg-msg-user .eg-bubble {
  background: #222;
  border: 1px solid #333;
  border-bottom-right-radius: 3px;
  color: #ddd;
}
.eg-bubble strong { color: #fff; font-weight: 600; }

/* ── Typing indicator ──────────────────────────────────────── */
.eg-typing { display: flex; gap: 4px; align-items: center; padding: 10px 14px; }
.eg-typing span {
  width: 6px; height: 6px;
  background: #555;
  border-radius: 50%;
  animation: eg-blink 1.2s infinite;
}
.eg-typing span:nth-child(2) { animation-delay: 0.2s; }
.eg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes eg-blink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── Quick Replies ─────────────────────────────────────────── */
.eg-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 12px 8px;
}
.eg-quick-replies button {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 20px;
  color: #bbb;
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.eg-quick-replies button:hover {
  background: #2a2a2a;
  color: #fff;
  border-color: #444;
}

/* ── Action Buttons ────────────────────────────────────────── */
.eg-link-btn, .eg-wa-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.eg-link-btn {
  background: #222;
  border: 1px solid #444;
  color: #ccc;
}
.eg-link-btn:hover { background: #2a2a2a; color: #fff; }
.eg-wa-btn {
  background: #1a3a1a;
  border: 1px solid #25d366;
  color: #25d366;
}
.eg-wa-btn:hover { background: #1f4a1f; }

/* ── Input Bar ─────────────────────────────────────────────── */
#eg-chat-footer {
  border-top: 1px solid #1e1e1e;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #111;
}
#eg-chat-input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  color: #e8e8e8;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
#eg-chat-input::placeholder { color: #555; }
#eg-chat-input:focus { border-color: #444; }
#eg-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #222;
  border: 1px solid #444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
#eg-chat-send:hover { background: #2a2a2a; }
#eg-chat-send svg { width: 16px; height: 16px; fill: #ccc; }

/* ── WhatsApp sticky button (mobile) ───────────────────────── */
#eg-wa-sticky {
  position: fixed;
  bottom: 90px;
  left: 16px;
  z-index: 9998;
  background: #25d366;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  text-decoration: none;
  transition: transform 0.2s;
  display: none !important;
}
#eg-wa-sticky:hover { transform: scale(1.1); }
#eg-wa-sticky svg { width: 26px; height: 26px; fill: #fff; }

/* ── Mobile adjustments ────────────────────────────────────── */
@media (max-width: 480px) {
  #eg-chat-window { width: calc(100vw - 32px); right: -4px; }
  #eg-chatbot { right: 16px; bottom: 80px; }
}
