/* Chatbot: 3D neon style */
.chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  font-family: var(--font);
}
.chatbot-toggle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--bg-card);
  border: 2px solid var(--neon-green);
  box-shadow: 0 0 24px var(--neon-green-soft), inset 0 0 20px rgba(0, 255, 136, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
  perspective: 200px;
}
.chatbot-toggle:hover {
  transform: scale(1.08) rotateY(-5deg);
  box-shadow: 0 0 32px var(--neon-green-soft), 0 0 0 1px var(--neon-green);
}
.chatbot-toggle-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(8px);
}
.chatbot-icon {
  width: 28px;
  height: 28px;
  color: var(--neon-green);
}
.chatbot-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  max-height: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 255, 136, 0.2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.chatbot-widget.open .chatbot-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.chatbot-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0, 255, 136, 0.06) 0%, transparent 100%);
}
.chatbot-panel-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--neon-green);
  margin: 0;
}
.chatbot-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.chatbot-close:hover { color: var(--text); }
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 320px;
}
.chatbot-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.4;
  animation: chatbotMsgIn 0.3s ease;
}
@keyframes chatbotMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chatbot-msg.bot {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chatbot-msg.user {
  align-self: flex-end;
  background: var(--neon-green-soft);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.chatbot-msg.typing {
  align-self: flex-start;
  padding: 12px 20px;
}
.chatbot-msg.typing::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-green);
  animation: chatbotDot 1s ease-in-out infinite;
  margin-left: 4px;
}
@keyframes chatbotDot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.chatbot-input-wrap {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}
.chatbot-input {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 0.95rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chatbot-input:focus {
  outline: none;
  border-color: var(--neon-green);
  box-shadow: 0 0 0 2px var(--neon-green-soft);
}
.chatbot-send {
  padding: 12px 20px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--neon-green);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.chatbot-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--neon-green-soft);
}
.chatbot-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 480px) {
  .chatbot-widget { bottom: 16px; right: 16px; }
  .chatbot-toggle { width: 56px; height: 56px; }
  .chatbot-panel { width: calc(100vw - 32px); right: -8px; bottom: 72px; max-height: 70vh; }
}
