#reganvi-bot-bubble {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 380px;
  max-width: 90vw;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(90, 62, 138, 0.2);
  z-index: 9999;
  font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
  display: flex;
  flex-direction: column;
  border: 2px solid #8F64C0;
  animation: botSlideIn 0.6s ease-out;
}

@keyframes botSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

#reganvi-bot-bubble:not(.open) {
  width: 120px;
  height: 120px;
  min-width: 0;
  min-height: 0;
  background: none;
  box-shadow: none;
  opacity: 1;
  border-radius: 0;
  cursor: pointer;
  justify-content: center;
  align-items: center;
  padding: 0;
  transform: scale(1);
  animation: none;
  border: none;
  backdrop-filter: none;
  filter: drop-shadow(0 8px 25px rgba(143, 100, 192, 0.3));
}

#reganvi-bot-bubble:not(.open):hover {
  transform: scale(1.1);
  filter: drop-shadow(0 12px 30px rgba(143, 100, 192, 0.4));
  animation: none;
}

#reganvi-bot-bubble:not(.open) #reganvi-bot-header,
#reganvi-bot-bubble:not(.open) #reganvi-bot-content,
#reganvi-bot-bubble:not(.open) #reganvi-bot-close {
  display: none;
}

#reganvi-bot-bubble:not(.open) #reganvi-bot-minimized {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
}

#reganvi-bot-bubble:not(.open) #reganvi-bot-minimized img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.3s ease;
}

#reganvi-bot-bubble:not(.open):hover #reganvi-bot-minimized img {
  transform: scale(1.05);
}

#reganvi-bot-header {
  background: linear-gradient(145deg, #5a3e8a 0%, #9b8ed6 50%, #8a7bd1 100%);
  color: #fff;
  padding: 20px 24px;
  font-size: 1.2em;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#reganvi-bot-header img {
  flex-shrink: 0;
  width: 45px;
  height: 45px;
  object-fit: contain;
}

#reganvi-bot-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.8s ease;
}

#reganvi-bot-header:hover::before {
  left: 100%;
}

#reganvi-bot-header:hover {
  background: linear-gradient(145deg, #6b4c9a 0%, #a599e0 50%, #9b8ed6 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

#reganvi-bot-content {
  padding: 24px 24px 20px 24px;
  font-size: 1em;
  color: #2d3748;
  background: white;
  line-height: 1.7;
  position: relative;
  min-height: 200px;
}

#reganvi-bot-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155, 142, 214, 0.3), transparent);
}

#reganvi-bot-content p {
  margin: 0 0 16px 0;
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(15px);
  position: relative;
}

#reganvi-bot-content p:last-child {
  margin-bottom: 0;
}

#reganvi-bot-content p:nth-child(1) { animation-delay: 0.1s; }
#reganvi-bot-content p:nth-child(2) { animation-delay: 0.2s; }
#reganvi-bot-content p:nth-child(3) { animation-delay: 0.3s; }
#reganvi-bot-content p:nth-child(4) { animation-delay: 0.4s; }
#reganvi-bot-content p:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#reganvi-bot-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.4em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#reganvi-bot-close:hover {
  background: linear-gradient(145deg, #e74c3c 0%, #c0392b 100%);
  color: #fff;
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
}

#reganvi-bot-minimized {
  display: none;
}

/* Botones con colores específicos e iconos */
.reganvi-bot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 10px 0 6px 0;
  padding: 14px 22px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95em;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.4px;
  transform: translateY(0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  width: 100%;
  text-align: center;
  font-family: inherit;
}

