/**
 * Aether Avatar Styles
 * Energy-being design with glowing orb aesthetic
 */

/* Container positioning */
.aether-avatar-container {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.aether-avatar-container.bottom-right {
    bottom: 24px;
    right: 24px;
}

.aether-avatar-container.bottom-left {
    bottom: 24px;
    left: 24px;
}

/* Minimized bubble - refined 40px size */
.aether-bubble {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00d4ff 0%, #0088ff 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 136, 255, 0.3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Mascot bubble - transparent with materialization effects */
.aether-mascot.aether-bubble,
.aether-bubble.aether-mascot-bubble {
    width: 40px;
    height: 40px;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.25);
    overflow: visible;
    animation: mascotBreathe 4s ease-in-out infinite;
}

/* Breathing animation - subtle "alive" effect */
@keyframes mascotBreathe {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.3));
    }
    50% { 
        transform: scale(1.03);
        filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5));
    }
}

/* Shimmer effect overlay */
.aether-bubble.aether-mascot-bubble::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 60%
    );
    animation: mascotShimmer 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes mascotShimmer {
    0%, 100% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
}

/* Hover - subtle grow with enhanced glow */
.aether-bubble.aether-mascot-bubble:hover {
    animation: none;
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.5));
}

.aether-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 136, 255, 0.4);
}

.aether-mascot.aether-bubble:hover {
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
}

/* Thinking state - faster pulse */
.aether-bubble.aether-mascot-bubble.thinking {
    animation: mascotThinking 1.2s ease-in-out infinite;
}

@keyframes mascotThinking {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
    }
    50% { 
        transform: scale(1.05);
        filter: drop-shadow(0 0 18px rgba(59, 130, 246, 0.7));
    }
}

/* Speaking state - rhythmic glow */
.aether-bubble.aether-mascot-bubble.speaking {
    animation: mascotSpeaking 0.8s ease-in-out infinite;
}

@keyframes mascotSpeaking {
    0%, 100% { 
        filter: drop-shadow(0 0 8px rgba(234, 179, 8, 0.4));
    }
    50% { 
        filter: drop-shadow(0 0 16px rgba(234, 179, 8, 0.7));
    }
}

.aether-bubble-pulse {
    animation: bubblePulse 2s ease-in-out infinite;
}

@keyframes bubblePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Notification badge */
.aether-bubble-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: #ff4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #1a1a2e;
    animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Aether Orb (Energy Being) */
.aether-orb {
    position: relative;
    width: 40px;
    height: 40px;
}

.aether-orb-small {
    width: 32px;
    height: 32px;
}

.aether-orb-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, #ffffff 0%, #00ffff 100%);
    border-radius: 50%;
    animation: coreFloat 3s ease-in-out infinite;
}

.aether-orb-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
}

.aether-orb-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    animation: pulsate 2s ease-out infinite;
}

