/* ========================================
   CHATBOT WIDGET - Tabac des Halles
   ======================================== */

/* Widget flottant */
.chat-widget {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 1000;
}

.chat-widget-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  animation: chatPulse 2s infinite;
}

.chat-widget-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.6);
}

@keyframes chatPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(99, 102, 241, 0.7); }
}

/* Fenêtre de chat */
.chat-window {
  position: fixed;
  bottom: 170px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 550px;
  max-height: calc(100vh - 200px);
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  animation: chatSlideUp 0.3s ease;
}

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

.chat-window.active {
  display: flex;
}

/* Header du chat */
.chat-header {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.chat-header-text h3 {
  font-size: 1rem;
  margin: 0;
  font-weight: 600;
}

.chat-header-text p {
  font-size: 0.75rem;
  margin: 0;
  opacity: 0.9;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: opacity 0.2s;
}

.chat-close:hover {
  opacity: 0.8;
}

/* Corps du chat */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
}

/* Messages */
.chat-message {
  margin-bottom: 1rem;
  max-width: 85%;
  animation: messageSlide 0.3s ease;
}

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

.chat-message.bot {
  margin-right: auto;
}

.chat-message.user {
  margin-left: auto;
}

.chat-message-content {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-message.bot .chat-message-content {
  background: white;
  color: #1e293b;
  border-bottom-left-radius: 0.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-message.user .chat-message-content {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.chat-message-time {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  text-align: right;
}

/* Suggestions de réponses */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.chat-suggestion {
  background: #e0e7ff;
  color: #6366f1;
  border: none;
  padding: 0.5rem 0.875rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.chat-suggestion:hover {
  background: #6366f1;
  color: white;
}

/* Indicateur de frappe */
.chat-typing {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 1rem;
  border-bottom-left-radius: 0.25rem;
  width: fit-content;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-typing.active {
  display: flex;
}

.chat-typing-dot {
  width: 8px;
  height: 8px;
  background: #cbd5e1;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

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

/* Pied du chat */
.chat-footer {
  padding: 1rem;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 2rem;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

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

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.chat-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Formulaire de contact dans le chat */
.chat-contact-form {
  background: white;
  padding: 1rem;
  border-radius: 1rem;
  margin-top: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-contact-form h4 {
  margin: 0 0 1rem 0;
  color: #1e293b;
  font-size: 0.95rem;
}

.chat-form-group {
  margin-bottom: 0.75rem;
}

.chat-form-group label {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.chat-form-group input,
.chat-form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
}

.chat-form-group input:focus,
.chat-form-group textarea:focus {
  outline: none;
  border-color: #6366f1;
}

.chat-form-submit {
  width: 100%;
  padding: 0.625rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.chat-form-submit:hover {
  opacity: 0.9;
}

/* Liens dans les messages */
.chat-message-content a {
  color: #6366f1;
  text-decoration: underline;
}

.chat-message.user .chat-message-content a {
  color: #e0e7ff;
}

/* Responsive */
@media (max-width: 480px) {
  .chat-window {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  
  .chat-widget {
    bottom: 80px;
    right: 15px;
  }
  
  .chat-widget-button {
    width: 55px;
    height: 55px;
    font-size: 1.25rem;
  }
}

/* Badge notification */
.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
