/* Bouton chat flottant */
.chat-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #FFE066 0%, #FFA500 100%);
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(255, 165, 0, 0.3);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.chat-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255, 165, 0, 0.4);
}

.chat-button.active {
  background: #FFA500;
}

/* Fenêtre de chat */
.chat-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 350px;
  height: 450px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 999;
  display: none;
  flex-direction: column;
  border: 2px solid #FFE066;
  overflow: hidden;
}

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

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

/* Header du chat */
.chat-header {
  background: linear-gradient(135deg, #FFE066 0%, #FFD2A5 100%);
  padding: 15px 20px;
  color: #222;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #222;
  padding: 0;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Messages du chat */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8fafc;
}

.chat-message {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.chat-message.bot {
  align-items: flex-start;
}

.chat-message.user {
  align-items: flex-end;
}

.message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
}

.chat-message.bot .message-bubble {
  background: #FFE066;
  color: #222;
}

.chat-message.user .message-bubble {
  background: #FFA500;
  color: white;
}

.message-time {
  font-size: 11px;
  color: #666;
  margin-top: 5px;
  opacity: 0.7;
}

/* Input du chat */
.chat-input-container {
  padding: 15px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 10px 15px;
  border: 2px solid #FFE066;
  border-radius: 20px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  border-color: #FFA500;
}

.chat-send {
  background: #FFA500;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-send:hover {
  background: #FF8C00;
  transform: scale(1.05);
}


@media (max-width: 768px) {
  .chat-window {
    width: calc(100vw - 60px);
    left: 30px;
    right: 30px;
  }
  
  .chat-button {
    bottom: 20px;
    left: 20px;
  }
}

@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 40px);
    left: 20px;
    right: 20px;
    height: 400px;
  }
}

/* ...existing CSS... */

/* Styles pour le contenu Markdown dans les messages */
.message-bubble strong {
  font-weight: 600;
  color: inherit;
}

.message-bubble em {
  font-style: italic;
  color: inherit;
}

.message-bubble code {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.message-bubble ol, .message-bubble ul {
  margin: 8px 0;
  padding-left: 20px;
}

.message-bubble li {
  margin: 4px 0;
  line-height: 1.4;
}

.message-bubble h1, .message-bubble h2, .message-bubble h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 8px 0 4px 0;
  color: inherit;
}

.message-bubble blockquote {
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  padding-left: 12px;
  margin: 8px 0;
  font-style: italic;
}

/* Pour les messages du bot */
.chat-message.bot .message-bubble code {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}

.chat-message.bot .message-bubble blockquote {
  border-left-color: #FFE066;
}

/* Pour les messages utilisateur */
.chat-message.user .message-bubble code {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.chat-message.user .message-bubble blockquote {
  border-left-color: rgba(255, 255, 255, 0.5);
}

/* Animation de frappe */
.typing-animation {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-animation span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-animation span:nth-child(1) {
  animation-delay: 0ms;
}

.typing-animation span:nth-child(2) {
  animation-delay: 200ms;
}

.typing-animation span:nth-child(3) {
  animation-delay: 400ms;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.typing-indicator .message-bubble {
  padding: 16px 20px;
}