/* MAZALPLUS Animation Styles */

/* ============================================
   Keyframe Animations
   ============================================ */

/* Hero Section Background Animation */
@keyframes heroFloat {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    33% {
        transform: translate(-48%, -52%) rotate(120deg);
    }
    66% {
        transform: translate(-52%, -48%) rotate(240deg);
    }
}

/* Loading Spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down Animation */
@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right Animation */
@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Down Animation */
@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

/* Slide Up Animation */
@keyframes slideUp {
    0% {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
}

/* Modal Slide In Animation */
@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Filter Slide Down Animation */
@keyframes filterSlideDown {
    0% {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        max-height: 300px;
        transform: translateY(0);
    }
}

/* Shimmer Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Rotate Animation */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Wiggle Animation */
@keyframes wiggle {
    0%, 7% {
        transform: rotateZ(0);
    }
    15% {
        transform: rotateZ(-15deg);
    }
    20% {
        transform: rotateZ(10deg);
    }
    25% {
        transform: rotateZ(-10deg);
    }
    30% {
        transform: rotateZ(6deg);
    }
    35% {
        transform: rotateZ(-4deg);
    }
    40%, 100% {
        transform: rotateZ(0);
    }
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(79, 70, 229, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.6);
    }
}

/* Typewriter Animation */
@keyframes typewriter {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

/* Blink Animation */
@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* ============================================
   Animation Classes
   ============================================ */

/* Fade Animations */
.fadeIn {
    animation: fadeIn 0.6s ease-out;
}

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

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

.fadeInLeft {
    animation: fadeInLeft 0.6s ease-out;
}

.fadeInRight {
    animation: fadeInRight 0.6s ease-out;
}

/* Scale Animations */
.scaleIn {
    animation: scaleIn 0.4s ease-out;
}

.scaleInDelayed {
    animation: scaleIn 0.6s ease-out 0.2s both;
}

/* Bounce Animations */
.bounce {
    animation: bounce 1s infinite;
}

.bounceIn {
    animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Pulse Animations */
.pulse {
    animation: pulse 2s infinite;
}

.pulseOnce {
    animation: pulse 0.6s ease-out;
}

/* Rotation Animations */
.rotate {
    animation: rotate 2s linear infinite;
}

.rotateOnHover:hover {
    animation: rotate 1s ease-in-out;
}

/* Wiggle Animation */
.wiggle {
    animation: wiggle 1s ease-in-out;
}

.wiggleOnHover:hover {
    animation: wiggle 0.6s ease-in-out;
}

/* Glow Animation */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.glowOnHover:hover {
    animation: glow 1s ease-in-out;
}

/* Gradient Animation */
.gradientShift {
    background: linear-gradient(45deg, var(--colorPrimary), var(--colorSecondary), var(--colorAccent));
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

/* Shimmer Loading */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--colorPrimary);
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink 0.75s step-end infinite;
}

/* ============================================
   Staggered Animations
   ============================================ */
.staggeredFadeIn > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.staggeredFadeIn > *:nth-child(1) { animation-delay: 0.1s; }
.staggeredFadeIn > *:nth-child(2) { animation-delay: 0.2s; }
.staggeredFadeIn > *:nth-child(3) { animation-delay: 0.3s; }
.staggeredFadeIn > *:nth-child(4) { animation-delay: 0.4s; }
.staggeredFadeIn > *:nth-child(5) { animation-delay: 0.5s; }
.staggeredFadeIn > *:nth-child(6) { animation-delay: 0.6s; }
.staggeredFadeIn > *:nth-child(7) { animation-delay: 0.7s; }
.staggeredFadeIn > *:nth-child(8) { animation-delay: 0.8s; }
.staggeredFadeIn > *:nth-child(9) { animation-delay: 0.9s; }
.staggeredFadeIn > *:nth-child(10) { animation-delay: 1.0s; }

/* ============================================
   Hover Effects
   ============================================ */
.hoverLift {
    transition: transform var(--transitionBase), box-shadow var(--transitionBase);
}

.hoverLift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadowLg);
}

.hoverLiftStrong {
    transition: transform var(--transitionBase), box-shadow var(--transitionBase);
}

.hoverLiftStrong:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadowXl);
}

.hoverScale {
    transition: transform var(--transitionBase);
}

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

.hoverScaleStrong {
    transition: transform var(--transitionBase);
}

.hoverScaleStrong:hover {
    transform: scale(1.1);
}

