/* ============================================================
   CHAT WIDGET — Assistant IA Medusa (bottom-right)
   Proxy worker medusa-chat. Logique dans chat.js. Couleurs signature.
   ============================================================ */
.mv13-chat-launcher {
  position: fixed; bottom: 24px; right: 24px; width: 62px; height: 62px;
  border-radius: 50%; background: linear-gradient(135deg, #d946ef 0%, #6366f1 100%);
  box-shadow: 0 10px 40px rgba(217, 70, 239, 0.4), 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer; z-index: 9998; display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
  border: none; color: white; animation: mv13ChatLauncherPulse 3.5s ease-in-out infinite;
}
.mv13-chat-launcher:hover { transform: scale(1.08); box-shadow: 0 15px 50px rgba(217, 70, 239, 0.7), 0 6px 16px rgba(0,0,0,0.4); animation-play-state: paused; }
@keyframes mv13ChatLauncherPulse { 0%, 100% { box-shadow: 0 10px 40px rgba(217, 70, 239, 0.4), 0 4px 12px rgba(0,0,0,0.3); } 50% { box-shadow: 0 10px 50px rgba(217, 70, 239, 0.7), 0 4px 12px rgba(0,0,0,0.3); } }
.mv13-chat-launcher-icon { width: 26px; height: 26px; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
.mv13-chat-launcher.mv13-chat-is-open .mv13-chat-launcher-icon { transform: rotate(90deg) scale(0); }
.mv13-chat-launcher-close { position: absolute; font-size: 1.4rem; line-height: 1; color: #fff; opacity: 0; transform: scale(0.6); transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.mv13-chat-launcher.mv13-chat-is-open .mv13-chat-launcher-close { opacity: 1; transform: scale(1); }
.mv13-chat-launcher-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px; background: #ef4444; color: white; font-size: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #0a0a0f; opacity: 0; transform: scale(0); transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.mv13-chat-launcher-badge.mv13-show { opacity: 1; transform: scale(1); }

.mv13-chat-invite { position: fixed; bottom: 100px; right: 24px; z-index: 9997; max-width: 280px; padding: 14px 38px 14px 16px; background: rgba(15, 15, 20, 0.94); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px 16px 4px 16px; box-shadow: 0 15px 40px rgba(0,0,0,0.5), 0 0 30px rgba(217, 70, 239, 0.15); color: #f1f5f9; font-family: 'Inter', sans-serif; font-size: 0.87rem; line-height: 1.45; opacity: 0; transform: translateY(12px) scale(0.95); transform-origin: bottom right; transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; cursor: pointer; }
.mv13-chat-invite.mv13-show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.mv13-chat-invite b { color: #fff; font-weight: 600; }
.mv13-chat-invite-close { position: absolute; top: 6px; right: 8px; background: none; border: none; color: #64748b; font-size: 1rem; cursor: pointer; padding: 4px 8px; line-height: 1; border-radius: 4px; transition: color 0.2s, background 0.2s; }
.mv13-chat-invite-close:hover { color: #fff; background: rgba(255,255,255,0.06); }

.mv13-chat-panel { position: fixed; bottom: 100px; right: 24px; width: 380px; height: 560px; max-height: calc(100vh - 140px); background: rgba(10, 10, 15, 0.96); backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; box-shadow: 0 25px 60px rgba(0,0,0,0.65), 0 0 50px rgba(217, 70, 239, 0.12); z-index: 9996; display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: translateY(20px) scale(0.96); transform-origin: bottom right; transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; font-family: 'Inter', sans-serif; }
.mv13-chat-panel.mv13-chat-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.mv13-chat-header { padding: 16px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); background: linear-gradient(180deg, rgba(217, 70, 239, 0.1), transparent); flex-shrink: 0; }
.mv13-chat-header-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #d946ef, #6366f1); padding: 2px; flex-shrink: 0; position: relative; }
.mv13-chat-header-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.mv13-chat-header-avatar::after { content: ''; position: absolute; bottom: 0; right: 0; width: 11px; height: 11px; border-radius: 50%; background: #10b981; border: 2px solid rgba(10, 10, 15, 1); box-shadow: 0 0 8px rgba(16, 185, 129, 0.7); }
.mv13-chat-header-info { flex: 1; min-width: 0; }
.mv13-chat-header-title { font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 0.95rem; color: #fff; line-height: 1.2; letter-spacing: -0.01em; }
.mv13-chat-header-sub { font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }
.mv13-chat-header-close { background: none; border: none; color: #94a3b8; font-size: 1.3rem; cursor: pointer; padding: 4px 8px; border-radius: 8px; transition: color 0.2s, background 0.2s; line-height: 1; }
.mv13-chat-header-close:hover { color: #fff; background: rgba(255,255,255,0.06); }
.mv13-chat-messages { flex: 1; overflow-y: auto; padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }
.mv13-chat-messages::-webkit-scrollbar { width: 6px; }
.mv13-chat-messages::-webkit-scrollbar-track { background: transparent; }
.mv13-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.mv13-chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 0.87rem; line-height: 1.5; word-wrap: break-word; animation: mv13ChatMsgIn 0.45s cubic-bezier(0.16, 1, 0.3, 1); white-space: pre-wrap; }
@keyframes mv13ChatMsgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.mv13-chat-msg-assistant { align-self: flex-start; background: rgba(255,255,255,0.06); color: #f1f5f9; border-bottom-left-radius: 4px; border: 1px solid rgba(255,255,255,0.04); }
.mv13-chat-msg-user { align-self: flex-end; background: linear-gradient(135deg, #d946ef, #a855f7); color: #fff; border-bottom-right-radius: 4px; box-shadow: 0 4px 12px rgba(217, 70, 239, 0.25); }
.mv13-chat-msg a { color: inherit; text-decoration: underline; opacity: 0.9; }
.mv13-chat-msg a:hover { opacity: 1; }
.mv13-chat-typing { align-self: flex-start; display: flex; gap: 5px; padding: 12px 14px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.04); border-radius: 16px; border-bottom-left-radius: 4px; }
.mv13-chat-typing-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: mv13TypingBounce 1.2s infinite ease-in-out; }
.mv13-chat-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.mv13-chat-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes mv13TypingBounce { 0%, 80%, 100% { transform: scale(0.55); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }
.mv13-chat-quick { padding: 8px 18px 12px; display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.mv13-chat-quick-btn { padding: 7px 13px; background: rgba(217, 70, 239, 0.1); color: #e879f9; border: 1px solid rgba(217, 70, 239, 0.2); border-radius: 100px; font-size: 0.72rem; font-weight: 500; cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif; }
.mv13-chat-quick-btn:hover { background: rgba(217, 70, 239, 0.2); border-color: rgba(217, 70, 239, 0.4); transform: translateY(-1px); }
.mv13-chat-input-wrap { padding: 14px 18px 10px; border-top: 1px solid rgba(255,255,255,0.06); display: flex; gap: 10px; align-items: flex-end; flex-shrink: 0; }
.mv13-chat-input { flex: 1; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; color: #f1f5f9; font-family: 'Inter', sans-serif; font-size: 0.88rem; padding: 10px 14px; resize: none; max-height: 100px; min-height: 40px; outline: none; transition: border-color 0.2s, background 0.2s; line-height: 1.4; }
.mv13-chat-input:focus { border-color: rgba(217, 70, 239, 0.4); background: rgba(255,255,255,0.06); }
.mv13-chat-input::placeholder { color: #64748b; }
.mv13-chat-send { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #d946ef, #6366f1); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; border: none; transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s; box-shadow: 0 4px 12px rgba(217, 70, 239, 0.3); }
.mv13-chat-send:hover:not(:disabled) { transform: scale(1.06); box-shadow: 0 6px 18px rgba(217, 70, 239, 0.5); }
.mv13-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
.mv13-chat-footer { padding: 0 18px 12px; font-size: 0.66rem; color: #64748b; text-align: center; line-height: 1.35; flex-shrink: 0; }
.mv13-chat-footer a { color: #94a3b8; text-decoration: underline; }
@media (max-width: 500px) {
  .mv13-chat-panel { bottom: 0; right: 0; left: 0; width: 100%; height: calc(100vh - 90px); max-height: none; border-radius: 20px 20px 0 0; transform-origin: bottom center; }
  .mv13-chat-invite { max-width: calc(100vw - 48px); right: 24px; left: 24px; }
}
