/* ============================================
   الأنيميشن والتأثيرات الحركية
   Animations & Motion Effects
   ============================================ */

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}

/* Bounce Animation */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Shake Animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Slide Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Wave Animation */
@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(20deg);
    }

    75% {
        transform: rotate(-20deg);
    }
}

/* Glow Animation */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(4, 120, 87, 0.5),
            0 0 10px rgba(4, 120, 87, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(4, 120, 87, 0.8),
            0 0 30px rgba(4, 120, 87, 0.5);
    }
}

/* Typewriter Effect */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* ========================================
   ANIMATION UTILITY CLASSES
   ======================================== */

/* Fade Animations */
.animate-fadeIn {
    animation: fadeIn 0.6s ease-out;
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 0.8s ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s ease-out;
}

/* Scale Animations */
.animate-scaleIn {
    animation: scaleIn 0.5s ease-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Movement Animations */
.animate-bounce {
    animation: bounce 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Rotation */
.animate-rotate {
    animation: rotate 2s linear infinite;
}

/* Shimmer */
.animate-shimmer {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

/* Elements that animate on scroll */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays */
.scroll-animate:nth-child(1) {
    transition-delay: 0s;
}

.scroll-animate:nth-child(2) {
    transition-delay: 0.1s;
}

.scroll-animate:nth-child(3) {
    transition-delay: 0.2s;
}

.scroll-animate:nth-child(4) {
    transition-delay: 0.3s;
}

.scroll-animate:nth-child(5) {
    transition-delay: 0.4s;
}

.scroll-animate:nth-child(6) {
    transition-delay: 0.5s;
}

/* ========================================
   HOVER EFFECTS
   ======================================== */

/* Lift on Hover */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* Grow on Hover */
.hover-grow {
    transition: transform var(--transition-base);
}

.hover-grow:hover {
    transform: scale(1.05);
}

/* Tilt on Hover */
.hover-tilt {
    transition: transform var(--transition-base);
}

.hover-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

/* Glow on Hover */
.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(4, 120, 87, 0.4),
        0 0 40px rgba(4, 120, 87, 0.2);
}

/* Shine on Hover */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    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 var(--transition-slow);
}

.hover-shine:hover::before {
    left: 100%;
}

/* ========================================
   LOADING ANIMATIONS
   ======================================== */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-gray-100) 25%,
            var(--bg-gray-50) 50%,
            var(--bg-gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

/* Spinner Variations */
.spinner-dots {
    display: flex;
    gap: var(--space-2);
}

.spinner-dots span {
    width: 12px;
    height: 12px;
    background: var(--primary-emerald);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.spinner-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.spinner-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* ========================================
   TRANSITION UTILITIES
   ======================================== */

.transition-all {
    transition: all var(--transition-base);
}

.transition-fast {
    transition: all var(--transition-fast);
}

.transition-slow {
    transition: all var(--transition-slow);
}

.transition-bounce {
    transition: all var(--transition-bounce);
}

/* ========================================
   PARALLAX EFFECTS
   ======================================== */

.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ========================================
   GRADIENT ANIMATIONS
   ======================================== */

.gradient-animated {
    background: linear-gradient(270deg,
            var(--primary-emerald),
            var(--accent-gold),
            var(--primary-navy));
    background-size: 600% 600%;
    animation: gradientShift 8s ease infinite;
}

/* ========================================
   ISLAMIC PATTERN ANIMATIONS
   ======================================== */

@keyframes patternMove {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 60px 60px;
    }
}

.pattern-animated {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L45 15L30 30L15 15z M30 30L45 45L30 60L15 45z' fill='%23047857' fill-opacity='0.05'/%3E%3C/svg%3E");
    animation: patternMove 30s linear infinite;
}

/* ========================================
   ENTRANCE ANIMATIONS WITH DELAYS
   ======================================== */

.entrance-1 {
    animation: fadeInUp 0.8s ease-out 0.1s backwards;
}

.entrance-2 {
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.entrance-3 {
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
}

.entrance-4 {
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.entrance-5 {
    animation: fadeInUp 0.8s ease-out 0.5s backwards;
}

.entrance-6 {
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

/* ========================================
   MODAL ANIMATIONS
   ======================================== */

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-backdrop {
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    animation: modalSlideIn 0.4s ease-out;
}

/* ========================================
   RESPONSIVE ANIMATIONS
   ======================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Disable complex animations on mobile for performance */
@media (max-width: 768px) {

    .animate-float,
    .animate-bounce,
    .gradient-animated,
    .pattern-animated {
        animation: none;
    }
}