/* ==========================================================================
   stitch_fx.css — micro-interações do redesign Stitch aplicadas ao Studio
   modular. CSS-only; escopo: chat principal (/ e /studio).
   ========================================================================== */

/* --- 1. Pulso ambiente no botão de envio (só quando pode enviar) ---------- */
@keyframes stitch-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(211, 173, 120, 0.28); }
  50%      { box-shadow: 0 0 14px 4px rgba(211, 173, 120, 0.42); }
}

.send-btn:not(:disabled):not(.stop) {
  animation: stitch-pulse-glow 2.8s ease-in-out infinite;
}

.send-btn:not(:disabled):not(.stop):hover {
  animation: none;
}

/* --- 2. Shimmer no seletor de modelo (topbar) ----------------------------- */
@keyframes stitch-badge-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

#model-btn {
  position: relative;
  overflow: hidden;
}

#model-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.10) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: stitch-badge-shimmer 4s linear infinite;
  pointer-events: none;
}

/* --- 3. Hover tátil em mensagens, chips e ações --------------------------- */
.msg,
.att-card,
.source-pill,
.web-source-pill,
.msg-action,
.tool-exec-item {
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.18s ease;
}

.msg.user:hover .m-body {
  border-color: rgba(211, 173, 120, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.msg-action:hover,
.tool-exec-item:hover {
  transform: translateY(-1px);
}

.att-card:hover,
.source-pill:hover,
.web-source-pill:hover {
  border-color: rgba(211, 173, 120, 0.4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}

/* --- 4. Cursor de streaming mais vivo ------------------------------------- */
.stream-cursor,
.live-stream-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent, #d3ad78);
  border-radius: 1px;
  animation: stitch-cursor-blink 1s steps(2, start) infinite;
}

@keyframes stitch-cursor-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* --- 5. Respeito a prefers-reduced-motion --------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .send-btn:not(:disabled):not(.stop),
  #model-btn::after,
  .stream-cursor,
  .live-stream-cursor {
    animation: none !important;
  }
}
