/* 
* ملف تحريكات CSS لموقع بحار الشرق للتسويق والإعلان
* يحتوي على جميع التحريكات والتأثيرات البصرية
*/

/* تحريكات الظهور */
@keyframes fadeIn {
    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);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* تحريكات الخط */
@keyframes lineExpand {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

/* تحريكات الأزرار */
@keyframes btnWave {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes btnPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(230, 126, 34, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(230, 126, 34, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(230, 126, 34, 0);
    }
}

/* تحريكات الأيقونات */
@keyframes iconSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* تحريكات الصور */
@keyframes imageShift {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.02) rotate(0.5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* تحريكات الخلفية */
@keyframes movingBg {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes bgFade {
    0% {
        background-color: var(--gray-100);
    }
    50% {
        background-color: var(--gray-200);
    }
    100% {
        background-color: var(--gray-100);
    }
}

/* تحريكات الشعار */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* تحريكات العداد */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* فئات التحريك */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-left {
    opacity: 0;
    animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
    opacity: 0;
    animation: fadeInRight 0.8s ease-out forwards;
}

.slide-down {
    opacity: 0;
    animation: slideDown 0.6s ease-out forwards;
}

.scale-in {
    opacity: 0;
    animation: scaleIn 0.6s ease-out forwards;
}

.rotate-in {
    opacity: 0;
    animation: rotateIn 0.8s ease-out forwards;
}

/* تأخير التحريكات */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* تحريكات العناوين */
.line-expand {
    position: relative;
    display: inline-block;
    margin-bottom: var(--spacing-xl);
}

.line-expand::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    animation: lineExpand 1s ease-out forwards;
}

[lang="ar"] .line-expand::after {
    right: 50%;
    left: auto;
    transform: translateX(50%);
}

/* تحريكات الأزرار */
.btn-wave:hover {
    animation: btnWave 0.6s ease-in-out;
}

.btn-pulse {
    animation: btnPulse 2s infinite;
}

.btn-pulse:hover {
    animation: none;
}

/* تحريكات الأيقونات */
.icon-spin:hover {
    animation: iconSpin 0.6s ease-in-out;
}

.icon-bounce:hover {
    animation: iconBounce 0.8s ease-in-out;
}

/* تحريكات الصور */
.image-shift:hover {
    animation: imageShift 3s ease-in-out infinite;
}

/* تحريكات الخلفية */
.moving-bg {
    background: linear-gradient(-45deg, var(--primary-color), var(--accent-color), var(--secondary-color), var(--primary-color));
    background-size: 400% 400%;
    animation: movingBg 15s ease infinite;
}

.bg-fade {
    animation: bgFade 8s ease-in-out infinite;
}

/* تحريكات الشعار */
.logo-float {
    animation: logoFloat 3s ease-in-out infinite;
}

/* تحريكات العداد */
.counter {
    animation: countUp 1s ease-out forwards;
}

/* تحريكات التمرير */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

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

/* تحريكات التحميل */
@keyframes loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading {
    animation: loading 1s linear infinite;
}

/* تحريكات النص */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary-color);
    }
}

/* تحريكات التفاعل */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.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);
}

/* تحريكات الظهور التدريجي */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 0.6s ease-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* تحريكات خاصة بالجوال */
@media (max-width: 768px) {
    .fade-in,
    .fade-in-left,
    .fade-in-right,
    .slide-down,
    .scale-in,
    .rotate-in {
        animation-duration: 0.6s;
    }
    
    .line-expand::after {
        animation-duration: 0.8s;
    }
    
    .moving-bg {
        animation-duration: 10s;
    }
}

/* تحسينات الأداء */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* تحريكات للوضع المظلم */
@media (prefers-color-scheme: dark) {
    .line-expand::after {
        background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    }
}

/* إيقاف التحريكات للمستخدمين الذين يفضلون تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