/* Botón WhatsApp - Verde */
.reganvi-bot-btn.whatsapp {
  background: linear-gradient(145deg, #25D366, #128C7E);
  color: #fff !important;
}

.reganvi-bot-btn.whatsapp:hover {
  background: linear-gradient(145deg, #20BD5A, #0F7A6B);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 10px 28px rgba(37, 211, 102, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Botón Contacto - Azul */
.reganvi-bot-btn.contacto {
  background: linear-gradient(145deg, #3498db, #2980b9);
  color: #fff !important;
}

.reganvi-bot-btn.contacto:hover {
  background: linear-gradient(145deg, #2980b9, #1f5f8b);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 10px 28px rgba(52, 152, 219, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Botón Admin - Naranja */
.reganvi-bot-btn.admin {
  background: linear-gradient(145deg, #f39c12, #e67e22);
  color: #fff !important;
}

.reganvi-bot-btn.admin:hover {
  background: linear-gradient(145deg, #e67e22, #d35400);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 10px 28px rgba(243, 156, 18, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Botón Registro - Morado */
.reganvi-bot-btn.registro {
  background: linear-gradient(145deg, #9b59b6, #8e44ad);
  color: #fff !important;
}

.reganvi-bot-btn.registro:hover {
  background: linear-gradient(145deg, #8e44ad, #7d3c98);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 10px 28px rgba(155, 89, 182, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Botón Planes - Verde azulado */
.reganvi-bot-btn.planes {
  background: linear-gradient(145deg, #1abc9c, #16a085);
  color: #fff !important;
}

.reganvi-bot-btn.planes:hover {
  background: linear-gradient(145deg, #16a085, #138d75);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 10px 28px rgba(26, 188, 156, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

.reganvi-bot-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s ease;
}

.reganvi-bot-btn:hover::before {
  left: 100%;
}

.reganvi-bot-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* Responsive Design mejorado */
@media (max-width: 500px) {
  #reganvi-bot-bubble {
    width: 92vw;
    right: 4vw;
    bottom: 4vw;
    border-radius: 20px;
  }
  
  #reganvi-bot-bubble:not(.open) {
    width: 100px;
    height: 100px;
    right: 6vw;
    bottom: 6vw;
  }
  
  #reganvi-bot-header {
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    padding: 18px 20px;
    font-size: 1.1em;
  }
  
  #reganvi-bot-content {
    padding: 20px 20px 16px 20px;
    font-size: 0.95em;
    min-height: 180px;
  }
  
  .reganvi-bot-btn {
    padding: 12px 18px;
    font-size: 0.9em;
    margin: 8px 0 4px 0;
    border-radius: 14px;
  }
  
  #reganvi-bot-close {
    width: 28px;
    height: 28px;
    font-size: 1.2em;
    top: 14px;
    right: 16px;
  }
}

@media (max-width: 320px) {
  #reganvi-bot-bubble {
    width: 96vw;
    right: 2vw;
  }
  
  #reganvi-bot-content {
    padding: 18px 16px 14px 16px;
    min-height: 160px;
  }
  
  #reganvi-bot-bubble:not(.open) {
    width: 80px;
    height: 80px;
  }
}

/* Efecto de typing para mensajes */
.typing-indicator {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(155, 142, 214, 0.3);
  border-radius: 50%;
  border-top-color: #9b8ed6;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mejoras para enlaces dentro del contenido */
#reganvi-bot-content a:not(.reganvi-bot-btn) {
  color: #5a3e8a;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}

#reganvi-bot-content a:not(.reganvi-bot-btn):hover {
  color: #9b8ed6;
  border-bottom-color: #9b8ed6;
}

/* Efectos adicionales avanzados */
#reganvi-bot-bubble::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #5a3e8a, #9b8ed6, #8a7bd1, #5a3e8a);
  border-radius: 22px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#reganvi-bot-bubble:hover::before {
  opacity: 0.3;
}

/* Efecto de brillo en el borde */
#reganvi-bot-bubble.open::before {
  animation: borderGlow 2s ease-in-out infinite alternate;
}

@keyframes borderGlow {
  0% { opacity: 0.1; }
  100% { opacity: 0.4; }
}

/* Efecto de sombra dinámica */
#reganvi-bot-bubble {
  filter: drop-shadow(0 10px 20px rgba(90, 62, 138, 0.1));
}

#reganvi-bot-bubble:hover {
  filter: drop-shadow(0 15px 30px rgba(90, 62, 138, 0.2));
}

/* Animación de entrada mejorada */
@keyframes slideInUp {
  from {
    transform: translateY(100%) scale(0.7) rotate(-5deg);
    opacity: 0;
    filter: blur(5px);
  }
  to {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
    filter: blur(0px);
  }
}

/* Estilos adicionales para asegurar que se apliquen */
#reganvi-bot-bubble {
  /* Forzar aplicación de estilos */
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

#reganvi-bot-bubble * {
  box-sizing: border-box !important;
}

/* Asegurar que el header tenga el estilo correcto */
#reganvi-bot-header {
  background: linear-gradient(145deg, #5a3e8a 0%, #9b8ed6 50%, #8a7bd1 100%) !important;
  color: #fff !important;
  padding: 20px 24px !important;
  font-size: 1.2em !important;
  font-weight: 700 !important;
  border-top-left-radius: 18px !important;
  border-top-right-radius: 18px !important;
}

/* Asegurar que el contenido tenga el estilo correcto */
#reganvi-bot-content {
  padding: 24px 24px 20px 24px !important;
  font-size: 1em !important;
  color: #2d3748 !important;
  background: white !important;
  line-height: 1.7 !important;
  min-height: 200px !important;
}