/* ========================================
   ملف الحركات المتقدمة
   Advanced Animations Stylesheet
======================================== */

/* ========================================
   Page Load Animation
======================================== */
body {
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.loaded {
    opacity: 1;
}

/* ========================================
   Scroll Progress Indicator
======================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #2D5C7F, #C08A3A);
    z-index: 10000;
    transition: width 0.1s ease;
    box-shadow: 0 2px 10px rgba(192, 138, 58, 0.5);
}

/* ========================================
   Custom Cursor
======================================== */
.custom-cursor,
.custom-cursor-follower {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
}

.custom-cursor {
    width: 10px;
    height: 10px;
    background-color: #C08A3A;
    transform: translate(-50%, -50%);
}

.custom-cursor-follower {
    width: 40px;
    height: 40px;
    border: 2px solid #C08A3A;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.custom-cursor.expand {
    transform: translate(-50%, -50%) scale(1.5);
}

.custom-cursor-follower.expand {
    width: 60px;
    height: 60px;
}

/* Hide default cursor on desktop */
@media (min-width: 769px) {
    a, button, .btn {
        cursor: none;
    }
}

/* ========================================
   Ripple Effect
======================================== */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========================================
   Fade In Animations
======================================== */
@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(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    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 bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-10px);
    }
    70% {
        transform: scale(0.95) translateY(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========================================
   Slide Animations
======================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-100px) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotate(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Rotation Animations
======================================== */
@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg) scale(0);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* ========================================
   Float & Pulse Effects
======================================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* ========================================
   Shimmer Effect
======================================== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   Glow Effect
======================================== */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(192, 138, 58, 0.5),
                    0 0 10px rgba(192, 138, 58, 0.3),
                    0 0 15px rgba(192, 138, 58, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(192, 138, 58, 0.8),
                    0 0 20px rgba(192, 138, 58, 0.6),
                    0 0 30px rgba(192, 138, 58, 0.4);
    }
}

/* ========================================
   Utility Animation Classes
======================================== */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

.bounce-in {
    animation: bounceIn 0.8s ease-out forwards;
}

.slide-in {
    animation: slideIn 0.8s ease-out forwards;
}

.rotate-in {
    animation: rotateIn 0.8s ease-out forwards;
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   Hover Effects
======================================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow:hover {
    animation: glow 1.5s ease-in-out infinite;
}

/* ========================================
   Text Effects
======================================== */
.text-gradient {
    background: linear-gradient(90deg, #2D5C7F, #C08A3A);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s infinite;
    background-size: 200% auto;
}

.text-shadow-glow {
    text-shadow: 0 0 10px rgba(192, 138, 58, 0.5),
                 0 0 20px rgba(192, 138, 58, 0.3),
                 0 0 30px rgba(192, 138, 58, 0.2);
}

/* ========================================
   Loading Spinner
======================================== */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #C08A3A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   Particles Background
======================================== */
.particles-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: rgba(192, 138, 58, 0.5);
    border-radius: 50%;
    animation: float-particle 20s infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* ========================================
   Scroll Reveal Classes
======================================== */
[data-scroll] {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-scroll].revealed {
    opacity: 1;
    transform: translateY(0) !important;
}

/* ========================================
   Image Filters & Effects
======================================== */
.image-hover-zoom {
    overflow: hidden;
}

.image-hover-zoom img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.image-hover-zoom:hover img {
    transform: scale(1.15);
    filter: brightness(1.1);
}

.image-grayscale {
    filter: grayscale(100%);
    transition: filter 0.5s ease;
}

.image-grayscale:hover {
    filter: grayscale(0%);
}

/* ========================================
   Button Advanced Effects
======================================== */
.btn-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.btn-3d::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    transform: translateZ(-10px);
    filter: brightness(0.8);
}

.btn-3d:hover {
    transform: translateY(-5px);
}

.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    bottom: -50%;
    left: -50%;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotateZ(45deg) translateY(-100%);
    transition: transform 0.6s ease;
}

.btn-shine:hover::after {
    transform: rotateZ(45deg) translateY(100%);
}

/* ========================================
   Mobile Optimizations
======================================== */
@media (max-width: 768px) {
    /* Reduce animations on mobile */
    .custom-cursor,
    .custom-cursor-follower {
        display: none;
    }
    
    /* Simpler animations */
    * {
        animation-duration: 0.5s !important;
    }
}

/* ========================================
   Reduced Motion Support
======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
