/* ============================================
   Bot Tile Popup — Rich bot-voiced previews
   ============================================ */

.bot-popup {
  position: absolute;
  z-index: 500;
  width: 320px;
  background: rgba(15, 15, 35, 0.97);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.bot-popup.visible {
  opacity: 1;
  transform: translateY(0);
}

.bot-popup.below {
  transform: translateY(-8px);
}
.bot-popup.below.visible {
  transform: translateY(0);
}

/* Arrow */
.bot-popup::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(15, 15, 35, 0.97);
  border-right: 1px solid rgba(139, 92, 246, 0.3);
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

.bot-popup.below::after {
  bottom: auto;
  top: -6px;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(139, 92, 246, 0.3);
  border-top: 1px solid rgba(139, 92, 246, 0.3);
}

/* Header row */
.bot-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bot-popup-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.12);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bot-popup-avatar img {
  width: 30px;
  height: 30px;
}

.bot-popup-name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

/* Pitch text */
.bot-popup-pitch {
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
  margin-bottom: 12px;
}

/* Topic pills */
.bot-popup-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.bot-popup-topic {
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

/* Action buttons */
.bot-popup-actions {
  display: flex;
  gap: 8px;
}

.bot-popup-explore {
  flex: 1;
  padding: 8px 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-family: inherit;
  transition: opacity 0.15s;
}
.bot-popup-explore:hover { opacity: 0.88; }

.bot-popup-add {
  padding: 8px 14px;
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.bot-popup-add:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.5);
}

/* ---- Mobile: bottom sheet ---- */
@media (max-width: 640px) {
  .bot-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 18px 18px 0 0;
    padding: 20px 18px 28px;
    transform: translateY(100%);
    max-height: 70vh;
    overflow-y: auto;
  }

  .bot-popup.visible {
    transform: translateY(0);
  }

  .bot-popup::after {
    display: none;
  }

  /* Scrim behind bottom sheet */
  .bot-popup-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 499;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
  }
  .bot-popup-scrim.visible {
    opacity: 1;
    pointer-events: auto;
  }
}
