/* =========================================================
   Mascote (caricatura do professor) com animação real quadro
   a quadro. Componente reutilizável: incluir este CSS + o
   mascot.js em QUALQUER página do site para exibir o mesmo
   assistente.
   ========================================================= */

.mascot-widget {
  --mascot-azul-escuro: #0063A9;
  --mascot-azul-claro: #0596B5;
  --mascot-marinho: #071022;
  --mascot-creme: #FAF1E8;
  --mascot-perola: #FFFBEE;
  --mascot-laranja: #F78219;

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  font-family: "Avenir Next", Avenir, "Poppins", "Segoe UI", sans-serif;
  touch-action: none;
  user-select: none;
}

.mascot-widget.mascot-dragging {
  transition: none !important;
}

/* Sem moldura: só o desenho (PNG com fundo transparente) flutuando,
   com uma sombra suave para dar profundidade sem criar um "quadrado". */
.mascot-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  padding: 0;
  border: none;
  background: none;
  cursor: grab;
  display: block;
  filter: drop-shadow(0 10px 12px rgba(7, 16, 34, 0.4));
  -webkit-tap-highlight-color: transparent;
}

.mascot-avatar:active {
  cursor: grabbing;
}

.mascot-widget.mascot-dragging .mascot-avatar {
  cursor: grabbing;
}

.mascot-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* Balão de fala */
.mascot-bubble {
  position: absolute;
  right: 0;
  bottom: 136px;
  width: max-content;
  max-width: 230px;
  background: var(--mascot-perola);
  color: var(--mascot-marinho);
  border: 2px solid var(--mascot-azul-claro);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  box-shadow: 0 10px 22px rgba(7, 16, 34, 0.25);
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mascot-bubble::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -9px;
  width: 16px;
  height: 16px;
  background: var(--mascot-perola);
  border-right: 2px solid var(--mascot-azul-claro);
  border-bottom: 2px solid var(--mascot-azul-claro);
  transform: rotate(45deg);
}

.mascot-widget.mascot-talking .mascot-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Menu de contexto (ocultar / mostrar) */
.mascot-menu {
  position: absolute;
  right: 0;
  bottom: 136px;
  background: var(--mascot-perola);
  border: 1.5px solid var(--mascot-azul-claro);
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(7, 16, 34, 0.3);
  overflow: hidden;
  min-width: 170px;
}

.mascot-menu[hidden] { display: none; }

.mascot-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mascot-marinho);
  cursor: pointer;
}

.mascot-menu button:hover {
  background-color: rgba(5, 150, 181, 0.12);
  color: var(--mascot-azul-escuro);
}

/* Botão flutuante para trazer o mascote de volta */
.mascot-show-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--mascot-marinho, #071022);
  color: var(--mascot-creme, #FAF1E8);
  border: 2px solid var(--mascot-azul-claro, #0596B5);
  border-radius: 999px;
  font-family: "Avenir Next", Avenir, "Poppins", "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(7, 16, 34, 0.35);
}

.mascot-show-btn[hidden] { display: none; }

.mascot-show-btn:hover {
  background: var(--mascot-azul-escuro, #0063A9);
}

@media (max-width: 480px) {
  .mascot-widget { right: 14px; bottom: 14px; }
  .mascot-avatar { width: 100px; height: 100px; }
  .mascot-bubble, .mascot-menu { bottom: 114px; max-width: 190px; }
  .mascot-show-btn { right: 14px; bottom: 14px; }
}
