/* Chatbot Styles */
.chatbot-container {
  position: fixed;
  bottom: 100px; /* Posicionar encima del botón de WhatsApp */
  right: 20px; /* Misma posición horizontal que WhatsApp */
  z-index: 1000;
  font-family: 'Open Sans', sans-serif;
}

/* Ajustar el botón de WhatsApp para que no interfiera */
.whatsapp-float {
  z-index: 10001 !important; /* Asegurar que WhatsApp esté por encima */
}

/* Opción alternativa: Apilar botones verticalmente */
@media (min-width: 769px) {
  .chatbot-container {
    bottom: 100px; /* Encima del WhatsApp en desktop */
    right: 20px; /* Misma posición horizontal */
  }
}

/* Los botones están apilados verticalmente, no necesitamos mover WhatsApp */

.chatbot-toggle {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.chatbot-toggle i {
  color: white;
  font-size: 24px;
  transition: transform 0.3s ease;
}

.chatbot-toggle.active i {
  transform: rotate(45deg);
}

.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.9);
  opacity: 0;
  transition: all 0.3s ease;
}

.chatbot-window.active {
  display: flex;
  transform: translateY(0) scale(1);
  opacity: 1;
}

.chatbot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.chatbot-header-info h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chatbot-header-info p {
  margin: 0;
  font-size: 12px;
  opacity: 0.9;
}

.chatbot-close {
  margin-left: auto;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chatbot-message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chatbot-message.user {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

.chatbot-message.bot {
  background: white;
  color: #333;
  align-self: flex-start;
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  align-self: flex-start;
  max-width: 80px;
}

.chatbot-typing-dot {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.chatbot-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chatbot-input-container {
  padding: 20px;
  background: white;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 10px;
  align-items: center;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #e9ecef;
  border-radius: 25px;
  padding: 12px 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.chatbot-input:focus {
  border-color: #667eea;
}

.chatbot-send {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.chatbot-send:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chatbot-welcome {
  text-align: center;
  padding: 20px;
  color: #666;
}

.chatbot-welcome h5 {
  margin: 0 0 10px 0;
  color: #333;
  font-weight: 600;
}

.chatbot-welcome p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.chatbot-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.chatbot-quick-action {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #667eea;
}

.chatbot-quick-action:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .chatbot-container {
    bottom: 85px; /* Encima del WhatsApp en móviles */
    right: 20px; /* Misma posición horizontal */
  }
  
  .chatbot-window {
    width: 320px;
    height: 450px;
    bottom: 75px;
  }
  
  .chatbot-toggle {
    width: 55px;
    height: 55px;
  }
  
  .chatbot-toggle i {
    font-size: 22px;
  }
  
  /* Los botones están apilados verticalmente en móviles también */
}

@media (max-width: 480px) {
  .chatbot-container {
    bottom: 75px; /* Encima del WhatsApp en pantallas pequeñas */
    right: 15px; /* Misma posición horizontal */
  }
  
  .chatbot-window {
    width: calc(100vw - 30px);
    right: -15px;
    height: 400px;
  }
  
  /* Los botones están apilados verticalmente en pantallas pequeñas también */
}

/* Animation for new messages */
.chatbot-message.new {
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state */
.chatbot-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
