body {
  font-family: "Poppins", sans-serif;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease-in-out;
}

.sidebar-active {
  background: rgba(255, 255, 255, 0.15);
  border-left: 4px solid #38bdf8;
  font-weight: 600;
}

/* Solo per i tooltip personalizzati */
.custom-tooltip {
  background-color: rgba(255, 255, 255, 0.8) !important;
  color: rgb(0, 0, 0) !important;
  padding: 10px !important;
  border-radius: 5px !important;
  font-size: 14px !important;
  width: 150px !important;
  height: auto !important;
  text-align: center !important;
  pointer-events: none !important;
  background-image: none !important;
}

.avatarHotspot img {
  position: relative;
  display: inline-block;
  width: 4000px;
  height: auto;
}

/* Smartphone */
@media (max-width: 600px) {
  .avatarHotspot img {
    width: 120px;
  }
}

/* Tablet */
@media (min-width: 601px) and (max-width: 1024px) {
  .avatarHotspot img {
    width: 200px;
  }
}

/* Desktop grande */
@media (min-width: 1025px) {
  .avatarHotspot img {
    width: 300px;
  }
}

/* FORZARE TEMA CHIARO HOTSPOT PANNELLUM - SOLO PER HOTSPOT DI NAVIGAZIONE */
.pnlm-hotspot:not(.avatarHotspot),
.pnlm-hotspot-base:not(.avatarHotspot),
div.pnlm-hotspot:not(.avatarHotspot) {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border: 2px solid rgba(0, 0, 0, 0.2) !important;
  color: #000 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.pnlm-hotspot:not(.avatarHotspot):hover,
.pnlm-hotspot-base:not(.avatarHotspot):hover,
div.pnlm-hotspot:not(.avatarHotspot):hover {
  background-color: rgba(255, 255, 255, 1) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4) !important;
}

/* Freccia/icona dentro l'hotspot */
.pnlm-hotspot:not(.avatarHotspot) .pnlm-sprite,
.pnlm-hotspot-base:not(.avatarHotspot) .pnlm-sprite {
  filter: invert(0) brightness(0) !important;
}

/* Testo dentro l'hotspot */
.pnlm-hotspot:not(.avatarHotspot) span,
.pnlm-hotspot-base:not(.avatarHotspot) span {
  color: #000 !important;
  text-shadow: none !important;
}

/* NUVOLA */
#speechBox {
  position: absolute;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  border-radius: 12px;
  max-width: 200px;
  display: none;
  z-index: 9999;
  font-size: 16px;
  text-align: center;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.speech-dot {
  width: 6px;
  height: 6px;
  background-color: white;
  border-radius: 50%;
  animation: blink 1s infinite;
}

.speech-dot:nth-child(1) {
  animation-delay: 0s;
}
.speech-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.speech-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}

/* Animazione dei puntini alternati */
.talking-dots span:nth-child(1) {
  animation-delay: 0s;
}
.talking-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.talking-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ━━━ POPUP SCUOLA-FAMIGLIA ━━━ */

.popup-fade-in {
  animation: popupFadeIn 0.3s ease-out;
}

.popup-card {
  animation: popupSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes popupSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ━━━ SEZIONE PROFESSORI ━━━ */

/* Spinner caricamento */
.prof-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: profSpin 0.8s linear infinite;
}

@keyframes profSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Tabella */
.prof-table {
  border-collapse: collapse;
}

.prof-table thead th {
  user-select: none;
}

.prof-sort-icon {
  font-size: 10px;
  opacity: 0.6;
  margin-left: 2px;
}

/* Select scuro con opzioni leggibili */
.prof-select option {
  background-color: #1e3a5f;
  color: #fff;
}

/* Badge classi */
.prof-badge {
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Responsive: sotto 640px nasconde tabella, sopra nasconde card */
@media (max-width: 639px) {
  #prof-table-wrap {
    display: none !important;
  }
}

@media (min-width: 640px) {
  #prof-cards {
    display: none !important;
  }
}
