/* ==========================================================================
   FOCUS BUDDY — ANIMATIONS & POMOCAT THEME
   Efeitos visuais dinâmicos, animações táteis e tema Pomocat
   ========================================================================== */

/* ---- Transição suave entre telas (View Transition) ---- */
section[id^="view-"]{
  animation: viewFadeSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes viewFadeSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Animações do Mascote bichinho (Pomocat Breathing & Life) ---- */
.pomocat-mascot-wrap{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.pomocat-pet-svg{
  width: 400px;
  height: 180px;
  object-fit: contain;
  animation: pomocatBreathe 3.2s ease-in-out infinite;
  transform-origin: bottom center;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.4));
  transition: all 0.3s ease;
}

@keyframes pomocatBreathe {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.035, 1.02) translateY(-2px);
  }
}

/* Modo Descanso / Pausa do Mascote (Sleeping) */
.pomocat-mascot-wrap.is-break .pomocat-pet-svg{
  animation: pomocatSleep 4s ease-in-out infinite;
  filter: drop-shadow(0 4px 10px rgba(56,189,248,0.25));
}
@keyframes pomocatSleep {
  0%, 100% { transform: scale(0.97) rotate(-2deg); }
  50% { transform: scale(1.01) rotate(1deg); }
}

/* Comemoração ao concluir um pomodoro */
.pomocat-pet-svg.is-celebrating{
  animation: pomocatCelebrate 0.55s ease-in-out 4;
}
@keyframes pomocatCelebrate {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-14px) rotate(-6deg); }
  60% { transform: translateY(0) rotate(6deg); }
}

/* Zzz flutuantes no descanso */
.pomocat-zzz{
  position: absolute;
  top: -6px;
  right: 18px;
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  opacity: 0;
  animation: zzzFloat 2.6s infinite ease-out;
  pointer-events: none;
}
@keyframes zzzFloat {
  0% { opacity: 0; transform: translate(0, 0) scale(0.7); }
  40% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(14px, -24px) scale(1.3); }
}

/* Balãozinho de Fala / Motivação do bichinho */
.pomocat-bubble{
  background: rgba(13, 17, 23, 0.94);
  border: 1px solid rgba(63,167,163, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(46,138,134, 0.2);
  color: #F8FAFC;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: bubbleFloat 3s ease-in-out infinite alternate;
  white-space: nowrap;
}
@keyframes bubbleFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

/* ---- Timer Circular Estilo Pomocat ---- */
.pomocat-container{
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: 26px 16px 20px;
  max-width: 340px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Linha minimalista de modo: bolinha colorida + foco · pausa · longa */
.pomocat-mode-row{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 14px;
}
.pomocat-mode-dot{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
  transition: background-color 0.35s ease;
}
.pomocat-mode-sep{ color: var(--line); font-size: 11px; }
.pomocat-mode-tab{
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
  border: none;
  background: transparent;
  padding: 2px 2px;
  text-transform: lowercase;
}
.pomocat-mode-tab:hover{ color: var(--ink); }
.pomocat-mode-tab.active{
  color: var(--ink);
  font-weight: 800;
}

/* Anel de progresso circular em volta do tempo: preenchimento liso e contínuo,
   sem rotação chamativa a cada segundo (a animação em si já cansa quem está
   tentando focar — só a cor/preenchimento muda). */
.pomocat-ring-wrap{
  position: relative;
  width: 186px;
  height: 186px;
  margin: 4px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pomocat-ring-svg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}
.pomocat-ring-track{
  fill: none;
  stroke: var(--line);
  stroke-width: 10;
}
.pomocat-ring-progress{
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke: url(#pomocatGradient);
  transition: stroke-dashoffset 0.25s linear, stroke 0.45s ease;
}
/* Pulso suave e lento enquanto o timer roda — presença contínua, não um "tique" por segundo */
.pomocat-ring-wrap.is-running .pomocat-ring-svg{
  animation: pomocatRingPulse 2.6s ease-in-out infinite;
}
@keyframes pomocatRingPulse {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 10px var(--sage-soft)); }
}

.pomocat-time-display{
  position: relative;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}
.pomocat-time-editable{ cursor: pointer; border-radius: 12px; }
.pomocat-time-editable:hover{ color: var(--sage-dark); }
.pomocat-time-input{
  width: 2.3em;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: inherit;
  background: transparent;
  border: none;
  border-bottom: 2px dashed var(--sage);
  outline: none;
  -moz-appearance: textfield;
}
.pomocat-time-input::-webkit-outer-spin-button,
.pomocat-time-input::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }

