/* =============================================================================
 * Chat Panel (Mingo AI) — open/close motion
 *
 * Duration & easing follow Material 3 motion tokens + Nielsen Norman Group's
 * 200–300 ms panel guidance:
 *   - enter: 250 ms with emphasized-decelerate (settle into place)
 *   - exit:  200 ms with emphasized-accelerate  (snap away)
 * Only transform + opacity are animated so frames stay on the GPU compositor.
 *
 * On <md viewports the panel is a bottom sheet (slides up); on md+ it's a
 * right side panel (slides in from the right edge). One keyframe set per axis.
 *
 * prefers-reduced-motion: cross-fade replaces all slide motion (vestibular-safe
 * per WCAG 2.3.3 / MDN guidance) — the panel still animates, just without
 * positional movement.
 * ============================================================================= */

@keyframes mingo-chat-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes mingo-chat-overlay-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes mingo-chat-slide-in-right {
  from { opacity: 0; transform: translate3d(100%, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes mingo-chat-slide-out-right {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to   { opacity: 0; transform: translate3d(100%, 0, 0); }
}

@keyframes mingo-chat-slide-in-bottom {
  from { opacity: 0; transform: translate3d(0, 100%, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes mingo-chat-slide-out-bottom {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to   { opacity: 0; transform: translate3d(0, 100%, 0); }
}

@keyframes mingo-chat-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes mingo-chat-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.mingo-chat-overlay[data-state="open"]  { animation: mingo-chat-overlay-in  200ms cubic-bezier(0.05, 0.7, 0.1, 1) both; }
.mingo-chat-overlay[data-state="closed"] { animation: mingo-chat-overlay-out 150ms cubic-bezier(0.3, 0, 0.8, 0.15) both; }

/* Mobile: bottom-sheet motion */
.mingo-chat-content[data-state="open"]   { animation: mingo-chat-slide-in-bottom  250ms cubic-bezier(0.05, 0.7, 0.1, 1) both; }
.mingo-chat-content[data-state="closed"] { animation: mingo-chat-slide-out-bottom 200ms cubic-bezier(0.3, 0, 0.8, 0.15) both; }

/* Desktop (>=768px): side-panel motion */
@media (min-width: 768px) {
  .mingo-chat-content[data-state="open"]   { animation-name: mingo-chat-slide-in-right; }
  .mingo-chat-content[data-state="closed"] { animation-name: mingo-chat-slide-out-right; }
}

/* =============================================================================
 * Mingo AI header button — the 2026 AI edge-light pattern (Apple Intelligence
 * glow-edge / Gemini gradient language): a thin accent-gradient arc TRAVELS
 * around the button's border. No blurry blobs. Transform-only rotation on an
 * oversized conic layer (compositor-friendly); an inset cover reveals only
 * the edge. Reduced motion: rotation stops → a static gradient edge (the
 * colorful state survives, only motion is removed). Hover adds a one-shot
 * light-streak shimmer.
 * ---------------------------------------------------------------------------*/
@keyframes mingo-edge-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ring mask: clips the rotating conic layer to a 3px band along the frame's
   rounded outline (padding-box XOR), so the interior stays fully transparent
   and the host background shows through — no opaque cover element. */
.mingo-edge-frame {
  overflow: hidden;
  padding: 3px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.mingo-edge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 300%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  /* Single luminous accent arc with a soft tail — platform-tinted via the
     RAW --color-* accent var (the --ods-* alias does not exist in raw CSS). */
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    color-mix(in srgb, var(--color-accent-primary) 40%, transparent) 50deg,
    var(--color-accent-primary) 90deg,
    color-mix(in srgb, var(--color-accent-primary) 45%, white) 105deg,
    transparent 160deg
  );
  animation: mingo-edge-spin 4s linear infinite;
}

@keyframes mingo-shimmer {
  from { transform: translateX(-160%) skewX(-18deg); }
  to   { transform: translateX(260%) skewX(-18deg); }
}

.mingo-shimmer {
  opacity: 0;
  transform: translateX(-160%) skewX(-18deg);
}

.group\/mingo:hover .mingo-shimmer {
  opacity: 1;
  animation: mingo-shimmer 0.9s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .mingo-edge { animation: none; }
  .group\/mingo:hover .mingo-shimmer { animation: none; opacity: 0; }
}
