/* ==========================================================================
   WIDGETS — botão do WhatsApp, notificação de prova social e pop-up de saída
   ========================================================================== */

/* ---------- Botão flutuante do WhatsApp ---------- */

.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #128c4a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background-color 0.3s ease;
}

.whatsapp-float img {
  width: 28px;
  height: 28px;
}

.whatsapp-float:hover {
  background-color: #0f7a40;
}

.whatsapp-float:active {
  transform: scale(0.95);
}

/* ---------- Notificação no canto inferior esquerdo ---------- */

.student-notification {
  position: fixed;
  bottom: 24px;
  left: -400px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background-color: var(--surface);
  transition: left 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.student-notification.show {
  left: 24px;
}

.notification-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--brand-purple);
  color: #fff;
  font-weight: 500;
  font-size: 20px;
}

.notification-content p {
  margin: 0;
}

.notification-name {
  font-weight: 500;
  font-size: 16px;
  color: #fff;
}

.notification-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Barra de progresso (cor definida via JS) */
.notification-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--brand-purple);
}

.notification-progress-bar.animate {
  animation: progress-shrink 8s linear forwards;
}

@keyframes progress-shrink {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* ---------- Pop-up de intenção de saída ---------- */

.exit-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  /* visibility só muda depois do fade-out, para o foco funcionar ao abrir */
  transition:
    opacity 0.3s ease,
    visibility 0s linear 0.3s;
}

.exit-popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.exit-popup-content {
  position: relative;
  width: 90%;
  max-width: 580px;
  padding: 32px;
  border: 2px dashed var(--yellow);
  border-radius: 16px;
  background-color: var(--dark);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.exit-popup-overlay.is-open .exit-popup-content {
  transform: translateY(0);
}

.close-popup {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.close-popup:hover,
.close-popup:focus-visible {
  color: #fff;
}

/* O foco vai para o X ao abrir o pop-up; o destaque é só a cor, sem o anel amarelo */
.close-popup:focus-visible {
  outline: none;
}

.exit-popup-content h2 {
  /* espaço à direita para não encostar no botão de fechar */
  padding-right: 24px;
  margin-bottom: 20px;
  font-size: 24px;
  line-height: 1.3;
  color: #fff;
}

.exit-popup-content p {
  font-size: 20px;
  line-height: 1.5;
  color: #fff;
}

.exit-popup-content p b {
  color: var(--yellow);
}

@media (max-width: 768px) {
  .student-notification {
    bottom: 90px;
  }

  .student-notification.show {
    left: 10px;
  }
}
