/* =====================================================================
   FIBER COMMAND CENTER - motion layer
   Master Build Prompt section 2: transitions 150-220ms, subtle pointer
   feedback, no excessive animation or glow, reduced-motion respected.

   Every rule is additive. Nothing here changes layout, colour or
   behaviour, so it cannot break a working control - it only affects how
   state changes are presented.
   ===================================================================== */

:root {
  --mo-fast: 140ms;
  --mo-base: 190ms;
  --mo-slow: 260ms;
  --mo-ease: cubic-bezier(.4, 0, .2, 1);
  --mo-spring: cubic-bezier(.34, 1.26, .64, 1);
}

/* ---- window open ----------------------------------------------------- */
@keyframes mo-dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.fcc-cw-window.is-open {
  animation: mo-dialog-in var(--mo-slow) var(--mo-spring) both;
}

/* ---- list rows: settle in, lift on hover ----------------------------- */
@keyframes mo-row-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.fcc-cw-rows .fcc-cw-row {
  animation: mo-row-in var(--mo-base) var(--mo-ease) both;
}
/* Stagger the first few so a list assembles rather than snapping in.
   Capped at 8 - beyond that the delay is felt as lag, not polish. */
.fcc-cw-rows .fcc-cw-row:nth-child(1) { animation-delay: 0ms; }
.fcc-cw-rows .fcc-cw-row:nth-child(2) { animation-delay: 22ms; }
.fcc-cw-rows .fcc-cw-row:nth-child(3) { animation-delay: 44ms; }
.fcc-cw-rows .fcc-cw-row:nth-child(4) { animation-delay: 66ms; }
.fcc-cw-rows .fcc-cw-row:nth-child(5) { animation-delay: 88ms; }
.fcc-cw-rows .fcc-cw-row:nth-child(6) { animation-delay: 110ms; }
.fcc-cw-rows .fcc-cw-row:nth-child(7) { animation-delay: 132ms; }
.fcc-cw-rows .fcc-cw-row:nth-child(8) { animation-delay: 154ms; }
.fcc-cw-rows .fcc-cw-row:nth-child(n+9) { animation-delay: 170ms; }

.fcc-cw-row { transition: transform var(--mo-fast) var(--mo-ease), box-shadow var(--mo-base) var(--mo-ease), background var(--mo-base) var(--mo-ease); }
.fcc-cw-row:hover { transform: translateX(2px); }
.fcc-cw-row:active { transform: translateX(2px) scale(.995); }

/* ---- buttons: press feedback ----------------------------------------- */
.fcc-cw-btn, .fcc-cw-iconbtn, .fcc-cw-chip, .fcc-cw-tab,
.fcc-cw-botnav-item, .fcc-cw-callbar button {
  transition: transform var(--mo-fast) var(--mo-ease),
              box-shadow var(--mo-base) var(--mo-ease),
              background var(--mo-base) var(--mo-ease),
              color var(--mo-base) var(--mo-ease);
}
.fcc-cw-btn:active, .fcc-cw-iconbtn:active, .fcc-cw-chip:active,
.fcc-cw-callbar button:active { transform: scale(.94); }
.fcc-cw-btn:hover, .fcc-cw-iconbtn:hover { transform: translateY(-1px); }

/* ---- messages: arrive from the side that sent them ------------------- */
@keyframes mo-msg-in {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to   { opacity: 1; transform: none; }
}
.fcc-cw-msgs .fcc-cw-msg { animation: mo-msg-in var(--mo-base) var(--mo-ease) both; }

/* ---- tabs and sections: cross-fade rather than snap ------------------ */
@keyframes mo-pane-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.fcc-cw-pane > *, .fcc-cw-list > * { animation: mo-pane-in var(--mo-base) var(--mo-ease) both; }

/* ---- modals and menus ------------------------------------------------ */
@keyframes mo-modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes mo-scrim-in { from { opacity: 0; } to { opacity: 1; } }
.fcc-cw-modal { animation: mo-scrim-in var(--mo-fast) var(--mo-ease) both; }
.fcc-cw-modal-card { animation: mo-modal-in var(--mo-slow) var(--mo-spring) both; }
.fcc-cw-menu { animation: mo-modal-in var(--mo-base) var(--mo-spring) both; transform-origin: top right; }

/* ---- toast ----------------------------------------------------------- */
@keyframes mo-toast-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.fcc-cw-toast { animation: mo-toast-in var(--mo-base) var(--mo-spring) both; }

/* ---- incoming call: a calm pulse, not a strobe ----------------------- */
@keyframes mo-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(71,120,237,.34); }
  50%      { box-shadow: 0 0 0 12px rgba(71,120,237,0); }
}
.fcc-cw-ring { animation: mo-dialog-in var(--mo-slow) var(--mo-spring) both; }
.fcc-cw-ring .fcc-cw-btn.is-answer,
.fcc-cw-ring-row button:last-child { animation: mo-ring 1.9s ease-out infinite; }

/* ---- active speaker -------------------------------------------------- */
.fcc-cw-tile { transition: outline-color var(--mo-base) var(--mo-ease), transform var(--mo-base) var(--mo-ease); }
.fcc-cw-tile.is-speaking { transform: scale(1.012); }

/* ---- mobile rail slide ----------------------------------------------- */
.fcc-cw-rail { transition: transform var(--mo-slow) var(--mo-ease); }
.fcc-cw-scrim { transition: opacity var(--mo-base) var(--mo-ease); }

/* ---- badges ---------------------------------------------------------- */
@keyframes mo-badge-pop {
  0%   { transform: scale(.5); opacity: 0; }
  60%  { transform: scale(1.14); opacity: 1; }
  100% { transform: scale(1); }
}
.fcc-cw-badge { animation: mo-badge-pop var(--mo-slow) var(--mo-spring) both; }

/* ---- field ops launch ------------------------------------------------ */
#arb-field-launch { transition: transform var(--mo-base) var(--mo-spring), box-shadow var(--mo-base) var(--mo-ease); }
#arb-field-launch:hover { transform: translateY(-2px); }
#arb-field-launch:active { transform: scale(.95); }

/* ---- the one rule that matters most ---------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
