/* L4q — анимации и оформление кнопок, портированы из макета hr-bot-console.html
   и адаптированы под тему Транс-Цем (синий --blue на белом фоне).
   Скоуп: только вкладка «Проверка агента» (.agent-tab3 + правый дровер .agent-preview),
   чтобы не задевать остальной дашборд. */

:root{ --ag-ease:cubic-bezier(.2,.75,.2,1); }

/* единый плавный переход для интерактивных контролов консоли агента */
.agent-tab3 button,
.agent-preview button,
.agent-tab3 .ag-bot,
.agent-tab3 .ag-kb-pill{
  transition:background-color .18s var(--ag-ease),
             border-color .18s var(--ag-ease),
             color .18s var(--ag-ease),
             box-shadow .18s var(--ag-ease),
             transform .14s var(--ag-ease);
}

/* ---- primary (синие) кнопки: подъём + растущая цветная тень, нажатие осаживает ---- */
.agent-tab3 .bot-primary,
.agent-preview .bot-primary,
.agent-tab3 .ag-refresh{
  box-shadow:0 4px 12px -5px rgba(31,115,224,.7);
}
.agent-tab3 .bot-primary:hover,
.agent-preview .bot-primary:hover,
.agent-tab3 .ag-refresh:hover{
  background:var(--blue-deep)!important;
  border-color:var(--blue-deep)!important;
  transform:translateY(-1px);
  box-shadow:0 8px 18px -6px rgba(31,115,224,.7);
}
.agent-tab3 .bot-primary:active,
.agent-preview .bot-primary:active,
.agent-tab3 .ag-refresh:active{
  transform:translateY(0);
  box-shadow:0 4px 12px -5px rgba(31,115,224,.7);
}

/* ---- secondary / ghost: при наведении мягко окрашиваются в синий ---- */
.agent-tab3 .ag-actions button:not(.bot-primary):not(.cfg-danger):hover,
.agent-tab3 .ag-head>button:hover,
.agent-tab3 .ag-add-bot:hover,
.agent-tab3 .ag-kb-add:hover,
.agent-preview .ag-chat-clear:hover,
.agent-preview .ag-retest:hover{
  border-color:#bcd7ff;
  color:var(--blue);
  background:#eef6ff;
  transform:translateY(-1px);
}

/* ---- danger ---- */
.agent-tab3 .cfg-danger:hover,
.agent-tab3 .bot-danger:hover{
  background:#fdecec!important;
  border-color:#ffd0d0!important;
  transform:translateY(-1px);
}

/* ---- карточки-боты и pill-таблетки тем: лёгкий подъём как в макете ---- */
.agent-tab3 .ag-bot:hover{ transform:translateY(-1px); box-shadow:var(--shadow-hover); }
.agent-tab3 .ag-kb-pill:hover{ border-color:#bcd7ff; background:#eef6ff; transform:translateY(-1px); }

/* ---- busy-состояние: JS помечает кнопку disabled на время запроса ---- */
@keyframes ag-spin{ to{ transform:rotate(360deg); } }
.agent-tab3 .bot-primary:disabled,
.agent-preview .bot-primary:disabled{
  opacity:.85;
  cursor:progress;
  transform:none;
  box-shadow:0 4px 12px -5px rgba(31,115,224,.5);
}
.agent-tab3 .bot-primary:disabled::before,
.agent-preview .bot-primary:disabled::before{
  content:"";
  width:14px;height:14px;
  margin-right:8px;
  border-radius:50%;
  border:2px solid currentColor;
  border-top-color:transparent;
  display:inline-block;
  vertical-align:-2px;
  animation:ag-spin .8s linear infinite;
}
/* прочие (не-primary) disabled — просто приглушены, без спиннера */
.agent-tab3 button:not(.bot-primary):disabled,
.agent-preview button:not(.bot-primary):disabled{
  opacity:.55; cursor:not-allowed; transform:none;
}

/* ---- доступность: видимый фокус в синем ---- */
.agent-tab3 button:focus-visible,
.agent-preview button:focus-visible{
  outline:2px solid var(--blue);
  outline-offset:2px;
  border-radius:8px;
}

/* ---- уважение к prefers-reduced-motion ---- */
@media(prefers-reduced-motion:reduce){
  .agent-tab3 button,
  .agent-preview button,
  .agent-tab3 .ag-bot,
  .agent-tab3 .ag-kb-pill{ transition-duration:.001ms!important; }
  .agent-tab3 .bot-primary:disabled::before,
  .agent-preview .bot-primary:disabled::before{ animation:none; }
}
