/* ========================================
   LASH AND BEAUTY CHATBOT — Widget Styles
   ======================================== */

:root {
  --chat-primary: #D2888D;
  --chat-primary-dark: #B8727A;
  --chat-dark: #000000;
  --chat-bg: #FFFFFF;
  --chat-bubble-bot: #F3F4F6;
  --chat-bubble-user: #D2888D;
  --chat-text: #333;
  --chat-text-light: #888;
  --chat-border: #E8ECF1;
  --chat-radius: 16px;
  --chat-font: 'Inter', -apple-system, sans-serif;
  --chat-shadow: 0 12px 40px rgba(0,0,0,0.18);
  --chat-transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ========== TOGGLE BUTTON ========== */
.chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chat-primary), #E0A0A5);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 6px 24px rgba(210,136,141,0.4);
  transition: var(--chat-transition);
  animation: chatPulse 2s ease-in-out infinite;
}
.chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 30px rgba(210,136,141,0.5);
}
.chatbot-toggle.active {
  animation: none;
  transform: rotate(90deg);
}
.chatbot-toggle .chat-icon-close { display: none; }
.chatbot-toggle.active .chat-icon-open { display: none; }
.chatbot-toggle.active .chat-icon-close { display: inline; }

@keyframes chatPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(210,136,141,0.4); }
  50% { box-shadow: 0 6px 24px rgba(210,136,141,0.7), 0 0 0 12px rgba(210,136,141,0.1); }
}

/* ========== NOTIFICATION BADGE ========== */
.chatbot-toggle__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: #EF4444;
  color: #fff;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* ========== CHAT WINDOW ========== */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-height: 540px;
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: var(--chat-transition);
}
.chatbot-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ========== HEADER ========== */
.chatbot__header {
  background: linear-gradient(135deg, var(--chat-dark), #2A2A4A);
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.chatbot__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chat-primary), #E0A0A5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.chatbot__header-info { flex: 1; }
.chatbot__header-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: block;
}
.chatbot__header-status {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.chatbot__header-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
}

/* ========== MESSAGES ========== */
.chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 280px;
  max-height: 340px;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  gap: 0.5rem;
  max-width: 88%;
  animation: chatMsgIn 0.3s ease;
}
.chat-msg--bot { align-self: flex-start; }
.chat-msg--user { align-self: flex-end; flex-direction: row-reverse; }

.chat-msg__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.chat-msg--bot .chat-msg__avatar {
  background: linear-gradient(135deg, var(--chat-primary), #E0A0A5);
  color: #fff;
}
.chat-msg--user .chat-msg__avatar {
  background: var(--chat-dark);
  color: #fff;
}

.chat-msg__bubble {
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  font-family: var(--chat-font);
}
.chat-msg--bot .chat-msg__bubble {
  background: var(--chat-bubble-bot);
  color: var(--chat-text);
  border-bottom-left-radius: 4px;
}
.chat-msg--user .chat-msg__bubble {
  background: var(--chat-bubble-user);
  color: #fff;
  border-bottom-right-radius: 4px;
}

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== QUICK ACTIONS ========== */
.chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.25rem 0 0.35rem;
}
.chat-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  border: 1.5px solid var(--chat-border);
  background: #fff;
  color: var(--chat-text);
  font-family: var(--chat-font);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--chat-transition);
  white-space: nowrap;
}
.chat-quick-btn:hover {
  border-color: var(--chat-primary);
  color: var(--chat-primary);
  background: rgba(210,136,141,0.04);
}
.chat-quick-btn i { font-size: 0.75rem; }

/* ========== TYPING INDICATOR ========== */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  align-self: flex-start;
}
.chat-typing__dots {
  display: flex;
  gap: 4px;
  padding: 0.6rem 0.8rem;
  background: var(--chat-bubble-bot);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.chat-typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #999;
  animation: typingBounce 1.4s ease-in-out infinite;
}
.chat-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ========== LEAD FORM (inline) ========== */
.chat-lead-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #FAFAFA;
  border-radius: 12px;
  border: 1px solid var(--chat-border);
  animation: chatMsgIn 0.3s ease;
}
.chat-lead-form__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--chat-dark);
  margin-bottom: 0.2rem;
}
.chat-lead-form input {
  border: 1.5px solid var(--chat-border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-family: var(--chat-font);
  font-size: 0.82rem;
  outline: none;
  transition: var(--chat-transition);
  width: 100%;
}
.chat-lead-form input:focus {
  border-color: var(--chat-primary);
  box-shadow: 0 0 0 3px rgba(210,136,141,0.08);
}
.chat-lead-form button {
  background: var(--chat-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem;
  font-family: var(--chat-font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--chat-transition);
}
.chat-lead-form button:hover { background: var(--chat-primary-dark); }

/* ========== INPUT BAR ========== */
.chatbot__input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--chat-border);
  background: #FAFAFA;
  flex-shrink: 0;
}
.chatbot__input input {
  flex: 1;
  border: 1.5px solid var(--chat-border);
  border-radius: 24px;
  padding: 0.6rem 1rem;
  font-family: var(--chat-font);
  font-size: 0.85rem;
  outline: none;
  transition: var(--chat-transition);
  background: #fff;
}
.chatbot__input input:focus {
  border-color: var(--chat-primary);
}
.chatbot__input input::placeholder {
  color: #BBB;
}
.chatbot__send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--chat-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--chat-transition);
  flex-shrink: 0;
}
.chatbot__send:hover { background: var(--chat-primary-dark); transform: scale(1.05); }
.chatbot__send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ========== POWERED BY ========== */
.chatbot__footer {
  text-align: center;
  padding: 0.35rem;
  font-size: 0.6rem;
  color: #CCC;
  background: #FAFAFA;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
  .chatbot-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border-top-left-radius: var(--chat-radius);
    border-top-right-radius: var(--chat-radius);
  }
  .chatbot__messages { max-height: 55vh; }
  .chatbot-toggle { bottom: 16px; right: 16px; width: 54px; height: 54px; font-size: 1.3rem; }
}
