/* WeluChatBot (Whatsapp AI) - Premium Frontend UI */
.weluchatbot-root,
.weluchatbot-root * {
  box-sizing: border-box;
}

.weluchatbot-root {
  --welu-surface: #ffffff;
  --welu-body-bg: #f3f7f5;
  --welu-border: #e2ebe7;
  --welu-muted: #667781;
  --welu-success: #22c55e;
  --welu-danger: #ff3b30;
  --welu-soft: rgba(15, 143, 79, .10);
  --welu-soft-strong: rgba(15, 143, 79, .16);
  --welu-shadow-button: 0 16px 38px rgba(0, 0, 0, .24);
  --welu-shadow-panel: 0 24px 70px rgba(15, 23, 42, .24);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.welu-chat-button {
  position: fixed;
  bottom: 22px;
  width: var(--welu-button-size);
  height: var(--welu-button-size);
  border-radius: 999px;
  border: 0 !important;
  background: var(--welu-color) !important;
  color: #ffffff !important;
  z-index: var(--welu-z);
  box-shadow: var(--welu-shadow-button);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease, background-color .22s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.welu-chat-button:hover,
.welu-chat-button:focus-visible {
  background: var(--welu-color) !important;
  color: #ffffff !important;
  transform: translateY(-3px) scale(1.035);
  filter: brightness(.96);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .28);
}

.welu-chat-button:active {
  transform: translateY(-1px) scale(.98);
}

.welu-chat-button.right { right: 22px; }
.welu-chat-button.left { left: 22px; }

.welu-chat-button svg,
.welu-avatar svg,
.welu-whatsapp-btn svg {
  display: block;
  color: currentColor !important;
  fill: currentColor !important;
  flex-shrink: 0;
}

.welu-chat-button svg { width: 34px; height: 34px; }
.welu-avatar svg { width: 25px; height: 25px; }
.welu-whatsapp-btn svg { width: 22px; height: 22px; }

.welu-whatsapp-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.welu-button-label {
  position: absolute;
  right: calc(100% + 12px);
  white-space: nowrap;
  background: #ffffff !important;
  color: var(--welu-text) !important;
  padding: 8px 13px;
  border: 1px solid rgba(15, 143, 79, .13);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.welu-chat-button:hover .welu-button-label,
.welu-chat-button:focus-visible .welu-button-label {
  background: #ffffff !important;
  color: var(--welu-text) !important;
}

.welu-chat-button.left .welu-button-label {
  left: calc(100% + 12px);
  right: auto;
}

.welu-notification-dot {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 13px;
  height: 13px;
  background: var(--welu-danger);
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 5px rgba(255, 59, 48, .13);
}

.welu-chat-panel {
  position: fixed;
  bottom: calc(var(--welu-button-size) + 34px);
  width: var(--welu-panel-width);
  max-width: calc(100vw - 28px);
  height: var(--welu-panel-height);
  max-height: calc(100vh - 120px);
  border-radius: var(--welu-radius);
  overflow: hidden;
  background: var(--welu-secondary, #ffffff);
  color: var(--welu-text);
  z-index: var(--welu-z);
  box-shadow: var(--welu-shadow-panel);
  display: none;
  flex-direction: column;
  border: 1px solid rgba(15, 23, 42, .08);
}

.welu-chat-panel.open {
  display: flex;
  animation: weluPanelIn .22s ease both;
}

@keyframes weluPanelIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.welu-chat-panel.right { right: 22px; }
.welu-chat-panel.left { left: 22px; }

.welu-chat-header {
  background: linear-gradient(135deg, var(--welu-color) 0%, var(--welu-color) 62%, rgba(0,0,0,.16) 100%) !important;
  color: #ffffff !important;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.welu-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .20) !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, .20);
}

.welu-header-text { flex: 1; min-width: 0; }
.welu-title { font-weight: 900; font-size: 16px; line-height: 1.14; color: #ffffff !important; }
.welu-subtitle { font-size: 12px; opacity: .92; margin-top: 2px; color: #ffffff !important; }

.welu-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-top: 3px;
  opacity: .98;
  color: #ffffff !important;
}
.welu-online:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #24e978;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(36, 233, 120, .18);
}

.welu-close {
  width: 34px;
  height: 34px;
  border: 0 !important;
  border-radius: 12px;
  background: rgba(255,255,255,.08) !important;
  color: #ffffff !important;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background-color .18s ease, transform .18s ease;
}
.welu-close:hover,
.welu-close:focus-visible {
  background: rgba(255,255,255,.20) !important;
  color: #ffffff !important;
  transform: rotate(3deg);
}

.welu-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: linear-gradient(180deg, #f7faf8 0%, #eef5f1 100%);
}
.welu-chat-body::-webkit-scrollbar { width: 8px; }
.welu-chat-body::-webkit-scrollbar-track { background: transparent; }
.welu-chat-body::-webkit-scrollbar-thumb { background: rgba(102,119,129,.28); border-radius: 99px; }

.welu-message {
  padding: 13px 14px;
  border-radius: 16px;
  margin-bottom: 12px;
  line-height: 1.52;
  font-size: 14px;
  white-space: pre-line;
  color: var(--welu-text) !important;
}

.welu-bot-message {
  background: #ffffff !important;
  color: var(--welu-text) !important;
  border: 1px solid var(--welu-border);
  border-top-left-radius: 6px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
}

.welu-user-message {
  background: rgba(15, 143, 79, .12) !important;
  color: var(--welu-text) !important;
  margin-left: 56px;
  border-top-right-radius: 6px;
  border: 1px solid rgba(15, 143, 79, .18);
}

.welu-faq-title {
  font-size: 13px;
  font-weight: 900;
  margin: 14px 0 10px;
  color: var(--welu-text) !important;
}

.welu-faq-item {
  width: 100%;
  border: 1px solid var(--welu-border) !important;
  background: #ffffff !important;
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--welu-text) !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .035);
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease, color .18s ease;
}

.welu-faq-item:hover,
.welu-faq-item:focus-visible {
  background: rgba(15, 143, 79, .075) !important;
  border-color: var(--welu-color) !important;
  color: var(--welu-text) !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  outline: none;
}

.welu-faq-item span,
.welu-faq-item:hover span {
  color: inherit !important;
}

.welu-faq-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-right: 7px;
}

