/* === AXIOM Portfolio — chatbot.css === */

/* ── Mascot click hint ─────────────────────────────────────── */
#axiom-sticky {
  cursor: none;
  transition: filter 0.3s ease;
}

#axiom-sticky.chatbot-open {
  filter: drop-shadow(0 0 40px rgba(0, 245, 255, 0.8)) !important;
}


/* ── Chat panel ────────────────────────────────────────────── */
#axiom-chat {
  position: fixed;
  bottom: 320px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: min(420px, 92vw);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#axiom-chat.open {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.chat-panel {
  background: rgba(5, 5, 16, 0.96);
  border: 1px solid rgba(0, 245, 255, 0.35);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 245, 255, 0.15), 0 20px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── Header ────────────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(0, 245, 255, 0.05);
  border-bottom: 1px solid rgba(0, 245, 255, 0.15);
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #28CA41;
  box-shadow: 0 0 8px #28CA41;
  flex-shrink: 0;
  animation: statusPulse 2s ease infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.chat-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-primary);
  letter-spacing: 0.12em;
  flex: 1;
}

.chat-subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.chat-close {
  background: transparent;
  border: 1px solid rgba(0, 245, 255, 0.2);
  color: var(--color-text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.chat-close:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 0 10px rgba(255, 45, 120, 0.3);
}

/* ── Messages ──────────────────────────────────────────────── */
.chat-messages {
  height: 300px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 245, 255, 0.3) transparent;
}

.chat-messages::-webkit-scrollbar       { width: 3px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0, 245, 255, 0.3); border-radius: 2px; }

.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  animation: msgIn 0.3s ease;
}

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

.chat-msg.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.chat-msg.axiom .msg-avatar {
  background: rgba(0, 245, 255, 0.12);
  border: 1px solid rgba(0, 245, 255, 0.4);
  color: var(--color-primary);
}

.chat-msg.user .msg-avatar {
  background: rgba(123, 47, 255, 0.15);
  border: 1px solid rgba(123, 47, 255, 0.4);
  color: var(--color-secondary);
}

.msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.chat-msg.axiom .msg-bubble {
  background: rgba(0, 245, 255, 0.07);
  border: 1px solid rgba(0, 245, 255, 0.2);
  color: var(--color-text);
  border-bottom-left-radius: 4px;
}

.chat-msg.user .msg-bubble {
  background: rgba(123, 47, 255, 0.15);
  border: 1px solid rgba(123, 47, 255, 0.3);
  color: var(--color-text);
  border-bottom-right-radius: 4px;
  text-align: right;
}

/* ── Typing indicator ──────────────────────────────────────── */
.chat-typing {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0, 245, 255, 0.07);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: dot 1.2s ease infinite;
}

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

@keyframes dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* ── Input area ────────────────────────────────────────────── */
.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 245, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.chat-input {
  flex: 1;
  background: rgba(0, 245, 255, 0.05);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--color-text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  outline: none;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

.chat-input:focus {
  border-color: rgba(0, 245, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.1);
}

.chat-send {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-primary);
  border: none;
  color: var(--color-bg);
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: box-shadow 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.chat-send:hover {
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.5);
  transform: scale(1.05);
}

.chat-send:disabled {
  opacity: 0.4;
  transform: none;
  box-shadow: none;
}

/* ── Error state ───────────────────────────────────────────── */
.msg-bubble.error {
  color: var(--color-accent);
  border-color: rgba(255, 45, 120, 0.3);
  background: rgba(255, 45, 120, 0.06);
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #axiom-chat {
    bottom: 240px;
    width: 94vw;
  }

  .chat-messages { height: 240px; }
}
