/* ===== CHATBOT WINDOW - VENTANA DE CHAT FLOTANTE ===== */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 380px;
  height: 600px;
  max-height: 80vh;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
              0 0 40px rgba(0, 212, 255, 0.2),
              inset 0 0 20px rgba(0, 212, 255, 0.05);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.chatbot-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

/* Header del chat */
.chatbot-header {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.1));
  padding: 20px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.chatbot-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #00d4ff, #00ff88);
  opacity: 0.6;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4ff, #00ff88);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.chatbot-avatar i {
  font-size: 22px;
  color: #ffffff;
}

.chatbot-header-text {
  display: flex;
  flex-direction: column;
}

.chatbot-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.chatbot-status {
  font-size: 12px;
  color: #00ff88;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.chatbot-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff88;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.9);
  }
}

.chatbot-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chatbot-close:hover {
  background: rgba(255, 68, 68, 0.2);
  border-color: rgba(255, 68, 68, 0.4);
  transform: rotate(90deg);
}

/* Área de mensajes */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scroll-behavior: smooth;
}

/* Estilos del scrollbar */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.3);
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.5);
}

/* Mensajes */
.chatbot-message {
  display: flex;
  gap: 10px;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-message.bot {
  align-self: flex-start;
}

.chatbot-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chatbot-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-message.bot .chatbot-message-avatar {
  background: linear-gradient(135deg, #00d4ff, #00ff88);
}

.chatbot-message.user .chatbot-message-avatar {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.chatbot-message-avatar i {
  font-size: 14px;
  color: #ffffff;
}

.chatbot-message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chatbot-message.bot .chatbot-message-content {
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #ffffff;
  border-bottom-left-radius: 4px;
}

.chatbot-message.user .chatbot-message-content {
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chatbot-message-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  text-align: right;
}

.chatbot-message.bot .chatbot-message-time {
  text-align: left;
}

/* Área de entrada */
.chatbot-input-area {
  padding: 20px;
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
}

.chatbot-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chatbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 20px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: all 0.3s ease;
}

.chatbot-input:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.chatbot-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chatbot-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4ff, #00ff88);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.chatbot-send:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

.chatbot-send:active {
  transform: scale(0.95);
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Mensaje de bienvenida inicial */
.chatbot-welcome {
  padding: 20px;
  text-align: center;
}

.chatbot-welcome-icon {
  font-size: 48px;
  color: #00d4ff;
  margin-bottom: 15px;
}

.chatbot-welcome-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.chatbot-welcome-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

/* Typing indicator */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 18px;
  width: fit-content;
  border-bottom-left-radius: 4px;
}

.chatbot-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00d4ff;
  animation: typingDot 1.4s ease-in-out infinite;
}

.chatbot-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .chatbot-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    bottom: 90px;
    right: 20px;
    left: 20px;
  }
  
  .chatbot-message-content {
    max-width: 80%;
  }
}