.welu-answer-title {
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--welu-text) !important;
}

.welu-helpful {
  background: #ffffff !important;
  border: 1px solid var(--welu-border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--welu-text) !important;
  margin: 4px 0 12px;
}

.welu-mini-actions {
  display: inline-flex;
  gap: 6px;
}
.welu-mini-actions button {
  width: 32px;
  height: 30px;
  border-radius: 10px;
  background: #f6f9f8 !important;
  border: 1px solid #e5eeea !important;
  cursor: pointer;
  font-size: 16px;
  color: var(--welu-text) !important;
  transition: background-color .18s ease, transform .18s ease, border-color .18s ease;
}
.welu-mini-actions button:hover,
.welu-mini-actions button:focus-visible {
  background: rgba(15, 143, 79, .10) !important;
  color: var(--welu-text) !important;
  border-color: rgba(15, 143, 79, .28) !important;
  transform: translateY(-1px);
  outline: none;
}

.welu-whatsapp-card {
  background: #ffffff !important;
  border: 1px solid var(--welu-border);
  border-radius: 16px;
  padding: 14px;
  margin-top: 10px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
  color: var(--welu-text) !important;
}
.welu-whatsapp-card p { margin: 0 0 12px; line-height: 1.5; color: var(--welu-text) !important; }

.welu-whatsapp-btn {
  width: 100%;
  border: 0 !important;
  border-radius: 14px;
  color: #ffffff !important;
  background: var(--welu-color) !important;
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none !important;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
  box-shadow: 0 10px 24px rgba(15, 143, 79, .22);
}
.welu-whatsapp-btn:hover,
.welu-whatsapp-btn:focus-visible,
.welu-whatsapp-btn:visited {
  color: #ffffff !important;
  background: var(--welu-color) !important;
  text-decoration: none !important;
}
.welu-whatsapp-btn:hover,
.welu-whatsapp-btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(.95);
  box-shadow: 0 14px 30px rgba(15, 143, 79, .28);
  outline: none;
}

