/* ============================================================
   OhmBot — Widget d'assistance
   ============================================================ */

#ohmbot-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(16, 185, 129, .4), 0 4px 8px rgba(0, 0, 0, .08);
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
#ohmbot-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 36px rgba(16, 185, 129, .5), 0 4px 12px rgba(0, 0, 0, .1);
}
#ohmbot-fab svg { stroke: #fff; }

/* Point de notification */
#ohmbot-fab .ohmbot-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 10px; height: 10px;
  background: #FBBF24;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: ohmbot-pulse 2s ease-in-out infinite;
}
@keyframes ohmbot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: .7; }
}

/* Widget fermé par défaut */
#ohmbot-widget {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .08);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: 'Inter', -apple-system, sans-serif;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .2s, transform .2s;
}
#ohmbot-widget.open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Header */
.ohmbot-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0A0F1A 0%, #1F2937 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.ohmbot-head::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(16, 185, 129, .3), transparent 70%);
  filter: blur(30px);
}
.ohmbot-av {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #10B981;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
}
.ohmbot-title { font-size: 15px; font-weight: 700; position: relative; }
.ohmbot-sub { font-size: 11px; color: rgba(16, 185, 129, 1); position: relative; }
.ohmbot-close {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background .15s;
}
.ohmbot-close:hover { background: rgba(255, 255, 255, .22); }

/* Body (messages) */
.ohmbot-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #F7F8FA;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

/* Bulles */
.ohmbot-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  word-wrap: break-word;
  animation: ohmbot-in .25s ease-out;
}
@keyframes ohmbot-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ohmbot-bubble.bot {
  align-self: flex-start;
  background: #fff;
  color: #0A0F1A;
  border-bottom-left-radius: 4px;
  border: 1px solid #E5E7EB;
}
.ohmbot-bubble.user {
  align-self: flex-end;
  background: #10B981;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Chips de suggestions */
.ohmbot-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.ohmbot-chip {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #D1FAE5;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.ohmbot-chip:hover {
  background: #10B981;
  color: #fff;
  border-color: #10B981;
}

/* Indicateur de frappe */
.ohmbot-typing {
  display: flex;
  gap: 3px;
  align-items: center;
  padding: 12px 14px;
}
.ohmbot-typing span {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9AA3B2;
  animation: ohmbot-bounce 1.2s infinite ease-in-out;
}
.ohmbot-typing span:nth-child(2) { animation-delay: .15s; }
.ohmbot-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ohmbot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40%           { transform: translateY(-5px); opacity: 1; }
}

/* Formulaire */
.ohmbot-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #E5E7EB;
}
.ohmbot-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  background: #F7F8FA;
  transition: all .15s;
}
.ohmbot-form input:focus {
  border-color: #10B981;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
}
.ohmbot-form button {
  width: 40px; height: 40px;
  border: none;
  background: #10B981;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.ohmbot-form button:hover { background: #059669; }

/* Responsive mobile */
@media (max-width: 520px) {
  #ohmbot-fab {
    bottom: 80px;         /* évite la bottom-tab de la PWA */
    right: 16px;
    width: 52px; height: 52px;
  }
  #ohmbot-widget {
    right: 0; bottom: 0;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}
