/* Foxy 3D Vector Avatar Styling and Keyframe Animations */

.foxy-stage-wrapper {
    position: relative;
    width: 154px;
    height: 154px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.foxy-stage-wrapper:hover {
    transform: scale(1.05);
}

.foxy-svg-container {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 18px rgba(230, 126, 34, 0.30));
    transition: transform 0.25s ease-in-out;
}

/* Floating Status Indicator Badge */
.foxy-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid #fbc531;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: #e67e22;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    transition: all 0.25s ease;
}

/* ========================================================
   EXPRESSION STATES & VECTOR ANIMATIONS
   ======================================================== */

/* 1. IDLE / HAPPY */
.state-idle .foxy-svg-container {
    animation: foxy-idle-breathe 3s infinite ease-in-out;
}
.state-idle .foxy-mouth-open,
.state-idle .foxy-mouth-o,
.state-idle .foxy-eyes-closed {
    display: none;
}
.state-idle .foxy-badge {
    border-color: #fbc531;
    color: #f39c12;
}

/* 2. SLEEPING */
.state-sleeping .foxy-svg-container {
    animation: foxy-sleep-breathe 4s infinite ease-in-out;
    transform: rotate(-3deg);
    opacity: 0.92;
}
.state-sleeping .foxy-eyes-open,
.state-sleeping .foxy-mouth-open,
.state-sleeping .foxy-mouth-o {
    display: none;
}
.state-sleeping .foxy-eyes-closed {
    display: block;
}
.state-sleeping .foxy-badge {
    border-color: #74b9ff;
    color: #0984e3;
    animation: foxy-badge-drift 2.5s infinite ease-in-out;
}

/* 3. LISTENING */
.state-listening .foxy-svg-container {
    animation: foxy-perk-ears 1.6s infinite ease-in-out;
    transform: scale(1.05);
}
.state-listening .foxy-ear-left {
    transform-origin: 30px 45px;
    animation: foxy-ear-wiggle 1.2s infinite ease-in-out;
}
.state-listening .foxy-mouth-open,
.state-listening .foxy-mouth-o,
.state-listening .foxy-eyes-closed {
    display: none;
}
.state-listening .foxy-badge {
    border-color: #2ed573;
    color: #2ed573;
    background: #e8f8f0;
    animation: foxy-badge-pulse 1s infinite alternate;
}

/* 4. SEARCHING */
.state-searching .foxy-svg-container {
    animation: foxy-scan-head 1.4s infinite alternate ease-in-out;
}
.state-searching .foxy-mouth-open,
.state-searching .foxy-eyes-closed {
    display: none;
}
.state-searching .foxy-mouth-o {
    display: block;
}
.state-searching .foxy-mouth-smile {
    display: none;
}
.state-searching .foxy-badge {
    border-color: #00cec9;
    color: #00cec9;
    background: #e0fbfb;
    animation: foxy-badge-spin 2s linear infinite;
}

/* 5. THINKING */
.state-thinking .foxy-svg-container {
    animation: foxy-think-tilt 2.2s infinite ease-in-out;
}
.state-thinking .foxy-mouth-open,
.state-thinking .foxy-mouth-o,
.state-thinking .foxy-eyes-closed {
    display: none;
}
.state-thinking .foxy-eyes-open {
    transform: translateY(-2px);
}
.state-thinking .foxy-badge {
    border-color: #f39c12;
    color: #e67e22;
    background: #fff8e7;
    animation: foxy-badge-drift 1.8s infinite ease-in-out;
}

/* 6. TALKING */
.state-talking .foxy-svg-container {
    animation: foxy-talk-bounce 0.4s infinite alternate ease-in-out;
}
.state-talking .foxy-eyes-closed,
.state-talking .foxy-mouth-smile {
    display: none;
}
.state-talking .foxy-mouth-open {
    display: block;
    animation: foxy-mouth-flap 0.25s infinite alternate ease-in-out;
    transform-origin: 60px 85px;
}
.state-talking .foxy-badge {
    border-color: #ff6b6b;
    color: #ee5253;
    background: #fff0f0;
    animation: foxy-badge-pulse 0.35s infinite alternate;
}

/* 7. CONFUSED */
.state-confused .foxy-svg-container {
    animation: foxy-wobble 0.7s infinite alternate ease-in-out;
}
.state-confused .foxy-mouth-open,
.state-confused .foxy-eyes-closed {
    display: none;
}
.state-confused .foxy-mouth-o {
    display: block;
}
.state-confused .foxy-mouth-smile {
    display: none;
}
.state-confused .foxy-ear-right {
    transform-origin: 90px 45px;
    transform: rotate(12deg);
}
.state-confused .foxy-badge {
    border-color: #e74c3c;
    color: #c0392b;
    background: #fdeaea;
}

/* ========================================================
   KEYFRAME ANIMATIONS
   ======================================================== */
@keyframes foxy-idle-breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.02); }
}

@keyframes foxy-sleep-breathe {
    0%, 100% { transform: translateY(0) scale(1) rotate(-3deg); }
    50% { transform: translateY(-4px) scale(1.03) rotate(-1deg); }
}

@keyframes foxy-perk-ears {
    0%, 80%, 100% { transform: scale(1.05) translateY(0); }
    88% { transform: scale(1.08) translateY(-4px); }
    94% { transform: scale(1.06) translateY(-2px); }
}

@keyframes foxy-ear-wiggle {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-5deg); }
}

@keyframes foxy-scan-head {
    0% { transform: translateX(-5px) rotate(-3deg); }
    100% { transform: translateX(5px) rotate(3deg); }
}

@keyframes foxy-think-tilt {
    0%, 100% { transform: rotate(-6deg) translateY(0); }
    50% { transform: rotate(-10deg) translateY(-3px); }
}

@keyframes foxy-talk-bounce {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-5px) scale(1.04); }
}

@keyframes foxy-mouth-flap {
    0% { transform: scaleY(0.6); }
    100% { transform: scaleY(1.2); }
}

@keyframes foxy-wobble {
    0% { transform: rotate(-8deg) scale(0.96); }
    100% { transform: rotate(8deg) scale(1.03); }
}

@keyframes foxy-badge-drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes foxy-badge-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

@keyframes foxy-badge-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

