/* ============================================
   Premium Animations System
   מערכת אנימציות מתקדמות לחוויה עוצרת נשימה
   ============================================ */

/* ========== Scroll Reveal Animations ========== */

/* Base reveal class */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children animation */
.reveal-stagger>* {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-stagger.revealed>*:nth-child(1) {
    transition-delay: 0.1s;
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.revealed>*:nth-child(2) {
    transition-delay: 0.2s;
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.revealed>*:nth-child(3) {
    transition-delay: 0.3s;
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.revealed>*:nth-child(4) {
    transition-delay: 0.4s;
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.revealed>*:nth-child(5) {
    transition-delay: 0.5s;
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.revealed>*:nth-child(6) {
    transition-delay: 0.6s;
    opacity: 1;
    transform: translateY(0);
}

/* Direction variants */
.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ========== Parallax Effects ========== */

.parallax-slow {
    transition: transform 0.3s ease-out;
}

.parallax-medium {
    transition: transform 0.2s ease-out;
}

.parallax-fast {
    transition: transform 0.1s ease-out;
}

/* ========== Hover Animations ========== */

/* Magnetic hover effect */
.magnetic-hover {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lift and glow on hover */
.hover-lift {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

/* Premium card hover */
.hover-premium {
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.hover-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #d97706);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.hover-premium:hover::before {
    transform: scaleX(1);
}

.hover-premium:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

/* Shine effect on hover */
.hover-shine {
    position: relative;
    overflow: hidden;
}

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

.hover-shine:hover::after {
    left: 100%;
}

/* ========== Text Animations ========== */

/* Text gradient animation */
.text-gradient-animate {
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #fcd34d, #fbbf24);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradientFlow 4s linear infinite;
}

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

    100% {
        background-position: 300% 50%;
    }
}

/* Typewriter effect setup */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 3s steps(30) 1s forwards;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* ========== Counter Animation Styles ========== */

.counter-value {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.counter-value.counting {
    animation: counterPulse 0.3s ease;
}

@keyframes counterPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ========== Floating Elements ========== */

.float-gentle {
    animation: floatGentle 6s ease-in-out infinite;
}

@keyframes floatGentle {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(1deg);
    }

    50% {
        transform: translateY(-20px) rotate(-1deg);
    }

    75% {
        transform: translateY(-10px) rotate(0.5deg);
    }
}

.float-slow {
    animation: floatSlow 8s ease-in-out infinite;
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* ========== Pulse Animations ========== */

.pulse-gold {
    animation: pulseGold 2s ease-in-out infinite;
}

@keyframes pulseGold {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(251, 191, 36, 0);
    }
}

.pulse-blue {
    animation: pulseBlue 2s ease-in-out infinite;
}

@keyframes pulseBlue {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }
}

/* ========== 3D Card Effects ========== */

.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card-3d-inner {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-3d:hover .card-3d-inner {
    transform: rotateY(10deg) rotateX(5deg);
}

/* Flip card */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* ========== Glassmorphism ========== */

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-gold {
    background: rgba(251, 191, 36, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ========== Interactive Badges ========== */

.badge-animated {
    position: relative;
    overflow: hidden;
}

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

.badge-animated:hover::before {
    width: 200%;
    height: 200%;
}

/* ========== Loading Animations ========== */

.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========== Progress Animations ========== */

.progress-animate {
    animation: progressFill 2s ease-out forwards;
}

@keyframes progressFill {
    from {
        width: 0;
    }
}

/* ========== Border Animations ========== */

.border-animate {
    position: relative;
}

.border-animate::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #3b82f6, #10b981, #fbbf24);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: borderGradient 6s ease infinite;
}

@keyframes borderGradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ========== Mouse Follow Effects ========== */

.cursor-glow {
    position: relative;
    overflow: hidden;
}

.cursor-glow::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.cursor-glow:hover::after {
    opacity: 1;
}

/* ========== Responsive Animations ========== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .reveal {
        transform: translateY(20px);
    }

    .reveal-left,
    .reveal-right {
        transform: translateY(20px);
    }

    .card-3d:hover .card-3d-inner {
        transform: none;
    }
}