@keyframes coreFloat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes pulsate {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* Animation states */
.aether-orb-speaking .aether-orb-core {
    animation: speakingCore 0.5s ease-in-out infinite;
}

.aether-orb-speaking .aether-orb-glow {
    animation: speakingGlow 0.5s ease-in-out infinite;
}

@keyframes speakingCore {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

@keyframes speakingGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.aether-orb-celebrating .aether-orb-core {
    background: radial-gradient(circle, #ffff00 0%, #ff00ff 100%);
    animation: celebrateCore 0.3s ease-in-out infinite;
}

@keyframes celebrateCore {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    25% { transform: translate(-50%, -50%) rotate(-15deg) scale(1.3); }
    75% { transform: translate(-50%, -50%) rotate(15deg) scale(1.3); }
}

.aether-orb-thinking .aether-orb-pulse {
    animation: thinkingPulse 1s ease-in-out infinite;
}

@keyframes thinkingPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.6; }
}

/* Expanded window */
.aether-window {
    width: 380px;
    max-width: 90vw;
    max-height: 600px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 212, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.aether-window-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Window header */
.aether-window-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 136, 255, 0.1) 100%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.aether-avatar-icon {
    flex-shrink: 0;
}

.aether-title {
    flex: 1;
}

.aether-name {
    font-size: 16px;
    font-weight: 600;
    color: #00ffff;
    letter-spacing: 0.5px;
}

.aether-subtitle {
    font-size: 11px;
    color: #88ccff;
    margin-top: 2px;
}

.aether-minimize-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aether-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Message container */
.aether-window-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.aether-message-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aether-message {
    background: rgba(0, 136, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 14px;
    animation: messageSlideIn 0.4s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aether-message-celebration {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 0, 255, 0.2) 100%);
    border-color: rgba(255, 215, 0, 0.5);
}

.aether-message-content {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.aether-message-timestamp {
    color: #88ccff;
    font-size: 11px;
    opacity: 0.7;
}

/* Actions */
.aether-window-actions {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aether-action-btn {
    background: linear-gradient(135deg, #00d4ff 0%, #0088ff 100%);
    border: none;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.aether-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 136, 255, 0.4);
}

.aether-action-btn:active {
    transform: translateY(0);
}

/* 3D Canvas Support */
.aether-3d-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    background: transparent;
}

.aether-bubble-icon.aether-3d-mode {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.aether-bubble.aether-3d-mode {
    background: transparent;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.aether-bubble.aether-3d-mode:hover {
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.6);
}

/* Smooth transitions for state changes */
.aether-3d-canvas {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Mobile optimizations for 3D */
@media (max-width: 768px) {
    .aether-bubble {
        width: 36px !important;
        height: 36px !important;
    }
    
    .aether-bubble-icon.aether-3d-mode {
        width: 36px;
        height: 36px;
    }
    
    .aether-3d-canvas {
        width: 36px;
        height: 36px;
    }
    
    .mascot-bubble-img {
        width: 22px !important;
        height: 22px !important;
    }
    
    .aether-bubble-badge {
        width: 16px !important;
        height: 16px !important;
        font-size: 9px !important;
        top: -2px !important;
        right: -2px !important;
    }
}

/* Confetti animation */
.aether-confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    pointer-events: none;
    animation: confettiFall 2s ease-out forwards;
    z-index: 10000;
}

@keyframes confettiFall {
    0% {
        top: 0;
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        top: 100vh;
        opacity: 0;
        transform: translateY(0) rotate(720deg);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .aether-window {
        width: calc(100vw - 32px);
        max-width: 340px;
        height: auto;
        max-height: 70vh;
        border-radius: 12px;
        position: fixed;
        bottom: 60px;
        right: 16px;
    }
    
    .aether-avatar-container.bottom-right,
    .aether-avatar-container.bottom-left {
        bottom: 12px;
        right: 12px;
    }
    
    .aether-bubble {
        width: 36px !important;
        height: 36px !important;
    }
    
    .aether-mascot.aether-bubble,
    .aether-bubble.aether-mascot-bubble {
        width: 36px !important;
        height: 36px !important;
    }
}

/* Very small screens (phones) */
@media (max-width: 480px) {
    .aether-bubble,
    .aether-mascot.aether-bubble,
    .aether-bubble.aether-mascot-bubble {
        width: 32px !important;
        height: 32px !important;
    }
    
    .mascot-bubble-img {
        width: 20px !important;
        height: 20px !important;
    }
    
    .aether-bubble-badge {
        width: 14px !important;
        height: 14px !important;
        font-size: 8px !important;
        top: -1px !important;
        right: -1px !important;
        border-width: 1px !important;
    }
    
    .aether-avatar-container.bottom-right,
    .aether-avatar-container.bottom-left {
        bottom: 8px;
        right: 8px;
    }
    
    .aether-window {
        width: calc(100vw - 16px);
        max-width: 100%;
        bottom: 50px;
        right: 8px;
        left: 8px;
        max-height: 60vh;
    }
}

/* Hide mascot during onboarding to prevent interference */
body.onboarding-active .aether-avatar-container {
    display: none !important;
}

/* Chat input section */
.aether-window-chat {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.aether-lottie-container {
    width: 100%;
    height: 120px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aether-chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.aether-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.aether-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.aether-chat-input:focus {
    outline: none;
    border-color: rgba(0, 212, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.aether-chat-send-btn {
    background: linear-gradient(135deg, #00d4ff 0%, #0088ff 100%);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.aether-chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 136, 255, 0.4);
}

.aether-chat-send-btn:active {
    transform: scale(0.95);
}

.aether-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* User message styling */
.aether-message-user {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.4);
    margin-left: 20%;
}

.aether-message-ai {
    background: rgba(0, 136, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.3);
}

.aether-message-error {
    background: rgba(255, 68, 68, 0.15);
    border-color: rgba(255, 68, 68, 0.4);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .aether-bubble,
    .aether-window,
    .aether-message,
    .aether-action-btn,
    .aether-orb-core,
    .aether-orb-glow,
    .aether-orb-pulse {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark mode support (already dark by default) */
@media (prefers-color-scheme: light) {
    /* Keep dark theme for consistency with Aether brand */
}

/* Mobile enhancements for chat input */
@media (max-width: 768px) {
    .aether-chat-input {
        font-size: 16px;
    }
    
    .aether-lottie-container {
        height: 100px;
    }
}

/* ============================================
   GAME CHARACTER ENHANCEMENTS
   ============================================ */

/* Sleeping state - dim and shrink */
.aether-orb-sleeping .aether-orb-core {
    animation: sleepingCore 4s ease-in-out infinite;
    opacity: 0.3;
}

.aether-orb-sleeping .aether-orb-glow {
    animation: sleepingGlow 4s ease-in-out infinite;
    opacity: 0.2;
}

.aether-orb-sleeping .aether-orb-pulse {
    animation: sleepingPulse 4s ease-in-out infinite;
    opacity: 0.1;
}

@keyframes sleepingCore {
    0%, 100% { transform: translate(-50%, -50%) scale(0.6); }
    50% { transform: translate(-50%, -50%) scale(0.7); }
}

@keyframes sleepingGlow {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

@keyframes sleepingPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.05; }
    50% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.1; }
}

/* Excited state - rapid pulsing with color shift */
.aether-orb-excited .aether-orb-core {
    background: radial-gradient(circle, #ffff00 0%, #00ffff 100%);
    animation: excitedCore 0.4s ease-in-out infinite;
}

.aether-orb-excited .aether-orb-glow {
    animation: excitedGlow 0.4s ease-in-out infinite;
}

.aether-orb-excited .aether-orb-pulse {
    animation: excitedPulse 0.4s ease-in-out infinite;
}

@keyframes excitedCore {
    0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    50% { transform: translate(-50%, -50%) scale(1.4) rotate(180deg); }
}

@keyframes excitedGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes excitedPulse {
    0% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

/* Trail particle effect */
.aether-trail-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.8) 0%, rgba(0, 136, 255, 0.4) 100%);
    pointer-events: none;
    z-index: 9998;
    animation: trailFade 1s ease-out forwards;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

@keyframes trailFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* Moveable character container */
.aether-avatar-container.character-mode {
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced orb with transform capability */
.aether-orb {
    transition: transform 0.3s ease;
}

/* Bounce effect for attention-seeking */
@keyframes attentionBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-20px) scale(1.1); }
    50% { transform: translateY(0) scale(1); }
    75% { transform: translateY(-10px) scale(1.05); }
}

.aether-orb-attention {
    animation: attentionBounce 1s ease-in-out;
}

/* Gesture animations */
@keyframes gestureWave {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-20deg) scale(1.1); }
    75% { transform: rotate(20deg) scale(1.1); }
}

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

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

/* Enhanced confetti */
.aether-confetti {
    animation: confettiFall 2s ease-out forwards, confettiSpin 2s linear infinite;
}

@keyframes confettiSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Voice indicator - pulses when speaking */
.aether-voice-indicator {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 4px;
    background: linear-gradient(90deg, #00ffff 0%, #00d4ff 100%);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.aether-orb-speaking .aether-voice-indicator {
    opacity: 1;
    animation: voicePulse 0.3s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { width: 20px; }
    50% { width: 40px; }
}

/* Movement smoothing */
.aether-avatar-container {
    will-change: left, top;
}

/* Performance optimization for animations */
.aether-orb-core,
.aether-orb-glow,
.aether-orb-pulse {
    will-change: transform, opacity;
}

/* Accessibility - respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .aether-trail-particle,
    .aether-confetti,
    .aether-orb-attention,
    .aether-voice-indicator {
        animation: none !important;
    }
    
    .aether-avatar-container.character-mode {
        transition: none !important;
    }
}

/* Voice Controls */
.aether-voice-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.aether-voice-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aether-voice-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: scale(1.05);
}

.aether-voice-dropdown {
    position: absolute;
    top: 40px;
    right: -50px;
    background: linear-gradient(135deg, rgba(10, 10, 30, 0.98) 0%, rgba(16, 21, 62, 0.98) 100%);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 12px;
    padding: 15px;
    z-index: 10000;
    min-width: 280px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.aether-voice-dropdown label {
    display: block;
    margin: 12px 0;
    color: #00ffff;
    font-size: 13px;
    font-weight: 500;
}

.aether-voice-dropdown input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #00ffff;
}

.aether-voice-dropdown select {
    width: 100%;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-top: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aether-voice-dropdown select:hover {
    background: rgba(0, 255, 255, 0.15);
    border-color: rgba(0, 255, 255, 0.5);
}

.aether-voice-dropdown select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.aether-voice-dropdown input[type="range"] {
    width: calc(100% - 60px);
    height: 4px;
    background: rgba(0, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    margin-top: 5px;
}

.aether-voice-dropdown input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #ffffff 0%, #00ffff 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.aether-voice-dropdown input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

.aether-voice-dropdown input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #ffffff 0%, #00ffff 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    border: none;
}

#voice-volume-display,
#voice-speed-display {
    display: inline-block;
    width: 45px;
    text-align: right;
    color: #88ccff;
    font-size: 11px;
    margin-left: 10px;
}

/* Speaking Indicator */
.aether-speaking-indicator {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aether-bubble.speaking .aether-speaking-indicator {
    opacity: 1;
}

.voice-bar {
    width: 3px;
    height: 12px;
    background: linear-gradient(to top, #00ffff 0%, #0088ff 100%);
    border-radius: 2px;
    animation: voice-pulse 0.6s ease-in-out infinite;
}

.voice-bar:nth-child(1) { animation-delay: 0s; }
.voice-bar:nth-child(2) { animation-delay: 0.1s; }
.voice-bar:nth-child(3) { animation-delay: 0.2s; }
.voice-bar:nth-child(4) { animation-delay: 0.3s; }

@keyframes voice-pulse {
    0%, 100% { 
        height: 8px; 
        opacity: 0.3;
        transform: scaleY(0.5);
    }
    50% { 
        height: 20px; 
        opacity: 1;
        transform: scaleY(1);
    }
}

/* Speaking state for orb */
.aether-orb.speaking .aether-orb-glow {
    animation: speaking-glow 0.4s ease-in-out infinite;
}

@keyframes speaking-glow {
    0%, 100% { 
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Mobile Voice Controls */
@media (max-width: 768px) {
    .aether-voice-dropdown {
        right: 10px;
        left: auto;
        min-width: 260px;
    }
}

/* ============================================
   AETHER MASCOT STYLES
   Ethereal flame entity with purple/blue/gold colors
   ============================================ */

/* Base Mascot Container */
.aether-mascot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: url('/static/aether-mascot.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    animation: mascotIdle 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

/* Mascot Size Variations */
.aether-mascot-tiny {
    width: 24px;
    height: 24px;
}

.aether-mascot-small {
    width: 32px;
    height: 32px;
}

/* Optimized bubble size for chat bubble */
.aether-mascot-bubble-size {
    width: 40px;
    height: 40px;
}

.aether-mascot-medium {
    width: 48px;
    height: 48px;
}

.aether-mascot-large {
    width: 64px;
    height: 64px;
}

.aether-mascot-hero {
    width: 200px;
    height: 200px;
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.6)) drop-shadow(0 0 60px rgba(59, 130, 246, 0.4));
}

/* Mascot Halo Effect (pseudo-element glow) */
.aether-mascot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, rgba(59, 130, 246, 0.2) 40%, transparent 70%);
    border-radius: 50%;
    animation: haloGlow 3s ease-in-out infinite;
    z-index: -1;
}

.aether-mascot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    animation: mascotPulseRing 3s ease-out infinite;
    z-index: -2;
}

/* Idle State - Gentle Pulse */
@keyframes mascotIdle {
    0%, 100% {
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5)) drop-shadow(0 0 20px rgba(59, 130, 246, 0.3));
    }
    50% {
        transform: scale(1.03) translateY(-2px);
        filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.6)) drop-shadow(0 0 30px rgba(59, 130, 246, 0.4));
    }
}

