/**
 * 🌟 Nawader Mega Animations V2.0
 * Smooth, performant animations for world-class UX
 */

/* ═══ Fade Animations ═══ */
@keyframes nw-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

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

/* ═══ Scale Animations ═══ */
@keyframes nw-scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes nw-scale-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.1);
    }
}

/* ═══ Slide Animations ═══ */
@keyframes nw-slide-in-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes nw-slide-in-down {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes nw-slide-in-left {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes nw-slide-in-right {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ═══ Bounce Animations ═══ */
@keyframes nw-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

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

@keyframes nw-pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(201, 169, 97, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(201, 169, 97, 0.8);
    }
}

/* ═══ Rotate Animations ═══ */
@keyframes nw-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes nw-rotate-in {
    from {
        opacity: 0;
        transform: rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

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

/* ═══ Flip Animations ═══ */
@keyframes nw-flip-in-x {
    from {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateX(0);
        opacity: 1;
    }
}

@keyframes nw-flip-in-y {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

/* ═══ Zoom Animations ═══ */
@keyframes nw-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes nw-zoom-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* ═══ Attention Seekers ═══ */
@keyframes nw-rubber-band {
    0% {
        transform: scale3d(1, 1, 1);
    }
    30% {
        transform: scale3d(1.25, 0.75, 1);
    }
    40% {
        transform: scale3d(0.75, 1.25, 1);
    }
    50% {
        transform: scale3d(1.15, 0.85, 1);
    }
    65% {
        transform: scale3d(0.95, 1.05, 1);
    }
    75% {
        transform: scale3d(1.05, 0.95, 1);
    }
    100% {
        transform: scale3d(1, 1, 1);
    }
}

@keyframes nw-swing {
    20% {
        transform: rotate3d(0, 0, 1, 15deg);
    }
    40% {
        transform: rotate3d(0, 0, 1, -10deg);
    }
    60% {
        transform: rotate3d(0, 0, 1, 5deg);
    }
    80% {
        transform: rotate3d(0, 0, 1, -5deg);
    }
    100% {
        transform: rotate3d(0, 0, 1, 0deg);
    }
}

@keyframes nw-tada {
    0% {
        transform: scale3d(1, 1, 1);
    }
    10%, 20% {
        transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
    }
    40%, 60%, 80% {
        transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
    }
    100% {
        transform: scale3d(1, 1, 1);
    }
}

/* ═══ Loading Spinner ═══ */
@keyframes nw-spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ═══ Progress Bar ═══ */
@keyframes nw-progress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* ═══ Shimmer Effect ═══ */
@keyframes nw-shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ═══ Utility Classes ═══ */
.nw-animate-fade-in {
    animation: nw-fade-in 0.6s ease forwards;
}

.nw-animate-fade-in-up {
    animation: nw-fade-in-up 0.6s ease forwards;
}

.nw-animate-fade-in-down {
    animation: nw-fade-in-down 0.6s ease forwards;
}

.nw-animate-fade-in-left {
    animation: nw-fade-in-left 0.6s ease forwards;
}

.nw-animate-fade-in-right {
    animation: nw-fade-in-right 0.6s ease forwards;
}

.nw-animate-scale-in {
    animation: nw-scale-in 0.4s ease forwards;
}

.nw-animate-bounce {
    animation: nw-bounce 2s infinite;
}

.nw-animate-pulse {
    animation: nw-pulse 2s infinite;
}

.nw-animate-rotate {
    animation: nw-rotate 2s linear infinite;
}

.nw-animate-shake {
    animation: nw-shake 0.8s ease;
}

.nw-animate-flip-in-x {
    animation: nw-flip-in-x 0.6s ease forwards;
}

.nw-animate-zoom-in {
    animation: nw-zoom-in 0.4s ease forwards;
}

.nw-animate-rubber-band {
    animation: nw-rubber-band 1s ease;
}

.nw-animate-tada {
    animation: nw-tada 1s ease;
}

/* ═══ Loading Spinner Class ═══ */
.nw-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(201, 169, 97, 0.2);
    border-top-color: #C9A961;
    border-radius: 50%;
    animation: nw-spinner 1s linear infinite;
}

/* ═══ Shimmer Loading ═══ */
.nw-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.05) 25%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.05) 75%
    );
    background-size: 1000px 100%;
    animation: nw-shimmer 2s infinite;
}

/* ═══ Delay Classes ═══ */
.nw-delay-100 { animation-delay: 0.1s; }
.nw-delay-200 { animation-delay: 0.2s; }
.nw-delay-300 { animation-delay: 0.3s; }
.nw-delay-400 { animation-delay: 0.4s; }
.nw-delay-500 { animation-delay: 0.5s; }
.nw-delay-600 { animation-delay: 0.6s; }
.nw-delay-700 { animation-delay: 0.7s; }
.nw-delay-800 { animation-delay: 0.8s; }
.nw-delay-900 { animation-delay: 0.9s; }
.nw-delay-1000 { animation-delay: 1s; }

/* ═══ Duration Classes ═══ */
.nw-duration-200 { animation-duration: 0.2s; }
.nw-duration-300 { animation-duration: 0.3s; }
.nw-duration-400 { animation-duration: 0.4s; }
.nw-duration-500 { animation-duration: 0.5s; }
.nw-duration-600 { animation-duration: 0.6s; }
.nw-duration-700 { animation-duration: 0.7s; }
.nw-duration-800 { animation-duration: 0.8s; }
.nw-duration-900 { animation-duration: 0.9s; }
.nw-duration-1000 { animation-duration: 1s; }
.nw-duration-2000 { animation-duration: 2s; }

/* ═══ Hover Effects ═══ */
.nw-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nw-hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

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

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

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

.nw-hover-glow {
    transition: box-shadow 0.3s ease;
}

.nw-hover-glow:hover {
    box-shadow: 0 0 30px rgba(201, 169, 97, 0.6);
}

/* ═══ Smooth Transitions ═══ */
.nw-transition-all {
    transition: all 0.3s ease;
}

.nw-transition-fast {
    transition: all 0.2s ease;
}

.nw-transition-slow {
    transition: all 0.5s ease;
}

/* ═══ Performance Optimizations ═══ */
.nw-will-animate {
    will-change: transform, opacity;
}

.nw-transform-gpu {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .nw-animate-bounce,
    .nw-animate-pulse {
        animation: none !important;
    }
}

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