/* ============================================
   91F Bot — Floating chat widget
   Self-contained, does not affect site layout.
   ============================================ */

.j91f-bot-root {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 9999;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  box-sizing: border-box;
  pointer-events: none;
}

.j91f-bot-root *,
.j91f-bot-root *::before,
.j91f-bot-root *::after {
  box-sizing: border-box;
}

.j91f-bot-root.j91f-bot-visible {
  pointer-events: auto;
}

/* ---- Floating button ---- */
.j91f-bot-trigger {
  pointer-events: auto;
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #00d4ff 0%, #0099bb 100%);
  color: #0a0a0f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.5), 0 0 48px rgba(0, 212, 255, 0.2);
  animation: j91f-bot-pulse 2.5s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.j91f-bot-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 0 32px rgba(0, 212, 255, 0.6), 0 0 64px rgba(0, 212, 255, 0.25);
}

.j91f-bot-trigger:focus {
  outline: 2px solid rgba(0, 212, 255, 0.8);
  outline-offset: 2px;
}

.j91f-bot-trigger svg {
  width: 28px;
  height: 28px;
}

@keyframes j91f-bot-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(0, 212, 255, 0.5), 0 0 48px rgba(0, 212, 255, 0.2); }
  50% { box-shadow: 0 0 32px rgba(0, 212, 255, 0.65), 0 0 56px rgba(0, 212, 255, 0.3); }
}

.j91f-bot-panel-open .j91f-bot-trigger {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

/* ---- Chat panel ---- */
.j91f-bot-panel {
  pointer-events: none;
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 48px);
  background: #0d0d14;
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 212, 255, 0.1);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.9) translateY(10px);
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.j91f-bot-root.j91f-bot-panel-open .j91f-bot-panel {
  pointer-events: auto;
  opacity: 1;
  transform: scale(1) translateY(0);
  visibility: visible;
}

.j91f-bot-panel-header {
  padding: 14px 16px;
  background: rgba(0, 212, 255, 0.08);
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.j91f-bot-panel-title {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: #e8e8ec;
}

.j91f-bot-panel-title span {
  color: #00d4ff;
}

.j91f-bot-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.j91f-bot-mute {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.j91f-bot-mute:hover {
  background: rgba(0, 212, 255, 0.1);
}

.j91f-bot-panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #8a8a92;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.j91f-bot-panel-close:hover {
  color: #00d4ff;
  background: rgba(0, 212, 255, 0.1);
}

.j91f-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.j91f-bot-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 10px;
  line-height: 1.45;
  word-wrap: break-word;
}

.j91f-bot-msg-user {
  align-self: flex-end;
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #e8e8ec;
}

.j91f-bot-msg-bot {
  align-self: flex-start;
  background: #161618;
  border: 1px solid #252528;
  color: #e8e8ec;
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.05);
}

.j91f-bot-typing {
  align-self: flex-start;
  padding: 12px 16px;
  background: #161618;
  border: 1px solid #252528;
  border-radius: 10px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.j91f-bot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00d4ff;
  animation: j91f-bot-typing-dot 0.8s ease-in-out infinite;
}

.j91f-bot-typing span:nth-child(2) { animation-delay: 0.15s; }
.j91f-bot-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes j91f-bot-typing-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}

.j91f-bot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 8px;
  flex-shrink: 0;
}

.j91f-bot-chip {
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  color: #00d4ff;
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.j91f-bot-chip:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: #00d4ff;
}

.j91f-bot-input-wrap {
  padding: 12px 16px 16px;
  border-top: 1px solid #252528;
  flex-shrink: 0;
}

.j91f-bot-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.j91f-bot-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: #e8e8ec;
  background: #161618;
  border: 1px solid #252528;
  border-radius: 8px;
  resize: none;
  max-height: 100px;
  transition: border-color 0.2s;
}

.j91f-bot-input::placeholder {
  color: #5c5c64;
}

.j91f-bot-input:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

.j91f-bot-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: #00d4ff;
  color: #0a0a0f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
}

.j91f-bot-send:hover {
  background: #00b8e6;
  transform: scale(1.05);
}

.j91f-bot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.j91f-bot-send svg {
  width: 18px;
  height: 18px;
}
