/* Chatbot de Sintesia Studio - Estilos */

.sintesia-chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 13px;
  z-index: 9999;
  font-family: 'Poppins', sans-serif;
}

/* Botón del chatbot */
.chatbot-button {
  position: fixed;
  bottom: 10%; /* Ajustado para que se vea la flecha detrás */
  right: 5px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #005670 0%, #003a4c 100%);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 86, 112, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  position: relative;
  overflow: hidden;
}

.chatbot-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 50%;
}

.chatbot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0, 86, 112, 0.6);
}

.chatbot-button i {
  font-size: 24px;
  color: white;
}

/*animaciones de entrada*/

/* Animación de entrada desde la izquierda con rebote */
@keyframes slideInFromLeft {
  0% { 
    transform: translateX(-300px); 
    opacity: 0;
  }
  70% { 
    transform: translateX(10px); 
    opacity: 1;
  }
  85% { 
    transform: translateX(-5px); 
  }
  100% { 
    transform: translateX(0); 
    opacity: 1;
  }
}

/* Animación de salto diagonal (arriba-izquierda) */
@keyframes diagonalBounce {
  0%, 100% { 
    transform: translate(0, 0); 
  }
  40% { 
    transform: translate(-15px, -25px); 
  }
  60% { 
    transform: translate(-10px, -20px); 
  }
}

/* Clase para aplicar la animación de entrada */
.chatbot-slide-in {
  animation: slideInFromLeft 1.8s ease-out forwards;
}

/* Clase para aplicar la animación de salto diagonal */
.chatbot-diagonal-bounce {
  animation: diagonalBounce 1s ease 2;
}

@keyframes buttonBounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-30px); } /* Mayor altura = más agresivo */
  60% { transform: translateY(-25px); }
}

.chatbot-button-bounce {
  animation: buttonBounce 0.7s ease 3; /* Más rápido y más repeticiones */
}

@keyframes buttonShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-10px); }
  80% { transform: translateX(10px); }
}
.chatbot-button-bounce {
  animation: buttonShake 0.5s ease 2;
}


@keyframes buttonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.chatbot-button-bounce {
  animation: buttonPulse 0.8s ease 3;
}



/* Estilo para subrayado con difuminado */
.highlight-underline {
  position: relative;
  display: inline-block;
}

.highlight-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px; /* Ajusta la posición vertical de la línea */
  width: 100%;
  height: 3px; /* Grosor de la línea */
  background: var(--degradado-sintesia);
  border-radius: 2px;
}




/* Ventana del chatbot */
.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 700px; /* Ancho aumentado para escritorio */
  height: 650px; /* Altura aumentada para escritorio */
  max-height: 80vh; /* Altura máxima relativa */
  max-width: 90vw; /* Ancho máximo relativo para móviles */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px; /* Mantener bordes redondeados */
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  resize: none; /* Quitamos resize nativo */
  overflow: auto;
}

/* Indicador visual para el resize */
.resize-indicator {
  position: absolute;
  left: 5px;
  bottom: 5px;
  color: rgba(0, 86, 112, 0.5);
  font-size: 16px;
  pointer-events: none;
}

.chatbot-window {
  transform-origin: bottom right;
  transform: scale(0);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.chatbot-window.active {
  transform: scale(1);
  opacity: 1;
}

/* Cabecera del chatbot */
.chatbot-header {
  padding: 15px 20px;
  background: linear-gradient(135deg, #005670 0%, #003a4c 100%);
  background-color: rgba(0, 86, 112, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header-title {
  display: flex;
  align-items: center;
}

.chatbot-header-title img {
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 50%;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.chatbot-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-close:hover {
  transform: scale(1.2);
}

/* Cuerpo del chatbot */
.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: rgba(245, 245, 250, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Estilos para los mensajes */
.message {
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 18px;
  max-width: 75%;
  animation: fadeIn 0.3s;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.user {
  background: linear-gradient(135deg, #005670 0%, #003a4c 100%);
  color: white;
  margin-left: auto;
  border-top-right-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 86, 112, 0.3);
}

.message.assistant {
  background-color: rgba(240, 240, 245, 0.8);
  color: #333;
  margin-right: auto;
  border-top-left-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  max-width: 99%;
}

/* Evitar que se muestre una burbuja del asistente vacía */
.message.assistant:empty {
  display: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

/* Indicador de escritura */
.typing-indicator {
  background-color: rgba(240, 240, 245, 0.8);
  color: #333;
  margin-right: auto;
  border-top-left-radius: 5px;
  padding: 15px 20px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  max-width: 75px;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background-color: #005670;
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
  animation: typing 1.5s infinite ease-in-out;
  box-shadow: 0 0 5px rgba(0, 86, 112, 0.3);
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Estilos para el contenedor de sugerencias */
.suggestions-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 15px;
  background-color: rgba(245, 245, 250, 0.3);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.suggestion-button {
  background: rgba(0, 86, 112, 0.1);
  border: 1px solid rgba(0, 86, 112, 0.2);
  color: #005670;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

.suggestion-button:hover {
  background: rgba(0, 86, 112, 0.2);
  transform: translateY(-2px);
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background-color: #005670;
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
  animation: typing 1.5s infinite ease-in-out;
  box-shadow: 0 0 5px rgba(0, 86, 112, 0.3);
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0% {
    transform: translateY(0px);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
  100% {
    transform: translateY(0px);
    opacity: 0.7;
  }
}

/* Footer del chatbot */
.chatbot-input {
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.chatbot-input input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  outline: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.chatbot-input input:focus {
  border-color: #005670;
  box-shadow: 0 0 0 2px rgba(0, 86, 112, 0.1);
}

.chatbot-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #005670 0%, #003a4c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.chatbot-send::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
  transform: rotate(45deg);
}

.chatbot-send:hover {
  transform: scale(1.1);
}

.chatbot-send i {
  color: white;
  font-size: 18px;
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Estilos responsivos */

@media (max-width: 768px) {
  .sintesia-chatbot-container {
    bottom: 10px;
    right: 4px;
  }
}


@media (max-width: 480px) {
  .chatbot-window {
    width: max-content;
    right: 0;
    bottom: 50px;
    height: 85vh;
    position: absolute;
    max-height: 94vh;
    max-width: 99vw;
  }



  .chatbot-send {
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 8px !important;
  }
  
  .chatbot-button {
    width: 50px;
    height: 50px;
    right: 5px;
  }
  
  .chatbot-container {
    bottom: 20px;
    right: 20px;
  }
}
