/* ==========================================================================
   EduResource ZA Official A+ Study Buddy Mascot - Visual Styles & Micro-Animations
   ========================================================================== */

.aplus-mascot-wrapper,
.niko-mascot-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  user-select: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

.aplus-character-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: aplusFloat 4s ease-in-out infinite;
}

.aplus-mascot-img {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
  pointer-events: none;
  max-width: 100%;
  height: auto;
}

.aplus-mascot-wrapper:hover .aplus-mascot-img {
  transform: scale(1.06) rotate(1.5deg);
  filter: drop-shadow(0 16px 32px rgba(225, 29, 72, 0.35));
}

/* Float & Breathing Animations */
@keyframes aplusFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-6px) rotate(0.6deg);
  }
}

@keyframes aplusBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-12px) scale(1.05) rotate(-1.5deg);
  }
  70% {
    transform: translateY(-4px) scale(1.02) rotate(1.5deg);
  }
}

@keyframes aplusGlowPulse {
  0%, 100% {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.28));
  }
  50% {
    filter: drop-shadow(0 14px 28px rgba(245, 158, 11, 0.45));
  }
}

/* State-Specific Animations */
.aplus-state-cheering .aplus-character-frame,
.niko-state-cheering .aplus-character-frame {
  animation: aplusBounce 1.3s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.aplus-state-streak .aplus-mascot-img,
.niko-state-streak .aplus-mascot-img {
  animation: aplusGlowPulse 2.5s ease-in-out infinite;
}

/* Compact Mascot Pill for Headers & Status Bars */
.aplus-compact .aplus-mascot-img,
.niko-compact .aplus-mascot-img {
  width: 44px !important;
  height: 44px !important;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.18));
}

.aplus-compact .aplus-character-frame,
.niko-compact .aplus-character-frame {
  animation: none;
}

/* Modern Glassmorphic Speech Bubble */
.aplus-speech-bubble,
.niko-speech-bubble {
  position: relative;
  margin-bottom: 14px;
  padding: 10px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(225, 29, 72, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-width: 290px;
  z-index: 10;
  animation: aplusBubblePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom center;
}

.aplus-bubble-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: #ffffff;
  display: block;
  letter-spacing: -0.01em;
}

/* Speech Bubble Downward Triangle Pointer */
.aplus-speech-bubble::after,
.niko-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(15, 23, 42, 0.94);
}

.aplus-speech-bubble::before,
.niko-speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid rgba(255, 255, 255, 0.15);
}

/* Light Mode Overrides */
[data-theme="light"] .aplus-speech-bubble,
[data-theme="light"] .niko-speech-bubble {
  background: #ffffff;
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 0 15px rgba(225, 29, 72, 0.08);
}

[data-theme="light"] .aplus-bubble-text {
  color: #0f172a;
}

[data-theme="light"] .aplus-speech-bubble::after,
[data-theme="light"] .niko-speech-bubble::after {
  border-top-color: #ffffff;
}

[data-theme="light"] .aplus-speech-bubble::before,
[data-theme="light"] .niko-speech-bubble::before {
  border-top-color: rgba(226, 232, 240, 0.9);
}

@keyframes aplusBubblePop {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
