/**
 * Optimized Animations using CSS Transforms
 * Using transform instead of position/margin for better performance
 */

/* Smooth transitions - Hardware accelerated */
.sk-transition-smooth {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

/* Hover Effects - Using transform instead of margin */
.sk-card-hover,
.sk-school-card,
.sk-btn-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.sk-card-hover:hover,
.sk-school-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Button hover with scale */
.sk-btn-hover:hover {
    transform: scale(1.05);
}

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

/* Fade In animations */
@keyframes sk-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

/* Animation Classes */
.sk-animate-fade-in-up {
    animation: sk-fade-in-up 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sk-animate-fade-in-down {
    animation: sk-fade-in-down 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sk-animate-fade-in-left {
    animation: sk-fade-in-left 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sk-animate-fade-in-right {
    animation: sk-fade-in-right 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sk-animate-scale-in {
    animation: sk-scale-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stagger Animation Delays */
.sk-animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.sk-animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.sk-animate-delay-3 { animation-delay: 0.3s; opacity: 0; }
.sk-animate-delay-4 { animation-delay: 0.4s; opacity: 0; }
.sk-animate-delay-5 { animation-delay: 0.5s; opacity: 0; }

/* Loading Spinner - Using rotate transform */
@keyframes sk-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.sk-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sk-spin 0.8s linear infinite;
    will-change: transform;
}

.sk-spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.sk-spinner-primary {
    border-color: rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
}

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

.sk-animate-pulse {
    animation: sk-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

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

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

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

/* Slide Animations for Modals */
@keyframes sk-slide-in-bottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes sk-slide-out-bottom {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

.sk-modal-enter {
    animation: sk-slide-in-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sk-modal-exit {
    animation: sk-slide-out-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Backdrop Fade */
@keyframes sk-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.sk-backdrop-enter {
    animation: sk-fade-in 0.3s ease;
}

.sk-backdrop-exit {
    animation: sk-fade-out 0.3s ease;
}

/* Number Counter Animation */
@keyframes sk-count-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.sk-counter {
    animation: sk-count-up 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progress Bar Animation */
@keyframes sk-progress {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
    }
}

.sk-progress-bar {
    animation: sk-progress 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon Animations */
.sk-icon-hover {
    transition: transform 0.3s ease;
}

.sk-icon-hover:hover {
    transform: scale(1.2) rotate(5deg);
}

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

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

/* Ripple Effect */
@keyframes sk-ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

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

.sk-ripple::after {
    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;
}

.sk-ripple:active::after {
    width: 300px;
    height: 300px;
    animation: sk-ripple 0.6s ease-out;
}

/* 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;
    }
}

/* Performance Optimization */
.sk-will-change-transform {
    will-change: transform;
}

.sk-will-change-auto {
    will-change: auto;
}

/* GPU Acceleration */
.sk-gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}