.hoverRotate {
    transition: transform var(--transitionBase);
}

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

.hoverTilt {
    transition: transform var(--transitionBase);
}

.hoverTilt:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
}

.hoverGlow {
    transition: box-shadow var(--transitionBase);
}

.hoverGlow:hover {
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
}

.hoverBounce {
    transition: transform var(--transitionBase);
}

.hoverBounce:hover {
    animation: bounce 0.6s ease-in-out;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--colorPrimary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loadingDots {
    position: relative;
}

.loadingDots::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--colorPrimary);
    animation: loadingDots 1.4s infinite ease-in-out;
}

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: translateY(-50%) scale(0);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radiusBase);
}

.skeletonText {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeletonText:last-child {
    margin-bottom: 0;
}

.skeletonTitle {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

.skeletonAvatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.skeletonButton {
    height: 40px;
    width: 120px;
    border-radius: var(--radiusBase);
}

/* ============================================
   Micro Interactions
   ============================================ */
.clickEffect {
    position: relative;
    overflow: hidden;
}

.clickEffect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.clickEffect:active::before {
    width: 300px;
    height: 300px;
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    animation: rippleEffect 0.6s linear;
}

@keyframes rippleEffect {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* ============================================
   Entrance Animations
   ============================================ */
.entranceAnimation {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.entranceAnimation.visible {
    opacity: 1;
    transform: translateY(0);
}

.entranceFromLeft {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease-out;
}

.entranceFromLeft.visible {
    opacity: 1;
    transform: translateX(0);
}

.entranceFromRight {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease-out;
}

.entranceFromRight.visible {
    opacity: 1;
    transform: translateX(0);
}

.entranceScale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease-out;
}

.entranceScale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   Page Transitions
   ============================================ */
.pageTransition {
    opacity: 0;
    transform: translateY(20px);
    animation: pageEnter 0.6s ease-out forwards;
}

@keyframes pageEnter {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.pageExit {
    animation: pageLeave 0.4s ease-in forwards;
}

@keyframes pageLeave {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ============================================
   Toast Notifications
   ============================================ */
.toastEnter {
    animation: toastSlideIn 0.3s ease-out;
}

.toastExit {
    animation: toastSlideOut 0.3s ease-in;
}

@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================
   Floating Elements
   ============================================ */
.floatingElement {
    animation: float 3s ease-in-out infinite;
}

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

.floatingDelayed {
    animation: float 3s ease-in-out infinite 1s;
}

/* ============================================
   Attention Seekers
   ============================================ */
.shake {
    animation: shake 0.5s ease-in-out;
}

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

.flash {
    animation: flash 1s ease-in-out;
}

@keyframes flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

/* ============================================
   Responsive Animations
   ============================================ */
@media (max-width: 768px) {
    /* Reduce animation intensity on mobile */
    .hoverLift:hover,
    .hoverLiftStrong:hover {
        transform: translateY(-2px);
    }
    
    .hoverScale:hover {
        transform: scale(1.02);
    }
    
    .hoverScaleStrong:hover {
        transform: scale(1.05);
    }
    
    /* Disable some animations on mobile for performance */
    .gradientShift {
        animation: none;
        background: var(--colorPrimary);
    }
    
    .floatingElement,
    .floatingDelayed {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Respect user's motion preferences */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .heroSection::before {
        animation: none;
    }
    
    .gradientShift {
        animation: none;
        background: var(--colorPrimary);
    }
    
    .shimmer {
        animation: none;
        background: #f0f0f0;
    }
}

/* ============================================
   Animation Utilities
   ============================================ */
.animationPaused {
    animation-play-state: paused;
}

.animationFast {
    animation-duration: 0.3s;
}

.animationSlow {
    animation-duration: 1s;
}

.animationDelay-1 {
    animation-delay: 0.1s;
}

.animationDelay-2 {
    animation-delay: 0.2s;
}

.animationDelay-3 {
    animation-delay: 0.3s;
}

.animationDelay-4 {
    animation-delay: 0.4s;
}

.animationDelay-5 {
    animation-delay: 0.5s;
}

.animationInfinite {
    animation-iteration-count: infinite;
}

.animationOnce {
    animation-iteration-count: 1;
}

.animationFillBoth {
    animation-fill-mode: both;
}

.animationFillForwards {
    animation-fill-mode: forwards;
}

.animationFillBackwards {
    animation-fill-mode: backwards;
}