/* ── Chat Widget ─────────────────────────────────── */
/* Floating launcher button */
.chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #00E5BE;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0,229,190,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(0,229,190,0.5);
}
.chat-launcher svg { transition: transform 0.3s; }
.chat-launcher.open svg { transform: rotate(45deg); }

/* Chat panel */
.chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 998;
  width: 360px;
  max-height: 520px;
  background: #111118;
  border: 1px solid rgba(0,229,190,0.18);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 0.25s, transform 0.25s;
}
.chat-panel.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Header */
.chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0,229,190,0.05);
}
.chat-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,229,190,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-header-info { flex: 1; }
.chat-header-name { font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700; color: #EDE8DF; }
.chat-header-status { font-size: 0.7rem; color: #00E5BE; display: flex; align-items: center; gap: 0.3rem; }
.chat-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #00E5BE; }

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,229,190,0.2); border-radius: 4px; }

/* Bubbles */
.chat-bubble-wrap { display: flex; flex-direction: column; gap: 0.2rem; }
.chat-bubble-wrap.user { align-items: flex-end; }
.chat-bubble-wrap.bot  { align-items: flex-start; }

.chat-bubble {
  max-width: 80%;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  animation: bubbleIn 0.2s ease-out;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: scale(0.95) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.chat-bubble.bot {
  background: rgba(0,229,190,0.08);
  color: rgba(237,232,223,0.85);
  border-bottom-left-radius: 4px;
}
.chat-bubble.user {
  background: rgba(0,229,190,0.18);
  color: #EDE8DF;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  animation: bubbleIn 0.2s ease-out;
}
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 0.55rem 0.85rem;
  background: rgba(0,229,190,0.06);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0,229,190,0.5);
  animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Intent badge */
.intent-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.intent-badge.urgent {
  background: rgba(255,80,80,0.15);
  color: #ff6060;
  border: 1px solid rgba(255,80,80,0.2);
}
.intent-badge.normal {
  background: rgba(0,229,190,0.1);
  color: #00E5BE;
  border: 1px solid rgba(0,229,190,0.15);
}
.intent-badge.complete {
  background: rgba(100,220,100,0.1);
  color: #6eea6e;
  border: 1px solid rgba(100,220,100,0.15);
}

/* Input area */
.chat-input-area {
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif;
  color: #EDE8DF;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input::placeholder { color: rgba(237,232,223,0.35); }
.chat-input:focus { border-color: rgba(0,229,190,0.4); }

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #00E5BE;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
}
.chat-send-btn:disabled { opacity: 0.4; cursor: default; }
.chat-send-btn:not(:disabled):hover { transform: scale(1.08); }
.chat-send-btn:not(:disabled):active { transform: scale(0.95); }

/* Mobile */
@media (max-width: 480px) {
  .chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 75vh;
    border-radius: 16px 16px 0 0;
  }
  .chat-launcher { bottom: 16px; right: 16px; }
}