/**
 * Lyra Chatbot - Styles
 * Bouton réduit (36px) à côté du panier
 * Popup blanc avec texte noir
 */

/* Bouton chat - dans le header sous le panier */
.tenshu-chat-btn {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: #0AA9F0 !important;
  color: #000000 !important;
  border: 2px solid #0AA9F0 !important;
  font-size: 20px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(10, 169, 240, 0.3) !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100 !important;
}

.tenshu-chat-btn:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 4px 12px rgba(10, 169, 240, 0.4) !important;
  background: #0891d1 !important;
}

/* Popup du chat - Popup fixe avec fond blanc OPAQUE */
.tenshu-chat-popup {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  width: 400px !important;
  max-width: calc(100vw - 40px) !important;
  height: 500px !important;
  max-height: calc(100vh - 200px) !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 2px solid #0AA9F0 !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
  z-index: 10000 !important;
  display: none !important;
  flex-direction: column !important;
  overflow: hidden !important;
  opacity: 1 !important;
}

.tenshu-chat-popup.open {
  display: flex !important;
}

/* Container */
.tenshu-chat-container {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Forcer le fond blanc sur tous les éléments */
.tenshu-chat-container * {
  background-color: transparent !important;
}

.tenshu-chat-container,
.tenshu-chat-messages {
  background-color: #ffffff !important;
}

/* Header */
.tenshu-chat-header {
  background: #0AA9F0 !important;
  background-color: #0AA9F0 !important;
  color: white !important;
  padding: 16px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  min-height: 60px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.tenshu-info {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.tenshu-avatar {
  font-size: 32px !important;
  background: transparent !important;
}

.tenshu-info div {
  display: flex !important;
  flex-direction: column !important;
  background: transparent !important;
}

.tenshu-info strong {
  color: white !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  background: transparent !important;
}

.tenshu-info small {
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 12px !important;
  background: transparent !important;
}

.tenshu-close-btn {
  background: transparent !important;
  border: none !important;
  color: #000000 !important;
  font-size: 32px !important;
  cursor: pointer !important;
  padding: 0 !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

.tenshu-close-btn:hover {
  opacity: 0.8 !important;
}

/* Messages */
.tenshu-chat-messages {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 16px !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.tenshu-message {
  display: flex !important;
  flex-direction: column !important;
  background: transparent !important;
}

.tenshu-message.tenshu-user {
  align-items: flex-end !important;
}

.tenshu-message.tenshu-bot {
  align-items: flex-start !important;
}

.tenshu-bubble {
  max-width: 75% !important;
  padding: 12px 16px !important;
  border-radius: 16px !important;
  word-wrap: break-word !important;
  line-height: 1.5 !important;
  color: #000000 !important;
}

.tenshu-user .tenshu-bubble {
  background: #0AA9F0 !important;
  background-color: #0AA9F0 !important;
  color: #000000 !important;
  border-bottom-right-radius: 4px !important;
}

.tenshu-bot .tenshu-bubble {
  background: #f3f4f6 !important;
  background-color: #f3f4f6 !important;
  color: #000000 !important;
  border-bottom-left-radius: 4px !important;
}

/* Typing indicator */
.tenshu-typing {
  padding: 12px 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #000000 !important;
  font-size: 14px !important;
  font-style: italic !important;
  border-bottom: 1px solid #e5e7eb !important;
}

.tenshu-typing span {
  animation: tenshu-blink 1.4s infinite ease-in-out both !important;
}

.tenshu-typing span:nth-child(2) {
  animation-delay: 0.2s !important;
}

.tenshu-typing span:nth-child(3) {
  animation-delay: 0.4s !important;
}

.tenshu-typing span:nth-child(4) {
  animation-delay: 0.6s !important;
}

@keyframes tenshu-blink {
  0%, 100% {
    opacity: 0.3 !important;
  }
  50% {
    opacity: 1 !important;
  }
}

/* Input */
.tenshu-chat-input {
  padding: 16px 20px !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-top: 1px solid #e5e7eb !important;
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
}

.tenshu-chat-input input {
  flex: 1 !important;
  padding: 14px 20px !important;
  border: 2px solid #d1d5db !important;
  border-radius: 8px !important;
  outline: none !important;
  font-size: 15px !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #000000 !important;
  font-weight: 400 !important;
}

.tenshu-chat-input input::placeholder {
  color: #6b7280 !important;
}

.tenshu-chat-input input:focus {
  border-color: #0AA9F0 !important;
  background: white !important;
}

.tenshu-send-btn {
  padding: 14px 32px !important;
  background: #0AA9F0 !important;
  color: #000000 !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  transition: background 0.2s ease !important;
  white-space: nowrap !important;
}

.tenshu-send-btn:hover {
  background: #0891d1 !important;
}

/* Scrollbar */
.tenshu-chat-messages::-webkit-scrollbar {
  width: 6px !important;
}

.tenshu-chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1 !important;
}

.tenshu-chat-messages::-webkit-scrollbar-thumb {
  background: #888 !important;
  border-radius: 3px !important;
}

.tenshu-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #555 !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .tenshu-chat-popup {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
  }
}

/* Bulle d'avertissement - Texte ROUGE pour visibilité maximale */
.tenshu-warning-rule {
  color: #DC2626 !important;
  background: #FEF3C7 !important;
  background-color: #FEF3C7 !important;
  border: 2px solid #DC2626 !important;
  font-weight: 600 !important;
  font-size: 12px !important;
}
