/* Scoped to avoid theme overrides */
.anna-leadbot-root {
  --anna-gradient: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #3b82f6 100%);
  --anna-gradient-light: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 50%, #60a5fa 100%);
  box-sizing: border-box;
}
.anna-leadbot-root *,
.anna-leadbot-root *::before,
.anna-leadbot-root *::after {
  box-sizing: border-box;
}

.anna-leadbot-root .anna-leadbot-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 70px;
  height: 60px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #3b82f6 100%) !important;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  transition: transform 0.2s, box-shadow 0.2s;
}

.anna-leadbot-root .anna-leadbot-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
}

.anna-leadbot-root .anna-leadbot-bubble.hidden {
  display: none;
}

.anna-bubble-icon {
  font-size: 18px;
  font-weight: 600;
  color: white;
  line-height: 1;
}

.anna-leadbot-root .anna-leadbot-window {
  width: 400px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 40px);
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: auto;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  background: #ffffff !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  transition: opacity 0.2s, transform 0.2s;
}

.anna-leadbot-root .anna-leadbot-window.minimized {
  display: none;
}

.anna-leadbot-root #anna-chat-header {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #3b82f6 100%) !important;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.anna-header-title { display: flex; flex-direction: column; gap: 2px; }
.anna-header-name { font-weight: bold; font-size: 18px; line-height: 1.2; }
.anna-header-subtitle { font-size: 12px; opacity: 0.9; font-weight: 400; }

.anna-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  color: white;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.anna-close-btn:hover { background: rgba(0,0,0,0.4); }

.anna-leadbot-root #anna-chat-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  background: #ffffff !important;
  font-size: 14px;
  -webkit-overflow-scrolling: touch;
}

.anna-leadbot-root #anna-privacy-consent {
  text-align: center;
  padding: 24px 16px;
  background: #ffffff !important;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

#anna-privacy-consent p {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px 0;
}

#anna-privacy-consent.hidden { display: none; }

#anna-lead-form-wrap.hidden { display: none; }

#anna-lead-form-wrap { padding: 12px 0; }

.anna-leadbot-root .anna-lead-form-box {
  background: #ffffff !important;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.2);
  width: 100%;
}

.anna-leadbot-root .anna-lead-form-header {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #3b82f6 100%) !important;
  color: white;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
}

.anna-lead-form-body {
  padding: 20px;
  min-width: 0;
}

.anna-form-field {
  margin-bottom: 14px;
  min-width: 0;
}

.anna-form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 4px;
  overflow: visible;
  white-space: normal;
}

.anna-form-field .required { color: #ef4444; }
.anna-form-field .optional { font-weight: 400; color: #9ca3af; }

.anna-form-field input,
.anna-form-field select {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.anna-form-field input:focus,
.anna-form-field select:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.anna-form-field select { background: #fff; cursor: pointer; }

.anna-btn-submit {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: var(--anna-gradient-light);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.anna-btn-submit:hover { opacity: 0.95; transform: scale(1.01); }
.anna-btn-submit:active { transform: scale(0.99); }

.anna-btn-gradient {
  background: var(--anna-gradient-light);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.anna-btn-gradient:hover { opacity: 0.95; transform: scale(1.02); }
.anna-btn-gradient:active { transform: scale(0.98); }

#anna-chat-messages { display: none; }
#anna-chat-messages.visible { display: block; }

.anna-row {
  display: flex;
  align-items: flex-end;
  margin: 10px 0;
}

.anna-row.bot { justify-content: flex-start; }
.anna-row.user { justify-content: flex-end; }

.anna-msg {
  padding: 10px 14px;
  border-radius: 16px;
  max-width: 80%;
  font-size: 14px;
  line-height: 1.5;
}

.anna-msg.bot {
  background: #f3f4f6;
  color: #374151;
  border-bottom-left-radius: 6px;
}

.anna-msg.user {
  background: var(--anna-gradient);
  color: white;
  border-bottom-right-radius: 6px;
}

.anna-msg.typing span { animation: anna-blink 1s infinite; }
.anna-msg.typing span:nth-child(2) { animation-delay: 0.2s; }
.anna-msg.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes anna-blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.3; }
}

.anna-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  background: var(--anna-gradient);
}

.anna-leadbot-root #anna-chat-footer {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: #ffffff !important;
  border-top: 1px solid #e5e7eb;
  gap: 8px;
}

.anna-footer-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

#anna-userInput {
  flex: 1;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

#anna-userInput:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

#anna-userInput:disabled {
  background: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

#anna-sendBtn {
  min-width: 70px;
  padding: 10px 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.anna-btn-exit {
  width: 100%;
  background: #f3f4f6;
  color: #374151;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.anna-btn-exit:hover {
  background: #e5e7eb;
  color: #1f2937;
  border-color: #d1d5db;
}

#anna-chat-footer.hidden { display: none; }

/* Force button visibility and clickability - override WordPress theme styles */
.anna-leadbot-root .anna-btn-gradient,
.anna-leadbot-root .anna-btn-submit,
.anna-leadbot-root #anna-sendBtn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 50%, #60a5fa 100%) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}
.anna-leadbot-root .anna-btn-gradient:hover,
.anna-leadbot-root .anna-btn-submit:hover,
.anna-leadbot-root #anna-sendBtn:hover {
  opacity: 0.95 !important;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #3b82f6 100%) !important;
}
.anna-leadbot-root .anna-btn-exit {
  background: #e5e7eb !important;
  color: #374151 !important;
  border: 2px solid #d1d5db !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}
.anna-leadbot-root .anna-btn-exit:hover {
  background: #d1d5db !important;
  color: #1f2937 !important;
  border-color: #9ca3af !important;
}
.anna-leadbot-root .anna-close-btn {
  background: rgba(0,0,0,0.3) !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.anna-leadbot-root #anna-chat-bubble {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Responsive - mobile */
@media (max-width: 480px) {
  .anna-leadbot-root .anna-leadbot-window {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    height: 85vh;
    max-height: 500px;
  }
  .anna-leadbot-root .anna-leadbot-bubble {
    right: 10px;
    bottom: 10px;
  }
  .anna-leadbot-root #anna-chat-body {
    padding: 12px 16px;
  }
  .anna-lead-form-body {
    padding: 16px;
  }
}
