/* iFlex-Assistant 2026 – Widget CSS */

/* Bulle flottante blanche premium */
.iflex-chatbot-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #22c55e);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999999;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.iflex-chatbot-bubble:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.75);
}

.iflex-chatbot-bubble img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* Fenêtre de chat sombre premium */
.iflex-chatbot-window {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 360px;
  max-width: 92vw;
  max-height: 70vh;
  display: none;
  flex-direction: column;
  background: radial-gradient(circle at top left, #1e293b 0%, #020617 55%, #020617 100%);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.6);
  overflow: hidden;
  z-index: 999999;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.iflex-chatbot-window.iflex-open {
  animation: iflex-chatbot-enter 0.22s ease-out forwards;
}

@keyframes iflex-chatbot-enter {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* En-tête */
.iflex-chatbot-header {
  padding: 12px 14px;
  background: linear-gradient(120deg, #020617, #020617 45%, #0b1120 100%);
  border-bottom: 1px solid rgba(148,163,184,0.35);
  display: flex;
  align-items: center;
  gap: 10px;
}

.iflex-chatbot-header-logo {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.iflex-chatbot-header-logo img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.iflex-chatbot-header-text {
  flex: 1;
}

.iflex-chatbot-header-title {
  font-size: 14px;
  font-weight: 600;
  color: #f9fafb;
}

.iflex-chatbot-header-subtitle {
  font-size: 12px;
  color: #9ca3af;
}

.iflex-chatbot-header-close {
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 999px;
  line-height: 0;
}

.iflex-chatbot-header-close:hover {
  background: rgba(148,163,184,0.18);
  color: #e5e7eb;
}

/* Corps / messages */
.iflex-chatbot-messages {
  padding: 12px 12px 10px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #4b5563 transparent;
}

.iflex-chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.iflex-chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.iflex-chatbot-messages::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 999px;
}

.iflex-chatbot-message-row {
  display: flex;
  margin-bottom: 8px;
}

.iflex-chatbot-message-row.iflex-user {
  justify-content: flex-end;
}

.iflex-chatbot-bubble-msg {
  max-width: 86%;
  padding: 8px 11px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.4;
}

.iflex-chatbot-message-row.iflex-bot .iflex-chatbot-bubble-msg {
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.45);
  color: #e5e7eb;
  border-bottom-left-radius: 3px;
}

.iflex-chatbot-message-row.iflex-user .iflex-chatbot-bubble-msg {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f9fafb;
  border-bottom-right-radius: 3px;
}

/* Boutons rapides */
.iflex-chatbot-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}

.iflex-chatbot-quick button {
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.5);
  background: rgba(15,23,42,0.7);
  color: #e5e7eb;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
  white-space: nowrap;
}

.iflex-chatbot-quick button:hover {
  background: rgba(37,99,235,0.3);
  border-color: #3b82f6;
  transform: translateY(-1px);
}

/* Champ de saisie */
.iflex-chatbot-input {
  border-top: 1px solid rgba(15,23,42,0.85);
  background: radial-gradient(circle at top left, #020617 0%, #020617 100%);
  padding: 8px 10px;
}

.iflex-chatbot-input-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15,23,42,0.9);
  border-radius: 999px;
  border: 1px solid rgba(51,65,85,0.9);
  padding: 4px 6px 4px 10px;
}

.iflex-chatbot-input-inner input {
  flex: 1;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 13px;
  outline: none;
}

.iflex-chatbot-input-inner input::placeholder {
  color: #64748b;
}

.iflex-chatbot-send-btn {
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f9fafb;
  font-size: 12px;
  padding: 6px 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  box-shadow: 0 0 0 rgba(37,99,235,0.0);
}

.iflex-chatbot-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37,99,235,0.45);
}

.iflex-chatbot-send-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.iflex-chatbot-status {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  padding-left: 4px;
}

/* Responsive */
@media (max-width: 640px) {
  .iflex-chatbot-window {
    right: 10px;
    bottom: 82px;
    width: 94vw;
    max-height: 70vh;
  }

  .iflex-chatbot-bubble {
    right: 14px;
    bottom: 16px;
  }
}
