/**
 * Premium Micro-Animations & Flourishes
 * Accessible animations that respect user preferences
 */

/* 1. KEYFRAME ANIMATIONS */

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

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

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

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

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

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 201, 43, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 201, 43, 0);
    }
}

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

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

/* 2. ANIMATION CLASSES */

.fade-in {
    animation: fade-in 0.8s ease forwards;
}

.slide-in-left {
    animation: slide-in-left 0.8s ease forwards;
}

.slide-in-right {
    animation: slide-in-right 0.8s ease forwards;
}

.slide-in-up {
    animation: slide-in-up 0.8s ease forwards;
}

.scale-in {
    animation: scale-in 0.6s ease forwards;
}

/* 3. HOVER EFFECTS */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.3);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 201, 43, 0.4);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

/* 4. BUTTON FLOURISHES */

.btn-press:active {
    transform: scale(0.98);
}

.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-shine:hover::before {
    left: 100%;
}

/* 5. LOADING STATES */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 25%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.pulse {
    animation: pulse-glow 2s infinite;
}

/* 6. FOCUS STYLES */

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 201, 43, 0.5);
}

.focus-glow:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 201, 43, 0.3),
                0 0 20px rgba(255, 201, 43, 0.2);
}

/* 7. TEXT EFFECTS */

.text-gradient {
    background: linear-gradient(135deg, #FFC92B 0%, #FFE066 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-glow {
    text-shadow: 0 0 20px rgba(255, 201, 43, 0.3);
}

/* 8. BORDER ANIMATIONS */

.border-draw {
    position: relative;
}

.border-draw::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #FFC92B;
    transition: width 0.3s ease;
}

.border-draw:hover::after {
    width: 100%;
}

/* 9. CARD EFFECTS */

.card-tilt {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.card-tilt:hover {
    transform: perspective(1000px) rotateY(2deg);
}

/* 10. ACCESSIBILITY - Respect reduced motion */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hover-lift:hover {
        transform: none;
    }

    .hover-scale:hover {
        transform: none;
    }

    .card-tilt:hover {
        transform: none;
    }
}

/* 11. SMOOTH TRANSITIONS */

.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-bounce {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 12. STAGGER DELAYS (for use with JavaScript) */

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* 13. FLOATING ELEMENTS */

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

/* 14. REVEAL ON SCROLL (initial state) */

.animate-on-scroll {
    opacity: 0;
}

.animate-on-scroll.fade-in {
    opacity: 1;
}
