/**
 * Chat Burbuja n8n - Estilos CSS
 */
#chat-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999998;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

#chat-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#chat-bubble img {
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);
}

#chat-box {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 320px;
  height: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

#chat-box.chat-visible {
  opacity: 1;
  transform: translateY(0);
}

#chat-header {
  padding: 15px;
  background: #0073aa;
  color: #fff;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

#chat-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

.user-message, .bot-message {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 5px;
  word-wrap: break-word;
  position: relative;
  font-size: 14px;
  line-height: 1.4;
}

.user-message {
  background: #e6f2ff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.bot-message {
  background: #f0f0f0;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.user-message strong, .bot-message strong {
  font-weight: 600;
  color: #444;
}

#chat-input-container {
  display: flex;
  padding: 10px 15px;
  border-top: 1px solid #e0e0e0;
  background: #f9f9f9;
}

#chat-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 20px;
  outline: none;
  font-size: 14px;
}

#chat-input:focus {
  border-color: #0073aa;
  box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.2);
}

#chat-send {
  width: 36px;
  height: 36px;
  background: #0073aa;
  border: none;
  border-radius: 50%;
  margin-left: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#chat-send:hover {
  background: #005b88;
}

#chat-send img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

/* Responsive styles */
@media screen and (max-width: 480px) {
  #chat-box {
    width: calc(100% - 40px);
    height: 60vh;
    bottom: 80px;
  }
  
  #chat-bubble {
    width: 50px;
    height: 50px;
  }
  
  #chat-bubble img {
    width: 26px;
    height: 26px;
  }
}