/* ═══════════════════════════════════════════
   BrainBuddy AI — Floating QR Code
   qr.css
═══════════════════════════════════════════ */

#bb-qr-root {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 999;
  pointer-events: none;
  font-family: "DM Sans", sans-serif;
}

#bb-qr-bubble,
#bb-qr-panel {
  pointer-events: all;
}

/* ── Bubble ── */
#bb-qr-bubble {
  width: 72px;
  height: 88px;
  border-radius: 16px;
  background: #fff;
  border: 1.5px solid #e8e6f9;
  box-shadow: 0 8px 28px rgba(0,0,0,.15);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  transition: transform .2s, box-shadow .2s;
  position: relative;
  margin-top: 12px;
}

#bb-qr-bubble:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,.2);
}

#bb-qr-bubble-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

#bb-qr-dots {
  display: flex;
  gap: 4px;
  margin-bottom: 2px;
}

#bb-qr-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5b4fcf;
  animation: bb-qr-blink 1.4s infinite;
}

#bb-qr-dots span:nth-child(2) {
  animation-delay: .3s;
}

@keyframes bb-qr-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

#bb-qr-bubble-inner img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 4px;
}

#bb-qr-bubble-inner small {
  font-size: 8px;
  font-weight: 700;
  color: #5b4fcf;
  text-align: center;
  line-height: 1.2;
  letter-spacing: .02em;
}

#bb-qr-bubble-icon {
  display: none;
}

#bb-qr-bubble-label {
  display: none;
}

#bb-qr-bubble-close {
  color: #686a75;
  font-size: 14px;
  line-height: 1;
}

#bb-qr-thought {
  position: absolute;
  bottom: 100px;
  left: 0;
  background: #fff;
  border: 1.5px solid #e8e6f9;
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  width: 160px;
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
}

#bb-qr-thought p {
  font-size: 11.5px;
  font-weight: 600;
  color: #20212a;
  line-height: 1.5;
  margin: 0;
}

#bb-qr-thought::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  width: 8px;
  height: 8px;
  background: #fff;
  border-right: 1.5px solid #e8e6f9;
  border-bottom: 1.5px solid #e8e6f9;
  transform: rotate(45deg);
}
/* Tooltip */
#bb-qr-tooltip {
  position: absolute;
  left: 68px;
  top: 50%;
  transform: translateY(-50%);
  background: #20212a;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  display: none;
}

#bb-qr-tooltip::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 5px solid #20212a;
}

/* ── QR Panel ── */
#bb-qr-panel {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .15);
  border: 1px solid #e8e6f9;
  width: 240px;
  overflow: hidden;
  margin-bottom: 12px;

  /* Hidden by default */
  opacity: 0;
  transform: translateY(12px) scale(.97);
  pointer-events: none;
  visibility: hidden;
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}

#bb-qr-panel.bb-qr-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
  visibility: visible;
}

/* Header */
#bb-qr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #20212a;
}

#bb-qr-header strong {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: "Manrope", sans-serif;
}

#bb-qr-header span {
  display: block;
  color: rgba(255, 255, 255, .6);
  font-size: 11px;
  margin-top: 2px;
}

#bb-qr-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .7);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  line-height: 1;
}

#bb-qr-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, .15);
}

/* QR Image */
#bb-qr-image-wrap {
  padding: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

#bb-qr-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Footer */
#bb-qr-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f7f6fe;
  border-top: 1px solid #e8e6f9;
}

#bb-qr-footer span {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #20212a;
  color: #fff;
  font-size: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

#bb-qr-footer small {
  color: #686a75;
  font-size: 11.5px;
  font-weight: 600;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  #bb-qr-root {
    bottom: 16px;
    left: 16px;
  }

  #bb-qr-panel {
    width: 200px;
  }
}