/* ═══════════════════════════════════════════════
   WIZI BOT MASCOT — Animated Character System
   A friendly robot companion for kids
   ═══════════════════════════════════════════════ */

/* ─── BASE STRUCTURE ──────────────────────────── */
.wizi-bot {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  cursor: pointer;
  user-select: none;
}

/* Sizes */
.wizi-bot-sm { --bot-scale: 0.55; transform: scale(var(--bot-scale)); transform-origin: bottom center; }
.wizi-bot-md { --bot-scale: 0.7; transform: scale(var(--bot-scale)); transform-origin: bottom center; }
.wizi-bot-lg { --bot-scale: 1; transform: scale(var(--bot-scale)); transform-origin: bottom center; }

/* ─── ANTENNA ─────────────────────────────────── */
.bot-antenna {
  width: 4px;
  height: 20px;
  background: linear-gradient(to top, var(--purple, #4F46E5), var(--orange, #F97316));
  border-radius: 2px;
  position: relative;
  z-index: 2;
  margin-bottom: -2px;
}
.bot-antenna-ball {
  width: 14px;
  height: 14px;
  background: var(--orange, #F97316);
  border-radius: 50%;
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
  animation: antenna-glow 2s ease-in-out infinite;
}
.bot-antenna-glow {
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 0 24px rgba(249, 115, 22, 0.5);
}
@keyframes antenna-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(249, 115, 22, 0.4); }
  50% { box-shadow: 0 0 16px rgba(249, 115, 22, 0.7), 0 0 24px rgba(249, 115, 22, 0.3); }
}

/* ─── HEAD ────────────────────────────────────── */
.bot-head {
  width: 100px;
  height: 80px;
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
  border-radius: 28px 28px 20px 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 2;
  border: 3px solid rgba(255,255,255,0.2);
  box-shadow:
    0 4px 12px rgba(79, 70, 229, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.15);
}
.bot-head-white {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
  border: 3px solid rgba(255,255,255,0.4);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.bot-head-white .bot-eye { background: #EEF2FF; border-color: #C7D2FE; }
.bot-head-white .bot-pupil { background: #4F46E5; }
.bot-head-white .bot-mouth-grin { border-color: #4F46E5; }

/* ─── EYES ────────────────────────────────────── */
.bot-eye {
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: eye-blink 4s ease-in-out infinite;
}
.bot-eye-wide {
  width: 28px;
  height: 28px;
}

.bot-pupil {
  width: 10px;
  height: 10px;
  background: #1E1B4B;
  border-radius: 50%;
  position: relative;
  transition: transform 0.3s ease;
}
.bot-pupil::after {
  content: '';
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 1px;
  right: 1px;
}

.bot-pupil-look {
  animation: pupil-wander 3s ease-in-out infinite;
}

@keyframes eye-blink {
  0%, 42%, 44%, 100% { transform: scaleY(1); }
  43% { transform: scaleY(0.1); }
}
@keyframes pupil-wander {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(3px, -2px); }
  50% { transform: translate(-2px, 1px); }
  75% { transform: translate(2px, 2px); }
}

/* ─── MOUTH ───────────────────────────────────── */
.bot-mouth {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
}
.bot-mouth-happy {
  width: 20px;
  height: 10px;
  border-bottom: 3px solid #fff;
  border-radius: 0 0 12px 12px;
}
.bot-mouth-open {
  width: 16px;
  height: 14px;
  background: #312E81;
  border-radius: 3px 3px 10px 10px;
  border: 2px solid rgba(255,255,255,0.3);
  animation: mouth-talk 1.5s ease-in-out infinite;
}
.bot-mouth-grin {
  width: 28px;
  height: 14px;
  border-bottom: 3px solid #fff;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-radius: 0 0 16px 16px;
}
@keyframes mouth-talk {
  0%, 100% { height: 14px; }
  30% { height: 8px; }
  60% { height: 16px; }
}

/* ─── BLUSH ───────────────────────────────────── */
.bot-blush {
  width: 14px;
  height: 8px;
  background: rgba(253, 121, 168, 0.4);
  border-radius: 50%;
  position: absolute;
  bottom: 20px;
}
.bot-blush-left { left: 10px; }
.bot-blush-right { right: 10px; }

/* ─── BODY ────────────────────────────────────── */
.bot-body {
  width: 80px;
  height: 70px;
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
  border-radius: 12px 12px 18px 18px;
  position: relative;
  margin-top: -4px;
  z-index: 1;
  border: 3px solid rgba(255,255,255,0.15);
  box-shadow:
    0 6px 16px rgba(79, 70, 229, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bot-body-white {
  background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(255,255,255,0.65));
  border: 3px solid rgba(255,255,255,0.4);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.bot-body-white .bot-screen { background: rgba(79, 70, 229, 0.1); border-color: rgba(79, 70, 229, 0.2); }
.bot-body-white .bot-arm { background: rgba(255,255,255,0.8); border-color: rgba(79, 70, 229, 0.2); }

/* ─── SCREEN (chest display) ──────────────────── */
.bot-screen {
  width: 40px;
  height: 30px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.bot-screen-text {
  font-family: 'Varela Round', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  animation: screen-pulse 2s ease-in-out infinite;
}
.bot-screen-icon {
  font-size: 18px;
  color: #FDCB6E;
  animation: screen-pulse 2s ease-in-out infinite;
}
.bot-screen-heart .bot-heart-beat {
  color: #FD79A8;
  font-size: 20px;
  animation: heart-beat 1s ease-in-out infinite;
}
@keyframes screen-pulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.25); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
}

/* ─── ARMS ────────────────────────────────────── */
.bot-arm {
  width: 16px;
  height: 40px;
  background: linear-gradient(to bottom, #4F46E5, #6366F1);
  border-radius: 8px;
  position: absolute;
  top: 10px;
  border: 2px solid rgba(255,255,255,0.15);
}
.bot-arm-left { left: -14px; transform: rotate(10deg); }
.bot-arm-right { right: -14px; transform: rotate(-10deg); }

.bot-arm-up.bot-arm-left { transform: rotate(-25deg) translateY(-8px); }
.bot-arm-up.bot-arm-right { transform: rotate(25deg) translateY(-8px); }

.bot-arm-waving {
  animation: arm-wave 1.2s ease-in-out infinite;
  transform-origin: top center;
}
@keyframes arm-wave {
  0%, 100% { transform: rotate(-10deg); }
  25% { transform: rotate(-45deg); }
  75% { transform: rotate(5deg); }
}

/* ─── LEGS ────────────────────────────────────── */
.bot-legs {
  display: flex;
  gap: 12px;
  margin-top: -2px;
  z-index: 0;
}
.bot-leg {
  width: 20px;
  height: 18px;
  background: linear-gradient(to bottom, #4F46E5, #4338CA);
  border-radius: 6px 6px 10px 10px;
  border: 2px solid rgba(255,255,255,0.1);
}
.bot-leg-white {
  background: linear-gradient(to bottom, rgba(255,255,255,0.7), rgba(255,255,255,0.5));
  border-color: rgba(79, 70, 229, 0.15);
}

/* ─── SHADOW ──────────────────────────────────── */
.bot-shadow {
  width: 60px;
  height: 10px;
  background: radial-gradient(ellipse, rgba(30, 27, 75, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  margin-top: 4px;
  animation: shadow-scale 2s ease-in-out infinite;
}
@keyframes shadow-scale {
  0%, 100% { transform: scaleX(1); opacity: 0.8; }
  50% { transform: scaleX(0.85); opacity: 0.5; }
}

/* ─── ANIMATION PRESETS ───────────────────────── */

/* Bounce */
.wizi-bounce { animation: wizi-bounce 2s ease-in-out infinite; }
@keyframes wizi-bounce {
  0%, 100% { transform: scale(var(--bot-scale, 1)) translateY(0); }
  50% { transform: scale(var(--bot-scale, 1)) translateY(-12px); }
}

/* Slow bounce for CTA */
.wizi-bounce-slow { animation: wizi-bounce-slow 3s ease-in-out infinite; }
@keyframes wizi-bounce-slow {
  0%, 100% { transform: scale(var(--bot-scale, 1)) translateY(0); }
  50% { transform: scale(var(--bot-scale, 1)) translateY(-8px); }
}

/* Wave entrance */
.wizi-wave { animation: wizi-wave-entrance 1s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes wizi-wave-entrance {
  from { opacity: 0; transform: scale(var(--bot-scale, 1)) translateY(20px) rotate(-5deg); }
  to { opacity: 1; transform: scale(var(--bot-scale, 1)) translateY(0) rotate(0deg); }
}

/* Hover: excited jiggle */
.wizi-bot:hover {
  animation: wizi-jiggle 0.5s ease-in-out;
}
@keyframes wizi-jiggle {
  0%, 100% { transform: scale(var(--bot-scale, 1)) rotate(0deg); }
  20% { transform: scale(var(--bot-scale, 1)) rotate(-8deg); }
  40% { transform: scale(var(--bot-scale, 1)) rotate(8deg); }
  60% { transform: scale(var(--bot-scale, 1)) rotate(-4deg); }
  80% { transform: scale(var(--bot-scale, 1)) rotate(4deg); }
}

/* Hover: eyes go wide */
.wizi-bot:hover .bot-eye {
  transform: scaleY(1.2);
  animation: none;
}
.wizi-bot:hover .bot-pupil {
  transform: scale(1.2);
  animation: none;
}

/* ─── LAYOUT HELPERS ──────────────────────────── */

/* Hero companion row */
.mascot-hero-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

/* CTA mascot positioning */
.cta-mascot {
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

/* ─── FLOATING MASCOT (corner buddy) ──────────── */
.wizi-bot-corner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  --bot-scale: 0.45;
  animation: wizi-bounce-slow 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(79, 70, 229, 0.2));
  transition: filter 0.3s;
}
.wizi-bot-corner:hover {
  filter: drop-shadow(0 6px 20px rgba(79, 70, 229, 0.35));
}
.wizi-bot-corner .bot-speech {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: #fff;
  color: var(--text, #1E1B4B);
  padding: 10px 16px;
  border-radius: 14px 14px 4px 14px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.wizi-bot-corner:hover .bot-speech {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ─── RESPONSIVE ──────────────────────────────── */
@media (max-width: 768px) {
  .wizi-bot-sm { --bot-scale: 0.45; }
  .wizi-bot-md { --bot-scale: 0.55; }
  .wizi-bot-lg { --bot-scale: 0.75; }
  .wizi-bot-corner { --bot-scale: 0.38; bottom: 16px; right: 16px; }
  .mascot-hero-row { gap: 10px; }
}
