/* ============================================
   IRIS — Chatbot IILMIQ Labs
   Style néon bleu / dark futuriste matching le site
   ============================================ */

#iris-widget *,
#iris-widget *::before,
#iris-widget *::after {
  box-sizing: border-box;
}

#iris-widget {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  position: fixed;
  z-index: 9999;
  bottom: 24px;
  right: 24px;
}

/* ── Bulle flottante ── */
.iris-bubble {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(96, 165, 250, 0.6);
  background: linear-gradient(135deg, #0a1424 0%, #1a2b4a 100%);
  color: #60a5fa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 12px rgba(96, 165, 250, 0.4),
    0 0 32px rgba(96, 165, 250, 0.15),
    inset 0 0 12px rgba(96, 165, 250, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: iris-float 4s ease-in-out infinite;
}
.iris-bubble:hover {
  transform: scale(1.08);
  box-shadow:
    0 0 18px rgba(96, 165, 250, 0.55),
    0 0 44px rgba(96, 165, 250, 0.25),
    inset 0 0 16px rgba(96, 165, 250, 0.12);
}
.iris-bubble svg {
  width: 26px;
  height: 26px;
}

/* Pulse animation derrière la bulle */
.iris-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(96, 165, 250, 0.7);
  animation: iris-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes iris-pulse {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes iris-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* ── Panel ── */
.iris-panel[hidden] {
  display: none !important;
}
.iris-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 48px);
  background: rgba(10, 20, 36, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 32px rgba(0, 0, 0, 0.6),
    0 0 64px rgba(96, 165, 250, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.iris-panel.iris-panel-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ── Header ── */
.iris-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.12);
  background: rgba(2, 8, 23, 0.5);
}
.iris-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.iris-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(99, 102, 241, 0.18));
  border: 1px solid rgba(96, 165, 250, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
}
.iris-avatar svg { width: 18px; height: 18px; }
.iris-name {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #f0f6ff;
  letter-spacing: -0.01em;
}
.iris-status {
  font-size: 11px;
  color: rgba(200, 220, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.iris-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}
.iris-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}
.iris-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* ── Messages ── */
.iris-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, 0.25) transparent;
}
.iris-messages::-webkit-scrollbar { width: 6px; }
.iris-messages::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.25);
  border-radius: 3px;
}

.iris-msg {
  display: flex;
  max-width: 88%;
  animation: iris-msg-in 0.25s ease;
}
@keyframes iris-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.iris-msg-bot  { align-self: flex-start; }
.iris-msg-user { align-self: flex-end; }

.iris-bubble-text {
  padding: 11px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.iris-msg-bot .iris-bubble-text {
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.15);
  color: rgba(240, 246, 255, 0.92);
  border-bottom-left-radius: 4px;
}
.iris-msg-user .iris-bubble-text {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.iris-msg-error .iris-bubble-text {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}
.iris-bubble-text a {
  color: #93c5fd;
  text-decoration: underline;
}
.iris-msg-user .iris-bubble-text a {
  color: #fff;
}

/* ── Typing indicator ── */
.iris-typing .iris-bubble-text {
  display: flex;
  gap: 4px;
  padding: 14px 16px;
}
.iris-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #60a5fa;
  animation: iris-typing 1.2s infinite ease-in-out;
}
.iris-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.iris-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes iris-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-3px); }
}

/* ── Suggestions (chips) ── */
.iris-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.iris-chip {
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: #93c5fd;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s, border 0.2s, color 0.2s;
}
.iris-chip:hover {
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.5);
  color: #fff;
}

/* ── Form ── */
.iris-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid rgba(96, 165, 250, 0.12);
  background: rgba(2, 8, 23, 0.4);
}
#iris-input {
  flex: 1;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 100px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border 0.2s, background 0.2s;
}
#iris-input::placeholder { color: rgba(200, 220, 255, 0.35); }
#iris-input:focus {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(255, 255, 255, 0.06);
}
.iris-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #60a5fa, #6366f1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(96, 165, 250, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.iris-send:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(96, 165, 250, 0.5);
}
.iris-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.iris-send svg { width: 16px; height: 16px; }

.iris-footer {
  padding: 8px 16px;
  background: rgba(2, 8, 23, 0.5);
  border-top: 1px solid rgba(96, 165, 250, 0.06);
  font-size: 10px;
  color: rgba(200, 220, 255, 0.3);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ── Responsive mobile ── */
@media (max-width: 480px) {
  #iris-widget {
    bottom: 16px;
    right: 16px;
  }
  .iris-panel {
    width: calc(100vw - 32px);
    height: calc(100vh - 96px);
    max-height: 600px;
  }
}