@keyframes haloGlow {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes mascotPulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Thinking State - Faster Pulse with color shift */
.aether-mascot-thinking {
    animation: mascotThinking 1.2s ease-in-out infinite;
}

.aether-mascot-thinking::before {
    animation: haloThinking 1.2s ease-in-out infinite;
}

.aether-mascot-thinking::after {
    animation: mascotPulseRing 1s ease-out infinite;
}

@keyframes mascotThinking {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.6)) drop-shadow(0 0 24px rgba(59, 130, 246, 0.4));
    }
    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.8)) drop-shadow(0 0 36px rgba(59, 130, 246, 0.6));
    }
}

@keyframes haloThinking {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* Speaking State - Intensified glow with rhythmic pulse */
.aether-mascot-speaking {
    animation: mascotSpeaking 0.6s ease-in-out infinite;
}

.aether-mascot-speaking::before {
    animation: haloSpeaking 0.6s ease-in-out infinite;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.4) 0%, rgba(139, 92, 246, 0.3) 40%, transparent 70%);
}

.aether-mascot-speaking::after {
    animation: mascotPulseRing 0.8s ease-out infinite;
    border-color: rgba(250, 204, 21, 0.4);
}

@keyframes mascotSpeaking {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(250, 204, 21, 0.6)) drop-shadow(0 0 30px rgba(139, 92, 246, 0.5));
    }
    50% {
        transform: scale(1.06);
        filter: drop-shadow(0 0 25px rgba(250, 204, 21, 0.8)) drop-shadow(0 0 50px rgba(139, 92, 246, 0.7));
    }
}