.welu-phone-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--welu-muted) !important;
}
.welu-phone-note strong { color: var(--welu-text) !important; }

.welu-chat-footer {
  padding: 12px;
  background: #ffffff !important;
  border-top: 1px solid var(--welu-border);
}

.welu-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dfe9e4 !important;
  border-radius: 14px;
  padding: 8px 10px;
  background: #ffffff !important;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.welu-input-row:focus-within {
  border-color: var(--welu-color) !important;
  box-shadow: 0 0 0 4px rgba(15, 143, 79, .10);
}

.welu-input-row input {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  flex: 1;
  font-size: 13px;
  min-width: 0;
  background: transparent !important;
  color: var(--welu-text) !important;
  padding: 4px 0 !important;
  margin: 0 !important;
}
.welu-input-row input::placeholder { color: #8a9aa3; opacity: 1; }

.welu-send {
  width: 34px;
  height: 34px;
  border: 0 !important;
  border-radius: 11px;
  background: rgba(15, 143, 79, .08) !important;
  color: var(--welu-color) !important;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .18s ease, transform .18s ease;
}
.welu-send:hover,
.welu-send:focus-visible {
  background: rgba(15, 143, 79, .15) !important;
  color: var(--welu-color) !important;
  transform: translateX(1px);
  outline: none;
}
.welu-send svg path { stroke: currentColor !important; }

.welu-powered {
  text-align: center;
  font-size: 11px;
  color: #7c8993 !important;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .welu-chat-button {
    width: 58px;
    height: 58px;
    bottom: 18px;
  }
  .welu-chat-button.right { right: 18px; }
  .welu-chat-button.left { left: 18px; }
  .welu-chat-panel {
    width: calc(100vw - 24px);
    height: min(var(--welu-panel-height), calc(100vh - 92px));
    bottom: 84px;
    border-radius: 18px;
  }
  .welu-chat-panel.right { right: 12px; }
  .welu-chat-panel.left { left: 12px; }
  .welu-mobile-fullscreen .welu-chat-panel {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    bottom: 0;
    left: 0 !important;
    right: 0 !important;
    border-radius: 0;
  }
  .welu-button-label { display: none; }
  .welu-chat-header { padding: 14px; }
  .welu-user-message { margin-left: 34px; }
}

/* v1.3.0 Profile Avatar + Feedback Fix */
.weluchatbot-root .welu-avatar {
  overflow: hidden;
  background: rgba(255, 255, 255, .22) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.13);
}

.weluchatbot-root .welu-avatar img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  border-radius: 50% !important;
}

.weluchatbot-root .welu-avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .4px;
  color: #ffffff !important;
}

.weluchatbot-root .welu-mini-actions button,
.weluchatbot-root .welu-mini-actions button:hover,
.weluchatbot-root .welu-mini-actions button:focus,
.weluchatbot-root .welu-mini-actions button:active {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  min-width: 32px !important;
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.weluchatbot-root .welu-mini-actions svg {
  width: 17px !important;
  height: 17px !important;
  display: block !important;
  color: currentColor !important;
  fill: currentColor !important;
  pointer-events: none;
}

.weluchatbot-root .welu-feedback-btn.active {
  background: var(--welu-color) !important;
  color: #ffffff !important;
  border-color: var(--welu-color) !important;
  box-shadow: 0 8px 18px rgba(15,143,79,.20);
}

.weluchatbot-root .welu-feedback-thanks {
  font-size: 11px;
  font-weight: 800;
  color: var(--welu-color) !important;
  white-space: nowrap;
  margin-left: 2px;
}

@media (max-width: 600px) {
  .weluchatbot-root .welu-helpful {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
