/* ============================================
   KAI KOALA ASSISTANT - SINGLE SOURCE OF TRUTH
   All size and positioning rules consolidated here
   ============================================ */

/* Default: Game pages - 200px, fixed bottom-left */
.kai-assistant {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 200px;
    height: 200px;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Removed brightness effects for neurodivergent accessibility */

.kai-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 15px;
    transition: all 0.3s ease;
}

/* Removed speaking brightness animation for accessibility */

/* Removed pulse animation for accessibility */

/* Optimized for 1200x800 and 1920x1200 screens ONLY */



/* Ensure Koala doesn't interfere with other elements */
.kai-assistant {
    pointer-events: auto;
}

/* Bounce animation */
.kai-assistant.bounce {
    animation: kaiBounce 0.3s ease-in-out;
}

@keyframes kaiBounce {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* Wiggle animation */
.kai-assistant.wiggle {
    animation: kaiWiggle 0.3s ease-in-out;
}

@keyframes kaiWiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

/* Voice Assistant Enhancements */
/* .kai-assistant {
    position: relative;
} */

.kai-voice-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 16px;
    height: 16px;
    background: #4CAF50;
    border-radius: 50%;
    display: none;
    border: 2px solid white;
    box-shadow: none; /* No extra glow */
}

.kai-assistant.active .kai-voice-indicator {
    display: block;
}

/* Voice states */
.kai-assistant.idle {
    opacity: 1;
}

.kai-assistant.active {
    opacity: 1;
}

.kai-assistant.speaking {
    opacity: 1;
}

/* Optional subtle glow when listening (guarded for reduced motion) */
/* Remove listening glow to simplify homescreen visuals */
@media (prefers-reduced-motion: no-preference) {
    .kai-assistant.active.listening .kai-image { box-shadow: none; }
}

/* ============================================
   PAGE-SPECIFIC OVERRIDES
   ============================================ */

/* Homescreen: 450px, relative positioning (flows with layout) */
body.homescreen-page .kai-assistant,
body.homescreen-page #kai-assistant {
    width: 450px !important;
    height: 450px !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
}

/* Centered pages: Languages & Daily Facts - 480px, centered */
body.languages-games-page .kai-assistant,
body.languages-games-page #kai-assistant,
body.kai-daily-fact-page .kai-assistant,
body.kai-daily-fact-page #kai-assistant {
    width: 480px !important;
    height: 480px !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    bottom: auto !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    z-index: 500 !important;
}