/* Pontinhos de progresso do ciclo (em vez de carimbos/emoji) */
.pomocat-stamps-row{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.pomocat-stamp{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--line);
  display: inline-block;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pomocat-stamp.filled{
  background: var(--sage);
  border-color: var(--sage);
  transform: scale(1.15);
}

.pomocat-mascot-wrap{ margin-top: 12px; }

/* Botão play circular minimalista */
.pomocat-play-btn{
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.pomocat-play-btn:hover{ transform: scale(1.06); }
.pomocat-play-btn:active{ transform: scale(0.96); }
.pomocat-play-btn.is-active{ background: var(--sage); color: var(--on-sage); }
.pomocat-toggle-label{
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 6px;
}

/* Ações secundárias minimalistas, em texto */
.pomocat-actions-bar{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 13px;
}
.pomocat-action-btn{
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pomocat-action-btn:hover{
  color: var(--ink);
}

/* ---- Micro-animações Globais no Site ---- */
/* Efeito de Elevação e Iluminação Suave em Cards */
.card, .pet-card{
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover{
  border-color: rgba(63,167,163, 0.2) !important;
}

/* Botões com pressão tátil */
button:active{
  transform: scale(0.97) !important;
}

/* Shimmer animado para barras de progresso (XP) */
.xp-fill, #xpFill{
  position: relative;
  overflow: hidden;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.xp-fill::after, #xpFill::after{
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: xpShimmer 2.2s infinite;
}
@keyframes xpShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Chips com transição animada */
.chip{
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.chip:hover{
  transform: translateY(-1px);
}
.chip.active{
  box-shadow: 0 4px 12px rgba(46,138,134, 0.4);
}

/* Sala do Pet com respiração suave */
#petSvg{
  animation: petIdle 4s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes petIdle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02, 1.015) translateY(-2px); }
}

/* Confetes de comemoração */
.confetti-particle{
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 3px;
  animation: confettiFall 2.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(85vh) rotate(720deg) scale(0.5);
  }
}

/* ---- Gamificação de Flashcards: Emotes Flutuantes e Efeitos de Recompensa ---- */
.floating-emote-particle{
  position: fixed;
  pointer-events: none;
  z-index: 100000;
  font-family: 'Baloo 2', 'Figtree', sans-serif;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
  animation: floatEmoteUp 1.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backface-visibility: hidden;
  will-change: transform, opacity;
  font-size: 14.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
}

/* Explosão tipo fogo de artifício: cada partícula usa suas próprias --dx/--dy
   (ângulo e distância aleatórios, definidos no JS) pra sair voando a partir do
   ponto de clique, em vez de todas subirem juntas na mesma coluna reta. */
@keyframes floatEmoteUp {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
  }
  15% {
    opacity: 1;
    transform: translate(calc(-50% + var(--dx, 0px) * 0.3), calc(-50% + var(--dy, -40px) * 0.3)) scale(1.2) rotate(8deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -90px))) scale(0.7) rotate(-6deg);
  }
}

.mini-burst-icon{
  position: fixed;
  pointer-events: none;
  z-index: 100001;
  font-size: 26px;
  animation: miniBurstUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
}

@keyframes miniBurstUp {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.3);
  }
  30% {
    opacity: 1;
    transform: translate(var(--tx, 0px), var(--ty, -30px)) scale(1.35);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--tx, 0px) * 1.6), calc(var(--ty, -30px) - 45px)) scale(0.5);
  }
}

@keyframes coinJiggle {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.28) rotate(-6deg); }
  50% { transform: scale(1.18) rotate(6deg); }
  75% { transform: scale(1.22) rotate(-3deg); }
}
.coin-jiggle {
  animation: coinJiggle 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Card de conquista de revisão */
.fc-reward-stat-box{
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 90px;
}
.fc-reward-stat-val{
  font-family: 'Baloo 2', cursive, sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--gold);
}
.fc-reward-stat-lbl{
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}
