/* {{RIPER-5:
  Action: "Added"
  Task_ID: "Animations-System"
  Timestamp: "2025-10-31"
  Authoring_Role: "LD"
  Principle_Applied: "Aether-Design-Fluid-Animations"
  Quality_Check: "Physics-based easing curves, smooth 60fps animations"
}} */

/* ====================================
   ENTRANCE ANIMATIONS
   ==================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ====================================
   CONTINUOUS ANIMATIONS
   ==================================== */

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.4),
                    0 0 40px rgba(102, 126, 234, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.6),
                    0 0 60px rgba(102, 126, 234, 0.4);
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* ====================================
   PARTICLE ANIMATIONS
   ==================================== */

@keyframes particle1 {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(100px, -100px) scale(0);
        opacity: 0;
    }
}

@keyframes particle2 {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(-80px, -120px) scale(0);
        opacity: 0;
    }
}

@keyframes particle3 {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(60px, -140px) scale(0);
        opacity: 0;
    }
}

/* ====================================
   UTILITY ANIMATION CLASSES
   ==================================== */

.animate-fade-in {
    animation: fadeIn 0.6s var(--easing-smooth) forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s var(--easing-smooth) forwards;
}

.animate-fade-in-scale {
    animation: fadeInScale 0.5s var(--easing-bounce) forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s var(--easing-smooth) forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s var(--easing-smooth) forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-shimmer {
    animation: shimmer 2s linear infinite;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* ====================================
   STAGGER ANIMATIONS
   ==================================== */

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }

/* ====================================
   VIEW TRANSITIONS
   ==================================== */

.view {
    animation: fadeIn 0.5s var(--easing-smooth);
}

.view-exit {
    animation: fadeOut 0.3s var(--easing-smooth) forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ====================================
   LOADING ANIMATIONS
   ==================================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-accent-blue);
    border-radius: var(--radius-full);
    animation: rotate 1s linear infinite;
}

.dots-loading {
    display: flex;
    gap: 8px;
}

.dots-loading span {
    width: 8px;
    height: 8px;
    background: var(--color-accent-blue);
    border-radius: var(--radius-full);
    animation: bounce 1.4s infinite ease-in-out both;
}

.dots-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.dots-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ====================================
   SUCCESS CELEBRATION ANIMATION
   ==================================== */

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(1000px) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--color-accent-pink);
    animation: confetti 3s ease-out forwards;
    z-index: var(--z-modal);
}

/* ====================================
   PROGRESS RING ANIMATION
   ==================================== */

@keyframes progressRing {
    0% {
        stroke-dashoffset: 283;
    }
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.8s var(--easing-smooth);
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

/* ====================================
   HOVER EFFECTS WITH ANIMATIONS
   ==================================== */

.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5),
                0 0 40px rgba(102, 126, 234, 0.3);
}

/* ====================================
   TYPEWRITER EFFECT
   ==================================== */

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--color-accent-blue);
    white-space: nowrap;
    animation: 
        typewriter 3s steps(40) 1s forwards,
        blink 0.75s step-end infinite;
}

/* ====================================
   SCROLL-TRIGGERED ANIMATIONS
   ==================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--easing-smooth),
                transform 0.8s var(--easing-smooth);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s var(--easing-smooth),
                transform 0.8s var(--easing-smooth);
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s var(--easing-smooth),
                transform 0.8s var(--easing-smooth);
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ====================================
   PERFORMANCE OPTIMIZATION
   ==================================== */

@media (prefers-reduced-motion: reduce) {
    .animate-fade-in,
    .animate-fade-in-up,
    .animate-fade-in-scale,
    .animate-slide-in-right,
    .animate-slide-in-left,
    .animate-float,
    .animate-shimmer,
    .animate-glow,
    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* GPU acceleration for better performance */
.gpu-accelerate {
    transform: translateZ(0);
    will-change: transform, opacity;
}

