/* ============================================
   CHATBOT WIDGET - CYBERPUNK STYLE
   ============================================ */

/* === BUBBLE === */
.chatbot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-magenta));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  box-shadow:
    0 4px 20px rgba(139, 92, 246, 0.4),
    0 0 40px rgba(139, 92, 246, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #fff;
}

.chatbot-bubble:hover {
  transform: scale(1.1);
  box-shadow:
    0 4px 30px rgba(139, 92, 246, 0.6),
    0 0 60px rgba(139, 92, 246, 0.25);
}

.bubble-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--neon-purple);
  animation: bubblePulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes bubblePulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.3); opacity: 0; }
}

/* === PANEL === */
.chatbot-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-height: 520px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  z-index: 901;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(139, 92, 246, 0.1);
  animation: chatSlideUp 0.3s ease;
}

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

.chatbot-panel.hidden {
  display: none;
}

/* === HEADER === */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--neon-purple);
  flex-shrink: 0;
}

.chatbot-header h4 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.chatbot-status {
  font-size: 0.7rem;
  color: var(--neon-green);
  font-family: var(--font-mono);
}

.chatbot-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.chatbot-close:hover {
  color: var(--neon-magenta);
}

/* === MESSAGES === */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
  max-height: 340px;
}

.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: msgFade 0.3s ease;
}

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

.chat-msg.bot {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  color: var(--text-secondary);
}

.chat-msg.user {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  color: var(--text-primary);
}

.chat-msg.typing {
  padding: 12px 20px;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--neon-purple);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* === INPUT === */
.chatbot-input-form {
  display: flex;
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  gap: 8px;
}

.chatbot-input-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.chatbot-input-form input:focus {
  border-color: var(--neon-purple);
}

.chatbot-input-form button {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-magenta));
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.chatbot-input-form button:hover {
  transform: scale(1.05);
}

/* === MOBILE === */
@media (max-width: 480px) {
  .chatbot-panel {
    right: 10px;
    left: 10px;
    bottom: 90px;
    width: auto;
    max-height: 70vh;
  }

  .chatbot-bubble {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
}
