/* ── CHAT WIDGET ── */
.chat-bubble {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 200;
}

.chat-toggle {
  width: 58px; height: 58px;
  background: var(--blue);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 24px rgba(0,102,255,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(0,102,255,0.6);
}

.chat-toggle .notif {
  position: absolute;
  top: -2px; right: -2px;
  width: 14px; height: 14px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--bg);
  animation: pulse 2s infinite;
}

.chat-window {
  position: absolute;
  bottom: 70px; right: 0;
  width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  display: none;
  flex-direction: column;
  max-height: 480px;
}

.chat-window.open { display: flex; animation: slideUp 0.3s ease; }

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

.chat-header {
  background: var(--blue);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.chat-header-info { flex: 1; }
.chat-header-name { font-weight: 700; font-size: 0.95rem; }
.chat-header-status {
  font-size: 0.72rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 5px;
}
.chat-header-status::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
  max-height: 300px;
}

.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.55;
  animation: fadeUp 0.3s ease both;
}

.msg.bot {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--white);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg.user {
  background: var(--blue);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.typing {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  max-width: fit-content;
}

.typing span {
  width: 6px; height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: typing-dot 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}

.quick-reply {
  background: rgba(0,102,255,0.1);
  border: 1px solid rgba(0,102,255,0.25);
  color: var(--teal);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.quick-reply:hover { background: rgba(0,102,255,0.2); }

.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--white);
  padding: 9px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
}
.chat-input:focus { border-color: var(--blue); }

.chat-send {
  background: var(--blue);
  border: none;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-send:hover { background: #0052cc; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .chat-window { width: 320px; }
}