@keyframes haloSpeaking {
    0%, 100% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Celebrating State - Bounce with glow burst */
.aether-mascot-celebrating {
    animation: mascotCelebrating 0.5s ease-in-out infinite;
}

.aether-mascot-celebrating::before {
    animation: haloCelebrating 0.5s ease-in-out infinite;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.5) 0%, rgba(236, 72, 153, 0.4) 30%, rgba(139, 92, 246, 0.3) 60%, transparent 80%);
}

.aether-mascot-celebrating::after {
    animation: mascotCelebrateRing 0.6s ease-out infinite;
    border-color: rgba(250, 204, 21, 0.5);
}

@keyframes mascotCelebrating {
    0%, 100% {
        transform: scale(1) translateY(0) rotate(0deg);
        filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.7)) drop-shadow(0 0 40px rgba(139, 92, 246, 0.6));
    }
    25% {
        transform: scale(1.15) translateY(-8px) rotate(-5deg);
        filter: drop-shadow(0 0 30px rgba(250, 204, 21, 0.9)) drop-shadow(0 0 60px rgba(236, 72, 153, 0.7));
    }
    50% {
        transform: scale(1.1) translateY(-4px) rotate(0deg);
    }
    75% {
        transform: scale(1.15) translateY(-8px) rotate(5deg);
        filter: drop-shadow(0 0 30px rgba(250, 204, 21, 0.9)) drop-shadow(0 0 60px rgba(59, 130, 246, 0.7));
    }
}

