/* Chatbot Bonsai - Diseño simple con bonsái visual */

/* Burbuja flotante con imagen de bonsái */
#plantabot-bubble {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #2d5016;
  color: #fff;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(45, 80, 22, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s ease;
  border: 3px solid #4a7c2e;
}

#plantabot-bubble:hover {
  background: #4a7c2e;
  transform: scale(1.1);
}

#plantabot-bubble::before {
  content: '🌳';
  position: absolute;
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Ventana de chat */
#plantabot-chat-window {
  position: fixed;
  bottom: 120px;
  right: 30px;
  width: 380px;
  max-width: 90vw;
  height: 500px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(45, 80, 22, 0.2);
  display: none;
  flex-direction: column;
  z-index: 10000;
  overflow: hidden;
  border: 2px solid #4a7c2e;
}

.chat-header {
  background: #2d5016;
  color: #fff;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1.2rem;
  position: relative;
}

.chat-header::after {
  content: '🌳 Bonsai Bot';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
}

#close-chat {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  margin-left: auto;
  z-index: 1;
}

.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f9f9f9;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 50px,
      rgba(74, 124, 46, 0.03) 50px,
      rgba(74, 124, 46, 0.03) 100px
    );
}

/* Mensajes */
.msg {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 80%;
  word-break: break-word;
  font-size: 0.95rem;
  line-height: 1.4;
}

.msg.user {
  background: #4a7c2e;
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.msg.bot {
  background: #fff;
  color: #333;
  margin-right: auto;
  border-bottom-left-radius: 4px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.msg.bot::before {
  content: '🌳 ';
  font-size: 1rem;
}

/* Formulario */
#chat-form {
  display: flex;
  border-top: 2px solid #4a7c2e;
  background: #fff;
  padding: 12px;
}

#chat-input {
  flex: 1;
  border: 2px solid #4a7c2e;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 25px;
  outline: none;
  margin-right: 10px;
}

#chat-input:focus {
  border-color: #2d5016;
  box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

#chat-form button {
  background: #4a7c2e;
  color: #fff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chat-form button:hover {
  background: #2d5016;
  transform: scale(1.1);
}

/* Indicador de escritura */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 15px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e0e0e0;
  width: fit-content;
  margin-bottom: 12px;
}

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

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Responsive */
@media (max-width: 480px) {
  #plantabot-chat-window {
    width: 95vw;
    height: 70vh;
    bottom: 90px;
    right: 2.5vw;
  }

  #plantabot-bubble {
    width: 65px;
    height: 65px;
    bottom: 20px;
    right: 20px;
  }
}