:root {
  --gb-ai-glass-bg: rgba(20, 22, 26, 0.72);
  --gb-ai-glass-border: rgba(255,255,255,0.08);
}

/* =========================================================
   GLOBAL LEARN AI DOCK (bottom-right)
========================================================= */

.learn-ai {
  position: fixed;
  right: 24px;
  bottom: 24px;

  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;

  z-index: 9999;
  pointer-events: none;
}

.learn-ai > * {
  pointer-events: auto;
}

/* =========================================================
   BUBBLE CONTAINER (matches sanity-ai-bubbles)
========================================================= */

.learn-ai-notes {
  display: none;
  flex-direction: column-reverse; /* newest closest to trigger */
  gap: 12px;
  margin-bottom: 6px;

  position: relative;
  z-index: 10000;

  opacity: 0;
  pointer-events: none;
}

.learn-ai-notes.is-open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  animation: bubble-pop 0.25s ease-out;
}

/* =========================================================
   LEARN AI CARD (same geometry as sanity-ai-card)
========================================================= */

.learn-ai-card {
  background: var(--gb-ai-glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border-radius: 16px;
  padding: 14px 16px;

  color: var(--gb-text-primary);

  box-shadow:
    0 12px 28px rgba(0,0,0,0.45),
    inset 0 0 0 1px var(--gb-ai-glass-border);

  font-size: 14px;

  width: 320px;
  max-height: 70vh;     /* 👈 height constraint lives HERE */

  display: flex;
  flex-direction: column;

  overflow: hidden;    /* 👈 IMPORTANT */
}


/* Scrollbars */

.learn-ai-card::-webkit-scrollbar {
  width: 8px;
}

.learn-ai-card::-webkit-scrollbar-track {
  background: transparent;
  margin: 12px 0;
}

.learn-ai-card::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.15);
  border-radius: 8px;
}

.learn-ai-card::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255,255,255,0.25);
}

/* =========================================================
   CARD CONTENT
========================================================= */

.learn-ai-header {
  font-weight: 600;
  margin-bottom: 6px;
}

.learn-ai-context,
.learn-ai-actions,
.learn-ai-references {
  margin-top: 10px;
  font-size: 13px;
  color: #d1d5db; /* same contrast as sanity */
}

.learn-ai-actions ul,
.learn-ai-references ul {
  margin: 6px 0 0 16px;
  padding: 0;
}

.learn-ai-references a {
  color: var(--gb-accent-sky);
  text-decoration: none;
}

.learn-ai-references a:hover {
  text-decoration: underline;
}

.learn-bubble {
  line-height: 1.6;
}

.learn-bubble h4 {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

.learn-bubble ol {
  padding-left: 1.2rem;
  font-size: 0.85rem;
}

.learn-bubble a {
  color: var(--gb-accent-sky);
  text-decoration: none;
}

.learn-bubble a:hover {
  text-decoration: underline;
}

/* =========================================================
   LEARN AI TRIGGER (🦉)
========================================================= */

.learn-ai-trigger {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;

  background: var(--gb-ai-glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  box-shadow:
    0 4px 12px rgba(0,0,0,0.35),
    inset 0 0 0 1px var(--gb-ai-glass-border);

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.learn-ai-trigger:hover {
  transform: scale(1.05);
  box-shadow:
    0 6px 16px rgba(0,0,0,0.45),
    inset 0 0 0 1px rgba(255,255,255,0.12);
}

.learn-ai-trigger.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =========================================================
   ANIMATION (same as sanity)
========================================================= */

@keyframes bubble-pop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
/* ---------------------------------------------------------
   Learn AI Bubble — Scroll Fix
--------------------------------------------------------- */

.learn-bubble {
  max-height: 70vh;          /* keeps bubble within viewport */
  display: flex;
  flex-direction: column;
}

.learn-bubble-scroll {
  overflow-y: auto;
  padding-right: 8px;
  flex: 1;              /* 👈 ADD THIS (important) */
}


/* Optional: nicer scrollbar (safe) */
.learn-bubble-scroll::-webkit-scrollbar {
  width: 6px;
}

.learn-bubble-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 4px;
}
