/* ============================================================
   Ask David — shared chat UI (used by the About window AND the
   home hero widget). Page-specific shells (the macOS window on
   About; the hero card/panel on home) live with their pages.
   ============================================================ */

.assistant-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 22px 18px 12px;
  display: flex; flex-direction: column; gap: 14px;
  background: rgba(28, 28, 30, 0.2);
  scroll-behavior: smooth;
}
.assistant-body::-webkit-scrollbar { width: 5px; }
.assistant-body::-webkit-scrollbar-track { background: transparent; }
.assistant-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; }
.assistant-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

.chat-row { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; animation: chat-fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes chat-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.chat-row.user { flex-direction: row-reverse; }

.chat-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-avatar.ai {
  background: radial-gradient(circle at 50% 22%, #5ab0ff 0%, #0a84ff 52%, #0a5bd0 100%);
  box-shadow: 0 2px 7px rgba(10, 132, 255, 0.4), inset 0 1px 1px rgba(255,255,255,0.35);
}
.chat-avatar.ai svg { width: 14px; height: 14px; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,0.22)); }
.chat-avatar.me { background: rgba(255, 255, 255, 0.1); border: 0.5px solid rgba(255, 255, 255, 0.05); }
.chat-avatar.me svg { width: 13px; height: 13px; fill: rgba(255, 255, 255, 0.65); }

.chat-bubble {
  font-size: 13.5px; line-height: 1.5; color: rgba(255, 255, 255, 0.94);
  padding: 10px 14px; border-radius: 18px; max-width: 82%;
  user-select: text; word-wrap: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  letter-spacing: -0.01em;
}
.chat-row.ai .chat-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.chat-row.user .chat-bubble {
  background: #0a84ff;
  color: #fff;
  border-top-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.15);
}
.chat-bubble a { color: #40a0ff; text-decoration: underline; text-underline-offset: 2px; pointer-events: auto; font-weight: 500; }
.chat-row.user .chat-bubble a { color: #fff; }
.chat-bubble strong { color: #fff; font-weight: 600; }

.chat-bubble-media {
  max-width: 240px;
  border-radius: 16px;
  overflow: hidden;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  background: rgba(0, 0, 0, 0.15);
  margin-bottom: 2px;
}
.chat-image {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.chat-image:hover {
  transform: scale(1.02);
}
.chat-bubble-media.linked a { display: block; text-decoration: none; }
.media-cap { padding: 7px 11px; font-size: 11px; font-weight: 600; color: #40a0ff; background: rgba(255,255,255,0.04); border-top: 0.5px solid rgba(255,255,255,0.08); }
.chat-bubble-media.linked:hover .media-cap { color: #6cb6ff; background: rgba(64,160,255,0.1); }

.chat-typing { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 2px 1px; }
.chat-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  animation: chat-dot-bounce 1.3s infinite ease-in-out;
}
.chat-dot:nth-child(2) { animation-delay: 0.18s; }
.chat-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes chat-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.assistant-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 8px 36px;
  margin-bottom: 12px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.suggest-chip {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 12.2px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  transform: translateY(4px);
  opacity: 0;
  animation: chipFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.suggest-chip .chip-icon {
  font-size: 13.5px;
  flex-shrink: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.suggest-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.suggest-chip:active {
  transform: translateY(0) scale(0.97);
  background: rgba(255, 255, 255, 0.06);
}
.assistant-suggest.fade-out {
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
@keyframes chipFadeIn {
  to { transform: translateY(0); opacity: 1; }
}

.assistant-footer {
  flex-shrink: 0;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
  background: rgba(38, 38, 41, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px 16px 12px;
}
.assistant-input-row { display: flex; align-items: center; gap: 8px; }
.assistant-input {
  flex: 1; min-width: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif; font-size: 13.5px; color: #fff;
  user-select: text;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px; padding: 9px 15px; outline: none;
  transition: all 0.2s ease;
}
.assistant-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.assistant-input:focus { border-color: #0a84ff; background: rgba(255, 255, 255, 0.08); box-shadow: 0 0 0 1px #0a84ff; }

.assistant-send {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #0a84ff;
  transition: all 0.15s ease;
}
.assistant-send:hover {
  background: #2ea0ff;
}
.assistant-send:active { transform: scale(0.95); }
.assistant-send:disabled { opacity: 0.3; cursor: default; transform: none; background: rgba(255, 255, 255, 0.08); }
.assistant-send svg { width: 14px; height: 14px; fill: #fff; }

.assistant-disclaimer {
  font-size: 9px; color: rgba(255, 255, 255, 0.25);
  text-align: center; margin-top: 8px;
  letter-spacing: 0.01em;
}

/* In-chat globe — reuses the Flight app's globe.gl + travel data */
.globe-bubble { width: 272px; max-width: 82%; padding: 0; background: #05060a; }
.chat-globe { width: 100%; height: 188px; position: relative; }
.chat-globe canvas { display: block; }
.globe-fallback { display: flex; align-items: center; justify-content: center; height: 188px; font-size: 46px; }
.globe-cap { padding: 8px 12px; font-size: 11px; color: rgba(255,255,255,0.62); border-top: 0.5px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 6px; }