@keyframes haloCelebrating {
    0%, 100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.4);
    }
}

@keyframes mascotCelebrateRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
        border-width: 3px;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
        border-width: 1px;
    }
}

/* Chat Bubble Mascot Variant */
.aether-bubble-mascot {
    width: 64px;
    height: 64px;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: visible;
}

.aether-bubble-mascot .aether-mascot {
    width: 100%;
    height: 100%;
}

.aether-bubble-mascot:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.6);
}

.aether-bubble-mascot.aether-bubble-pulse {
    animation: mascotBubblePulse 2s ease-in-out infinite;
}

@keyframes mascotBubblePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Mascot in Hero contexts */
.aether-mascot-hero-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.aether-mascot-hero-container .aether-mascot-hero::before {
    width: 130%;
    height: 130%;
}

.aether-mascot-hero-container .aether-mascot-hero::after {
    width: 160%;
    height: 160%;
}

/* Mascot with floating particles effect */
.aether-mascot-animated {
    position: relative;
}

.aether-mascot-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.8) 0%, rgba(139, 92, 246, 0.6) 100%);
    border-radius: 50%;
    pointer-events: none;
    animation: mascotParticleFloat 3s ease-in-out infinite;
}

.aether-mascot-particle:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.aether-mascot-particle:nth-child(2) { top: 80%; left: 15%; animation-delay: 0.5s; }
.aether-mascot-particle:nth-child(3) { top: 20%; right: 10%; animation-delay: 1s; }
.aether-mascot-particle:nth-child(4) { bottom: 15%; right: 20%; animation-delay: 1.5s; }

@keyframes mascotParticleFloat {
    0%, 100% {
        opacity: 0.4;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-10px) scale(1.5);
    }
}

/* Responsive Mascot Sizing */
@media (max-width: 768px) {
    .aether-mascot-hero {
        width: 140px;
        height: 140px;
    }
    
    .aether-bubble-mascot {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .aether-mascot-hero {
        width: 120px;
        height: 120px;
    }
}

/* Accessibility - respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .aether-mascot,
    .aether-mascot::before,
    .aether-mascot::after,
    .aether-mascot-thinking,
    .aether-mascot-speaking,
    .aether-mascot-celebrating,
    .aether-mascot-particle,
    .aether-bubble-mascot {
        animation: none !important;
    }
}
