/* Chat de Botyzai (común a todas las páginas). */
/* Estilos del botón flotante */
#bz-chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #54ce82 0%, #3cae6a 100%);
  box-shadow: 0 8px 24px rgba(84, 206, 130, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}
#bz-chat-toggle:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 32px rgba(84, 206, 130, 0.6);
}
#bz-chat-toggle svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #0b2a18;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s;
}

/* Notificación/Punto pulsante sobre el botón */
.chat-notification-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #ff4757;
  border: 2px solid #0f1145;
  border-radius: 50%;
  animation: pulseAlert 1.8s infinite;
}
@keyframes pulseAlert {
  0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(255, 71, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

/* Contenedor del Chat */
#bz-chat-container {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 380px;
  height: 580px;
  max-height: calc(100vh - 140px);
  border-radius: 20px;
  background: rgba(15, 17, 69, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  transform: scale(0.9) translateY(20px);
}

/* Cabecera del Chat */
.bz-chat-header {
  padding: 18px 20px;
  background: linear-gradient(to right, rgba(84, 206, 130, 0.15), rgba(15, 17, 69, 0));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bz-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bz-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a6b3c 0%, #54ce82 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0b2a18;
  font-size: 14px;
  box-shadow: 0 0 10px rgba(84, 206, 130, 0.3);
}
.bz-chat-title-group {
  display: flex;
  flex-direction: column;
}
.bz-chat-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-sans);
}
.bz-chat-status {
  font-size: 11px;
  color: #54ce82;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.bz-chat-status-dot {
  width: 6px;
  height: 6px;
  background-color: #54ce82;
  border-radius: 50%;
  animation: pulseGreen 1.6s infinite;
}
@keyframes pulseGreen {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}
.bz-chat-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.bz-chat-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.bz-chat-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

/* Área de Mensajes */
.bz-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.bz-chat-messages::-webkit-scrollbar {
  width: 4px;
}
.bz-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.bz-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Burbujas de Mensaje */
.bz-chat-bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  font-family: var(--font-sans);
  word-wrap: break-word;
  animation: bubbleFadeIn 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes bubbleFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.bz-chat-bubble.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.bz-chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #1a6b3c 0%, #2e8f52 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(26, 107, 60, 0.2);
}

.bz-chat-bubble p {
  margin-bottom: 8px;
}
.bz-chat-bubble p:last-child {
  margin-bottom: 0;
}
.bz-chat-bubble ul, .bz-chat-bubble ol {
  margin-left: 18px;
  margin-bottom: 8px;
}
.bz-chat-bubble li {
  margin-bottom: 4px;
}

/* Indicador de Escritura */
.bz-chat-typing {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 18px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: none;
  align-items: center;
  gap: 5px;
}
.bz-chat-dot {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.bz-chat-dot:nth-child(1) { animation-delay: -0.32s; }
.bz-chat-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); background: #54ce82; }
}

/* Panel de Entrada de Texto */
.bz-chat-input-panel {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 17, 69, 0.3);
}
.bz-chat-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.bz-chat-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 12px 48px 12px 18px;
  color: #fff;
  font-size: 13.5px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.bz-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.bz-chat-input:focus {
  border-color: rgba(84, 206, 130, 0.5);
  box-shadow: 0 0 12px rgba(84, 206, 130, 0.15);
  background: rgba(255, 255, 255, 0.08);
}
.bz-chat-send {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #54ce82;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b2a18;
  transition: transform 0.2s, background 0.2s;
}
.bz-chat-send:hover {
  background: #62dd90;
  transform: scale(1.05);
}
.bz-chat-send:active {
  transform: scale(0.95);
}
.bz-chat-send svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateX(1px);
}

/* Adaptabilidad Móvil */
@media (max-width: 480px) {
  #bz-chat-container {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  #bz-chat-toggle {
    bottom: 20px;
    right: 20px;
  }
}
  
