/*
© 2025 Sharon Aicler (saichler@gmail.com)

Layer 8 Ecosystem is licensed under the Apache License, Version 2.0.
You may obtain a copy of the License at:

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
 * Layer 8 Shared Animations
 * Consolidated keyframe animations for consistent behavior
 */

/* ============================================ */
/* SPIN ANIMATION (loading spinners) */
/* ============================================ */

@keyframes l8-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alias for backwards compatibility */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================ */
/* FADE IN ANIMATIONS */
/* ============================================ */

@keyframes l8-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes l8-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes l8-fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alias for backwards compatibility */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes l8-slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes l8-slide-out-right {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes l8-slide-in-left {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Alias for backwards compatibility */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ============================================ */
/* MODAL/POPUP ANIMATIONS */
/* ============================================ */

@keyframes l8-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes l8-modal-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Alias for backwards compatibility */
@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================ */
/* SHAKE ANIMATION (error feedback) */
/* ============================================ */

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

/* Alias for backwards compatibility */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================ */
/* PULSE ANIMATION (attention/heartbeat) */
/* ============================================ */

@keyframes l8-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes l8-pulse-scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================ */
/* BOUNCE ANIMATION */
/* ============================================ */

@keyframes l8-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* ============================================ */
/* ANIMATION UTILITY CLASSES */
/* ============================================ */

.layer8d-animate-spin {
    animation: l8-spin 1s linear infinite;
}

.layer8d-animate-fade-in {
    animation: l8-fade-in 0.2s ease-out;
}

.layer8d-animate-fade-in-up {
    animation: l8-fade-in-up 0.3s ease-out;
}

.layer8d-animate-slide-in {
    animation: l8-slide-in-right 0.3s ease-out;
}

.layer8d-animate-shake {
    animation: l8-shake 0.4s ease-in-out;
}

.layer8d-animate-pulse {
    animation: l8-pulse 2s ease-in-out infinite;
}
