/* ============================================================
   Widget de "Asistente virtual" (chatbot) — botón flotante.
   Antes: bloque <style> duplicado en 8+ vistas con el verde/logo
   de WhatsApp. Ahora: un solo archivo, con paleta de marca de la
   clínica (no la de WhatsApp) y nombres de clase neutrales.
   ============================================================ */

:root {
  --chatbot-color-1: #1B7A94;
  --chatbot-color-2: #14A9A0;
  --chatbot-bg: #F4FAFA;
  --chatbot-bubble-in: #EDF6F6;
  --chatbot-text-dark: #10333A;
}

#chatbot-launcher {
  position: fixed;
  right: 3%;
  bottom: 8%;
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, var(--chatbot-color-1), var(--chatbot-color-2));
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 6px 18px rgba(20, 60, 70, 0.28);
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
  z-index: 1000;
  cursor: pointer;
}

#chatbot-launcher:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 22px rgba(20, 60, 70, 0.35);
}

#chatbot-launcher svg {
  position: relative;
  z-index: 2;
}

#chatbot-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--chatbot-color-2);
  opacity: 0.55;
  animation: chatbotPulse 2.4s ease-out infinite;
}

@keyframes chatbotPulse {
  0% { transform: scale(1); opacity: 0.45; }
  70% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

#chatbot-container {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 1000;
}

#chatbot-box {
  width: 320px;
  background-color: var(--chatbot-bg);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(20, 60, 70, 0.22);
  overflow: hidden;
  display: none;
  border: 1px solid rgba(20, 60, 70, 0.08);
}

#chatbot-header {
  background: linear-gradient(135deg, var(--chatbot-color-1), var(--chatbot-color-2));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#chatbot-close {
  cursor: pointer;
  opacity: 0.85;
}

#chatbot-close:hover {
  opacity: 1;
}

#chatbot-messages {
  padding: 18px;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.chatbot-msg {
  background-color: var(--chatbot-bubble-in);
  color: var(--chatbot-text-dark);
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  margin-bottom: 10px;
  max-width: 78%;
  font-size: 15px;
  line-height: 1.4;
}

.chatbot-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--chatbot-color-1), var(--chatbot-color-2));
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}

.chatbot-msg a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

.chatbot-msg.user a {
  color: #fff;
}

#chatbot-form {
  padding: 0 16px 16px;
}

.chatbot-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 4px 4px 4px 14px;
  border: 1px solid rgba(20, 60, 70, 0.12);
}

#chatbot-input {
  flex: 1;
  border: none;
  padding: 8px 0;
  font-size: 14px;
  outline: none;
  background: transparent;
}

#chatbot-send {
  background: linear-gradient(135deg, var(--chatbot-color-1), var(--chatbot-color-2));
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease-out;
}

#chatbot-send:hover {
  transform: scale(1.08);
}

.chatbot-typing {
  position: absolute;
  bottom: -22px;
  left: 14px;
  font-style: italic;
  font-size: 12px;
  color: #999;
  display: none;
}
