/* ============================================
   WIZARDKIDZ MASCOT SYSTEM
   ============================================ */

/* Mascot Container */
.mascot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 5000;
    pointer-events: none;
}

.mascot-wrapper {
    position: relative;
    width: 120px;
    height: 140px;
}

/* Mascot Character */
.mascot {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.3s ease;
}

/* Character Display */
.mascot-body {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Character Emoji */
.mascot-head {
    font-size: 5rem;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2));
}

/* Face Elements - Hidden by default, used only for reactions */
.mascot-face {
    display: none;
}

/* Reaction Bubble */
.mascot-reaction {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-size: 2rem;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mascot-reaction.show {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* Speech Bubble */
.mascot-speech {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #1f2937;
    padding: 12px 20px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mascot-speech::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 white;
}

.mascot-speech.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* ============================================
   CHARACTER SPECIFIC STYLES
   ============================================ */

/* Wizard */
.mascot.wizard .mascot-body {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* Tiger */
.mascot.tiger .mascot-body {
    background: linear-gradient(135deg, #f97316, #fb923c);
}

/* Bear */
.mascot.bear .mascot-body {
    background: linear-gradient(135deg, #92400e, #b45309);
}

/* Lion */
.mascot.lion .mascot-body {
    background: linear-gradient(135deg, #fbbf24, #fcd34d);
}

/* Elephant */
.mascot.elephant .mascot-body {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

/* Rabbit */
.mascot.rabbit .mascot-body {
    background: linear-gradient(135deg, #ec4899, #f472b6);
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* Correct Answer Animation */
.mascot.animate-correct {
    animation: celebrate 0.6s ease;
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotate(-10deg);
    }
    75% {
        transform: scale(1.2) rotate(10deg);
    }
}

/* Wrong Answer Animation */
.mascot.animate-wrong {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Head Shake for Wrong */
.mascot-head.shake {
    animation: headShake 0.5s ease;
}

@keyframes headShake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

/* Jump Animation for Correct */
.mascot-head.jump {
    animation: jump 0.5s ease;
}

@keyframes jump {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Sparkle Effect */
.mascot-sparkle {
    position: absolute;
    font-size: 1.5rem;
    pointer-events: none;
    animation: sparkle 1s ease-out forwards;
}

@keyframes sparkle {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(var(--x), var(--y)) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) scale(0);
    }
}

/* ============================================
   MASCOT SELECTOR
   ============================================ */

.mascot-selector {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%) translateX(calc(100% + 60px));
    background: white;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 4999;
    pointer-events: auto;
    transition: transform 0.3s ease;
}

.mascot-selector.expanded {
    transform: translateY(-50%) translateX(0);
}

.mascot-selector h3 {
    margin: 0 0 15px;
    font-size: 1rem;
    color: #1f2937;
    text-align: center;
}

.mascot-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mascot-option {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    border: 3px solid transparent;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.mascot-option:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.mascot-option.active {
    border-color: #6366f1;
    background: linear-gradient(135deg, #ddd6fe, #c7d2fe);
}

.mascot-selector-toggle {
    position: absolute;
    left: -50px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    cursor: pointer;
    font-size: 1.5rem;
    pointer-events: auto;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mascot-selector-toggle:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.mascot-selector-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.mascot-selector.collapsed {
    transform: translateY(-50%) translateX(calc(100% + 60px));
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .mascot-container {
        bottom: 10px;
        right: 10px;
    }
    
    .mascot-wrapper {
        width: 90px;
        height: 110px;
    }
    
    .mascot-body {
        width: 80px;
        height: 80px;
    }
    
    .mascot-head {
        font-size: 4rem;
    }
    
    .mascot-selector {
        right: 10px;
    }
    
    .mascot-option {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* Hide mascot selector when not needed */
.hide-selector .mascot-selector {
    display: none;
}