/* ==========================================================================
   Chibi Animations - Core Styles & Keyframe Animations
   ========================================================================== */

/* Main Container Base Styles */
.cee-chibi-container {
    width: var(--cee-size, 180px);
    display: inline-block;
    vertical-align: middle;
    position: relative;
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0;
    line-height: 0;
    pointer-events: auto;
    user-select: none;
    -webkit-user-drag: none;
    
    /* Smooth transition for entry/exit and hover transitions */
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.3s ease;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12));
}

.cee-chibi-container:hover {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.22));
}

/* Image Element - Always transparent background */
.cee-chibi-image {
    width: 100%;
    height: auto;
    display: block;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Position Modes */
.cee-pos-inline {
    position: relative;
    z-index: 1;
}

.cee-pos-bottom-right {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--cee-z-index, 9999);
}

.cee-pos-bottom-left {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: var(--cee-z-index, 9999);
}

.cee-pos-top-right {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: var(--cee-z-index, 9999);
}

.cee-pos-top-left {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: var(--cee-z-index, 9999);
}

/* State Transitions (Entry/Exit) */
.cee-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}
.cee-pos-bottom-right.cee-hidden { transform: translate(40px, 40px) scale(0.7) rotate(10deg); }
.cee-pos-bottom-left.cee-hidden  { transform: translate(-40px, 40px) scale(0.7) rotate(-10deg); }
.cee-pos-top-right.cee-hidden    { transform: translate(40px, -40px) scale(0.7) rotate(-10deg); }
.cee-pos-top-left.cee-hidden     { transform: translate(-40px, -40px) scale(0.7) rotate(10deg); }
.cee-pos-inline.cee-hidden       { transform: translateY(30px) scale(0.8); }

.cee-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}
.cee-pos-bottom-right.cee-visible,
.cee-pos-bottom-left.cee-visible,
.cee-pos-top-right.cee-visible,
.cee-pos-top-left.cee-visible,
.cee-pos-inline.cee-visible {
    transform: translate(0, 0) scale(1) rotate(0deg);
}


/* ==========================================================================
   Idle Animations (Breathing / Bobbing)
   ========================================================================== */

/* 1. Breathing (Height/Width Scaling Loop) */
.cee-idle-breathing:not(.cee-interacting) {
    animation: cee-breath 3.5s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes cee-breath {
    0%, 100% {
        transform: scaleY(1) scaleX(1);
    }
    50% {
        transform: scaleY(1.035) scaleX(0.975);
    }
}

/* 2. Floating Bob (Vertical Float Loop) */
.cee-idle-bobbing:not(.cee-interacting) {
    animation: cee-bob 4s ease-in-out infinite;
}

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


/* ==========================================================================
   Hover Micro-Effects (Wiggle / Bounce / Scale / Shake)
   ========================================================================== */

.cee-chibi-container.cee-interacting {
    animation-play-state: paused !important;
}

/* 1. Playful Wiggle */
.cee-hover-wiggle:hover,
.cee-hover-wiggle.cee-interacting {
    animation: cee-wiggle 0.6s ease-in-out infinite alternate;
    transform-origin: bottom center;
}

@keyframes cee-wiggle {
    0% {
        transform: rotate(-6deg) scale(1.02);
    }
    100% {
        transform: rotate(6deg) scale(1.02);
    }
}

/* 2. Jump Bounce (Vertical Squash & Stretch) */
.cee-hover-bounce:hover,
.cee-hover-bounce.cee-interacting {
    animation: cee-bounce 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    transform-origin: bottom center;
}

@keyframes cee-bounce {
    0%, 100% {
        transform: translateY(0) scaleY(1) scaleX(1);
    }
    30% {
        transform: translateY(-20px) scaleY(1.1) scaleX(0.9);
    }
    60% {
        transform: translateY(0) scaleY(0.85) scaleX(1.15);
    }
    80% {
        transform: translateY(-4px) scaleY(1.03) scaleX(0.97);
    }
}

/* 3. Spring Scale Up */
.cee-hover-scale:hover,
.cee-hover-scale.cee-interacting {
    transform: scale(1.12) translateY(-5px) rotate(2deg);
}

/* 4. Active Shake */
.cee-hover-shake:hover,
.cee-hover-shake.cee-interacting {
    animation: cee-shake 0.15s linear infinite;
}

@keyframes cee-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px) rotate(-1deg); }
    75% { transform: translateX(4px) rotate(1deg); }
}


/* ==========================================================================
   Micro-Animations Effects & Particle Spawners (CSS Classes)
   ========================================================================== */

/* Effects Overlay Container */
.cee-effects-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 10;
}

/* 1. Camera Flash Lens Shutter Overlay */
.cee-shutter-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    opacity: 0;
    z-index: 999999;
    pointer-events: none;
    animation: cee-flash-anim 0.35s ease-out;
}

@keyframes cee-flash-anim {
    0% { opacity: 0.95; }
    100% { opacity: 0; }
}

/* Camera Lens Radial Sparkle */
.cee-lens-sparkle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,248,198,0.85) 40%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    transform: scale(0);
    box-shadow: 0 0 10px #fff7b5, 0 0 20px #ffea75;
    animation: cee-sparkle-anim 0.5s ease-out forwards;
}

@keyframes cee-sparkle-anim {
    0% { transform: translate(-50%, -50%) scale(0.2) rotate(0deg); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.8) rotate(90deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.5) rotate(180deg); opacity: 0; }
}

/* 2. Laptop Keycap/Coding Particles */
.cee-code-particle {
    position: absolute;
    color: #4ef582;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 14px;
    opacity: 1;
    pointer-events: none;
    text-shadow: 0 0 4px rgba(78, 245, 130, 0.7);
    animation: cee-float-code 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes cee-float-code {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0.9;
    }
    100% {
        transform: translate(var(--dx, 20px), var(--dy, -60px)) scale(1.2) rotate(var(--rot, 15deg));
        opacity: 0;
    }
}

/* 3. Paintbrush Splash Blobs (SVG Path Splashes) */
.cee-paint-splash {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    opacity: 0.95;
    pointer-events: none;
    transform: scale(0);
    animation: cee-paint-blob-anim 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cee-paint-blob-anim {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.95;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        transform: translate(var(--dx, 40px), var(--dy, -40px)) scale(var(--scale, 1.5));
        opacity: 0;
    }
}

/* 4. Standing 2 Crying Teardrops */
.cee-teardrop {
    position: absolute;
    width: 6px;
    height: 10px;
    background: #50b3ff;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 0 5px rgba(80, 179, 255, 0.6);
    opacity: 0.85;
    pointer-events: none;
    animation: cee-cry-fall 0.9s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes cee-cry-fall {
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0.9;
    }
    100% {
        transform: translate(var(--dx, -15px), var(--dy, 80px)) scale(1.2);
        opacity: 0;
    }
}
