/* =====================================================
   Epic Coding mascot — 6 character stickers
   thumbs-up · coding · celebrate · focused · happy · thinking
   ===================================================== */

.mascot {
  display: inline-block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  filter: drop-shadow(0 12px 28px rgba(15,23,42,0.18));
}
html.dark .mascot {
  filter: drop-shadow(0 14px 32px rgba(0,0,0,0.55));
}

/* Float animation (slow up-down) */
@keyframes mascot-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-12px) rotate(2deg); }
}
.mascot-float { animation: mascot-float 4.5s ease-in-out infinite; }

/* Bob animation (bigger, slower) */
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.mascot-bob { animation: mascot-bob 3.2s ease-in-out infinite; }

/* Wave/wiggle */
@keyframes mascot-wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}
.mascot-wiggle { animation: mascot-wiggle 2.4s ease-in-out infinite; transform-origin: 50% 90%; }

/* Pop-in entry */
@keyframes mascot-pop {
  0%   { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  60%  { transform: scale(1.1) rotate(4deg);   opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.mascot-pop { animation: mascot-pop .55s cubic-bezier(.34,1.56,.64,1) both; }

/* ===== HERO — floats next to code window ===== */
.mascot-hero {
  position: absolute;
  right: -28px; bottom: -16px;
  width: 168px; height: auto;
  z-index: 3;
  pointer-events: none;
}
@media (max-width: 1023px) { .mascot-hero { display: none; } }

/* ===== TRUST/Why-section corner mascot ===== */
.mascot-section {
  display: block;
  margin: 0 auto -8px;
  width: 96px; height: auto;
}

/* ===== Footer mascot — peeks above CTA ===== */
.mascot-footer {
  position: absolute;
  right: 24px; top: -78px;
  width: 132px; height: auto;
  z-index: 2;
  transform-origin: 50% 100%;
  pointer-events: none;
}
.footer-cta { position: relative; }
@media (max-width: 767px) { .mascot-footer { display: none; } }

/* ===== Floating chat widget bottom-right ===== */
.mascot-chat {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.mascot-chat-bubble {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #fff;
  color: #0f172a;
  border-radius: 18px;
  box-shadow: 0 18px 40px -10px rgba(15,23,42,0.35), 0 6px 16px rgba(15,23,42,0.10);
  border: 1px solid rgba(15,23,42,0.06);
  font-size: 13px; font-weight: 600;
  pointer-events: auto;
  white-space: nowrap;
  position: relative;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.mascot-chat-bubble::after {
  content: ''; position: absolute;
  right: 30px; bottom: -7px;
  width: 12px; height: 12px;
  background: #fff;
  border-right: 1px solid rgba(15,23,42,0.06);
  border-bottom: 1px solid rgba(15,23,42,0.06);
  transform: rotate(45deg);
}
html.dark .mascot-chat-bubble {
  background: #1e293b; color: #f1f5f9; border-color: rgba(255,255,255,0.08);
}
html.dark .mascot-chat-bubble::after { background: #1e293b; border-color: rgba(255,255,255,0.08); }
.mascot-chat-bubble.is-show { opacity: 1; transform: translateY(0); }

.mascot-chat-button {
  position: relative;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3c8cf3, #745af2);
  box-shadow: 0 12px 30px -6px rgba(60,140,243,0.55), 0 8px 20px rgba(116,90,242,0.35);
  cursor: pointer;
  pointer-events: auto;
  border: 3px solid #fff;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  overflow: visible;
  display: flex; align-items: center; justify-content: center;
}
.mascot-chat-button img {
  width: 92%; height: 92%;
  object-fit: contain;
  margin-bottom: -8px;
}
.mascot-chat-button:hover { transform: scale(1.10) rotate(-4deg); }
.mascot-chat-button::before {
  content: ''; position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(60,140,243,0.5);
  animation: chat-ping 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes chat-ping {
  0%   { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(1.4);  opacity: 0; }
}
html.dark .mascot-chat-button { border-color: #0f172a; }

.mascot-chat-menu {
  position: absolute;
  right: 0; bottom: 96px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 48px -10px rgba(15,23,42,0.35);
  border: 1px solid rgba(15,23,42,0.08);
  min-width: 200px;
  opacity: 0; transform: translateY(10px) scale(0.96);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.mascot-chat.is-open .mascot-chat-menu {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
html.dark .mascot-chat-menu { background: #1e293b; border-color: rgba(255,255,255,0.08); }

.mascot-chat-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  font-size: 13px; font-weight: 600; color: #0f172a;
  transition: background .18s ease, transform .15s ease;
}
.mascot-chat-link i { width: 22px; text-align: center; font-size: 16px; }
.mascot-chat-link:hover { background: rgba(60,140,243,0.10); transform: translateX(2px); }
html.dark .mascot-chat-link { color: #e2e8f0; }
html.dark .mascot-chat-link:hover { background: rgba(60,140,243,0.18); }

@media (max-width: 640px) {
  .mascot-chat { right: 12px; bottom: 12px; }
  .mascot-chat-button { width: 68px; height: 68px; }
  .mascot-chat-bubble { display: none; }
}

/* ===== Order success / confirmation big celebration ===== */
.mascot-celebrate-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 8px 0 14px;
}
.mascot-celebrate-hero img {
  width: 200px; height: auto;
  margin-bottom: 8px;
}

/* ===== Empty states — replace icon with mascot ===== */
.asrs-empty-inner.has-mascot i {
  display: none;
}
.asrs-empty-inner .asrs-empty-mascot {
  width: 132px; height: auto;
  margin-bottom: 4px;
  opacity: 0.95;
}

/* ===== 404 / contact hero ===== */
.mascot-404 {
  width: 240px; height: auto;
  margin: 0 auto 24px;
  display: block;
}

/* ===== Course detail + about hero — sitting "focused" ===== */
.mascot-course {
  width: 180px; height: auto;
  flex-shrink: 0;
}

/* Generic hover lift (when interactive) */
.mascot-tilt {
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  pointer-events: auto;
}
.mascot-tilt:hover { transform: translateY(-4px) rotate(-3deg) scale(1.03); }

/* =========================================================
   Floating-corner mascot — peeks at bottom-right of cards
   Default image + swap-on-hover (like changing expression)
   ========================================================= */
.card-mascot-corner {
  position: absolute;
  bottom: 100%;                     /* anchor to top of element */
  right: 6px;
  width: 80px;
  height: 80px;
  margin-bottom: -42px;             /* overlap upward into the media area */
  pointer-events: none;
  z-index: 3;
}
.card-mascot-corner img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(15,23,42,0.30));
  transition: opacity .35s ease, transform .45s cubic-bezier(.34,1.56,.64,1);
  transform-origin: 50% 100%;
  animation: cornerMascotIdle 4s ease-in-out infinite;
}
.card-mascot-corner img.is-hover {
  opacity: 0;
  transform: scale(0.85) translateY(8px);
  animation: none;
}
/* Parent hover triggers the swap */
.epic-card:hover .card-mascot-corner img.is-default,
.vip-plan:hover .card-mascot-corner img.is-default {
  opacity: 0;
  transform: scale(0.85) translateY(8px);
}
.epic-card:hover .card-mascot-corner img.is-hover,
.vip-plan:hover .card-mascot-corner img.is-hover {
  opacity: 1;
  transform: scale(1.06) translateY(-4px) rotate(-3deg);
  animation: cornerMascotPop .55s cubic-bezier(.34,1.56,.64,1);
}

@keyframes cornerMascotIdle {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-4px) rotate(1deg); }
}
@keyframes cornerMascotPop {
  0%   { transform: scale(0.7) translateY(14px) rotate(8deg); opacity: 0; }
  60%  { transform: scale(1.15) translateY(-8px) rotate(-5deg); opacity: 1; }
  100% { transform: scale(1.06) translateY(-4px) rotate(-3deg); }
}

/* ===== VIP plan variant — peeks from TOP-RIGHT corner ===== */
.vip-plan { position: relative; }
.vip-plan .card-mascot-corner {
  bottom: auto; left: auto; margin-bottom: 0;
  top: -22px; right: -14px;          /* peeks outside the card corner */
  width: 86px; height: 86px;
  z-index: 4;
}
.vip-plan .card-mascot-corner img {
  filter: drop-shadow(0 10px 22px rgba(15,23,42,0.25));
}
.vip-plan .card-mascot-corner img.is-hover {
  transform: scale(0.85) translateY(8px);
}
.vip-plan:hover .card-mascot-corner img.is-default {
  opacity: 0; transform: scale(0.85) translateY(8px) rotate(8deg);
}
.vip-plan:hover .card-mascot-corner img.is-hover {
  opacity: 1; transform: scale(1.08) translateY(-2px) rotate(-4deg);
  animation: cornerMascotPop .55s cubic-bezier(.34,1.56,.64,1);
}

/* Recommended tier — bigger mascot, even more prominent */
.vip-plan.is-recommended .card-mascot-corner {
  width: 100px; height: 100px;
  top: -28px; right: -18px;
}

/* CTA stays above mascot for clickability + visibility */
.vip-plan-cta { position: relative; z-index: 2; }

/* Mobile — smaller */
@media (max-width: 640px) {
  .card-mascot-corner { width: 60px; height: 60px; margin-bottom: -32px; }
  .vip-plan .card-mascot-corner { width: 70px; height: 70px; top: -16px; right: -8px; }
  .vip-plan.is-recommended .card-mascot-corner { width: 80px; height: 80px; }
}
