/* ============================================
   تحسينات خلفيات متحركة وتدرجات ديناميكية
   Animated Backgrounds & Dynamic Gradients
   ============================================ */

/* ===== Animated Background for Body ===== */
body {
    background: linear-gradient(
        135deg, 
        #f5f7fa 0%, 
        #c3cfe2 100%
    );
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(93, 64, 55, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(141, 110, 99, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 90%, rgba(109, 76, 65, 0.08) 0%, transparent 50%);
    animation: float-background 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes float-background {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(10px, -10px) rotate(5deg);
    }
    66% {
        transform: translate(-10px, 10px) rotate(-5deg);
    }
}

/* ===== Gradient Text Effects ===== */
.gradient-text {
    background: linear-gradient(135deg, #5D4037, #8D6E63, #6D4C41);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 5s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ===== Card with Animated Border ===== */
.card-animated-border {
    position: relative;
    background: white;
    border-radius: 15px;
    padding: 2px;
    background: linear-gradient(60deg, #5D4037, #8D6E63, #6D4C41, #5D4037);
    background-size: 300% 300%;
    animation: gradient-border 6s ease infinite;
}

.card-animated-border-content {
    background: white;
    border-radius: 13px;
    padding: 20px;
}

@keyframes gradient-border {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ===== Glowing Card Effect ===== */
.card-glow {
    position: relative;
    box-shadow: 
        0 0 20px rgba(93, 64, 55, 0.3),
        0 0 40px rgba(93, 64, 55, 0.2),
        0 0 60px rgba(93, 64, 55, 0.1);
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(93, 64, 55, 0.3),
            0 0 40px rgba(93, 64, 55, 0.2),
            0 0 60px rgba(93, 64, 55, 0.1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(93, 64, 55, 0.4),
            0 0 60px rgba(93, 64, 55, 0.3),
            0 0 90px rgba(93, 64, 55, 0.2);
    }
}

/* ===== Particles Background ===== */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(93, 64, 55, 0.3);
    border-radius: 50%;
    animation: float-particle 10s infinite ease-in-out;
}

@keyframes float-particle {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* ===== Morphing Shapes Background ===== */
.morphing-shape {
    position: fixed;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(93, 64, 55, 0.1), rgba(141, 110, 99, 0.1));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 15s ease-in-out infinite;
    z-index: -1;
}

.morphing-shape:nth-child(1) {
    top: 10%;
    left: 10%;
}

.morphing-shape:nth-child(2) {
    bottom: 10%;
    right: 10%;
    animation-delay: -5s;
}

@keyframes morph {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
        transform: rotate(180deg) scale(1.1);
    }
    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
    }
}

/* ===== Wave Background Animation ===== */
.wave-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: -1;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(93, 64, 55, 0.1), transparent);
    animation: wave-animation 10s linear infinite;
}

.wave:nth-child(2) {
    animation-delay: -5s;
    opacity: 0.5;
}

@keyframes wave-animation {
    0% {
        transform: translateX(0) translateZ(0) scaleY(1);
    }
    50% {
        transform: translateX(-25%) translateZ(0) scaleY(0.8);
    }
    100% {
        transform: translateX(-50%) translateZ(0) scaleY(1);
    }
}

/* ===== Spotlight Effect ===== */
.spotlight {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(93, 64, 55, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    transition: transform 0.1s ease;
}

/* ===== Color Shifting Background ===== */
@keyframes color-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.color-shift-bg {
    background: linear-gradient(
        -45deg,
        #f5f7fa,
        #c3cfe2,
        #e0c3fc,
        #8ec5fc
    );
    background-size: 400% 400%;
    animation: color-shift 15s ease infinite;
}

/* ===== Mesh Gradient Background ===== */
.mesh-gradient {
    background: 
        radial-gradient(at 40% 20%, rgba(93, 64, 55, 0.2) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(141, 110, 99, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(109, 76, 65, 0.2) 0px, transparent 50%),
        radial-gradient(at 80% 50%, rgba(78, 52, 46, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(62, 39, 35, 0.2) 0px, transparent 50%),
        radial-gradient(at 80% 100%, rgba(121, 85, 72, 0.2) 0px, transparent 50%);
}

/* ===== Glassmorphism Container ===== */
.glass-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 0 20px rgba(255, 255, 255, 0.5);
    border-radius: 20px;
}

/* ===== Aurora Background Effect ===== */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(
        to bottom,
        #f5f7fa 0%,
        #e0f2fe 25%,
        #ddd6fe 50%,
        #fce7f3 75%,
        #fee2e2 100%
    );
    opacity: 0.3;
    animation: aurora-shift 20s ease infinite;
}

@keyframes aurora-shift {
    0%, 100% {
        background-position: 0% 0%;
        filter: hue-rotate(0deg);
    }
    50% {
        background-position: 100% 100%;
        filter: hue-rotate(60deg);
    }
}

/* ===== 3D Flip Card ===== */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #5D4037, #4E342E);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .morphing-shape {
        width: 150px;
        height: 150px;
    }
    
    .wave-container {
        height: 100px;
    }
    
    body::before {
        animation-duration: 30s;
    }
}

/* ===== Performance Optimization ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}





