/**
 * Reggae Kenya Animations
 * 
 * Keyframe animations and transition effects
 *
 * @package ReggaeKenya
 * @version 1.0.0
 */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   SCALE ANIMATIONS
   ============================================ */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

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

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.05);
    }
}

/* ============================================
   ROTATION ANIMATIONS
   ============================================ */

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

@keyframes rotate3d {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

/* ============================================
   BOUNCE ANIMATIONS
   ============================================ */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* ============================================
   RASTA-SPECIFIC ANIMATIONS
   ============================================ */

@keyframes rastaWave {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes rastaGlow {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(232, 0, 13, 0.3),
            0 0 20px rgba(252, 209, 22, 0.3),
            0 0 30px rgba(7, 137, 48, 0.3);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(232, 0, 13, 0.6),
            0 0 30px rgba(252, 209, 22, 0.6),
            0 0 40px rgba(7, 137, 48, 0.6);
    }
}

@keyframes rastaPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes rastaShimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ============================================
   SHAKE & WIGGLE
   ============================================ */

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

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

/* ============================================
   FLIP ANIMATIONS
   ============================================ */

@keyframes flipInX {
    from {
        transform: perspective(1000px) rotateX(-90deg);
        opacity: 0;
    }
    to {
        transform: perspective(1000px) rotateX(0);
        opacity: 1;
    }
}

@keyframes flipInY {
    from {
        transform: perspective(1000px) rotateY(-90deg);
        opacity: 0;
    }
    to {
        transform: perspective(1000px) rotateY(0);
        opacity: 1;
    }
}

/* ============================================
   GLOW ANIMATIONS
   ============================================ */

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(252, 209, 22, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(252, 209, 22, 1);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(252, 209, 22, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(252, 209, 22, 1);
    }
}

/* ============================================
   MUSIC-SPECIFIC ANIMATIONS
   ============================================ */

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

@keyframes equalizer {
    0%, 100% {
        height: 20%;
    }
    50% {
        height: 100%;
    }
}

@keyframes waveform {
    0%, 100% {
        transform: scaleY(0.5);
    }
    50% {
        transform: scaleY(1);
    }
}

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

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.4s ease-out;
}

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

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

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

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-wiggle {
    animation: wiggle 0.5s ease-in-out;
}

.animate-glow {
    animation: glowPulse 2s ease-in-out infinite;
}

.animate-rastaGlow {
    animation: rastaGlow 3s ease-in-out infinite;
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

.rk-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--dark-border);
    border-top-color: var(--rasta-gold);
    border-radius: 50%;
    animation: rk-spin 0.8s linear infinite;
}

.rk-spinner-rasta {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid transparent;
    border-image: var(--rasta-gradient) 1;
    border-radius: 50%;
    animation: rk-spin 1s linear infinite;
}

.rk-dots-loader {
    display: inline-flex;
    gap: var(--space-2);
}

.rk-dots-loader span {
    width: 8px;
    height: 8px;
    background: var(--rasta-gold);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.rk-dots-loader span:nth-child(1) {
    animation-delay: 0s;
}

.rk-dots-loader span:nth-child(2) {
    animation-delay: 0.2s;
}

.rk-dots-loader span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.rk-skeleton {
    background: linear-gradient(
        90deg,
        var(--dark-layer-2) 0%,
        var(--dark-layer-3) 50%,
        var(--dark-layer-2) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.hover-lift {
    transition: transform var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: var(--glow-gold);
}

.hover-scale {
    transition: transform var(--transition-normal);
}

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

.hover-rotate {
    transition: transform var(--transition-normal);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s ease-out;
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s ease-out;
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   PARALLAX EFFECTS
   ============================================ */

.parallax-slow {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.parallax-medium {
    will-change: transform;
    transition: transform 0.2s ease-out;
}

.parallax-fast {
    will-change: transform;
    transition: transform 0.3s ease-out;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

.smooth-scroll {
    scroll-behavior: smooth;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
