/*
  Mluvii Copilot – styles for the button injected into the Mluvii chat toolbar.
  Everything else lives in the shadow root (see content.js).
*/

#ai-chat-button {
  --aiSize: 28px;

  position: relative !important;
  width: var(--aiSize) !important;
  height: var(--aiSize) !important;
  min-width: var(--aiSize) !important;
  min-height: var(--aiSize) !important;
  max-width: var(--aiSize) !important;
  max-height: var(--aiSize) !important;
  flex: 0 0 var(--aiSize) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 0 0 6px !important;
  box-sizing: border-box !important;
  border-radius: 8px !important;
  border: 0 !important;
  overflow: visible !important;
  color: #fff !important;
  background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 45%, #3B82F6 100%) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset, 0 3px 8px -2px rgba(99, 102, 241, .55) !important;
  cursor: pointer !important;
  user-select: none !important;
  outline: none !important;
  line-height: 0 !important;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 160ms ease !important;
}

#ai-chat-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset, 0 6px 14px -3px rgba(99, 102, 241, .65) !important;
}

#ai-chat-button:active { transform: translateY(0.5px); filter: brightness(.96); }

#ai-chat-button:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #6366F1 !important;
}

#ai-chat-button .ai-icon {
  width: 64%;
  height: 64%;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3));
}

#ai-chat-button .ai-icon svg { width: 100%; height: 100%; display: block; }

#ai-chat-button.is-busy .ai-icon { animation: mluvii-copilot-pulse 1.1s ease-in-out infinite; }

#ai-chat-button.is-busy::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 10px;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(139, 92, 246, .95), transparent);
  animation: mluvii-copilot-spin 1s linear infinite;
  z-index: -1;
}

#ai-chat-button.has-suggestion::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid #fff;
}

@keyframes mluvii-copilot-spin { to { transform: rotate(360deg); } }
@keyframes mluvii-copilot-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.8); } }
