/* ============================================================
   chatbot.css — Floating widget + chat panel
   ============================================================ */

/* ── FAB ── */
.chat-fab {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 90;
  width: 60px; height: 60px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #04111a;
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.3);
  transition: transform 200ms, box-shadow 200ms;
}
.chat-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 40px rgba(0, 212, 255, 0.45);
}
.chat-fab-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(0, 212, 255, 0.6);
  animation: fabPulse 2.4s ease-out infinite;
}
@keyframes fabPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.65); opacity: 0; }
}

/* ── Panel ── */
.chat-panel {
  position: fixed;
  bottom: 100px; right: 28px;
  z-index: 95;
  width: 360px;
  height: 500px;
  max-height: calc(100vh - 130px);
  background: rgba(13, 13, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 212, 255, 0.06);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 280ms cubic-bezier(.2, .9, .2, 1.2), opacity 220ms ease;
}
.chat-panel.open {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

/* ── Header ── */
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.06), transparent);
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #04111a; flex-shrink: 0;
}
.chat-title-block { flex: 1; line-height: 1.25; }
.chat-title-block strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 600;
}
.chat-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-muted);
}
.chat-dot-online {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}
.chat-close {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text-muted);
  transition: color 180ms, background 180ms;
}
.chat-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

/* ── Messages ── */
.chat-messages {
  flex: 1; padding: 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg {
  max-width: 80%; padding: 10px 14px;
  border-radius: 14px; font-size: 14px; line-height: 1.55;
  animation: msgIn 250ms cubic-bezier(.2, .9, .2, 1.2) both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-msg.ai {
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #03101a; font-weight: 500;
  border-top-right-radius: 4px;
}
.chat-msg.error {
  align-self: flex-start;
  background: rgba(255, 85, 119, 0.1);
  border: 1px solid rgba(255, 85, 119, 0.3);
  color: #ffb0c0;
}
.chat-typing {
  align-self: flex-start;
  display: inline-flex; gap: 4px; padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px; border-top-left-radius: 4px;
}
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-cyan);
  animation: typingDot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ── Suggestions ── */
.chat-suggestions { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.suggest {
  text-align: left; padding: 9px 12px;
  font-size: 13px;
  border: 1px dashed rgba(0, 212, 255, 0.3);
  border-radius: 10px; color: rgba(240,242,248,0.65);
  transition: border-color 180ms, color 180ms, background 180ms;
}
.suggest:hover {
  border-color: var(--accent-cyan); border-style: solid;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.05);
}

/* ── Input ── */
.chat-input-form {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.chat-input-form input {
  flex: 1; padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-primary);
  outline: none; font-size: 14px;
  transition: border-color 180ms, box-shadow 180ms;
}
.chat-input-form input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
}
.chat-input-form button {
  width: 42px; height: 42px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #04111a;
  transition: transform 160ms, box-shadow 160ms;
}
.chat-input-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3);
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .chat-panel {
    right: 0; left: 0; bottom: 0; width: 100%;
    height: 78vh; max-height: 78vh;
    border-radius: 18px 18px 0 0;
  }
  .chat-fab { bottom: 20px; right: 20px; }
}
