/* خلفية فيديو احترافية لقسم Hero */

.hero.section {
    position: relative;
    overflow: hidden;
}

/* حاوية الفيديو */
.hero-video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

/* الفيديو نفسه */
.hero-video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.9; /* زيادة وضوح الفيديو */
    filter: blur(0px); /* بدون blur */
}

/* طبقة تراكب (overlay) لتحسين قراءة النص - شفافية خفيفة جداً */
.hero-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent !important;
    z-index: 1;
    pointer-events: none;
}

/* طبقة إضافية للتدرج من الأعلى والأسفل - خفيفة جداً */
.hero-video-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        transparent 100%
    );
}

.hero-video-overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.1) 0%,
        transparent 100%
    );
}

/* التأكد من أن المحتوى فوق الفيديو */
.hero-layout,
.hero-text,
.hero-media,
.hero-card {
    position: relative;
    z-index: 2;
}

/* تحسين التباين للنصوص */
.hero-text h1,
.hero-text p,
.hero-eyebrow,
.hero-keywords,
.trust li {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* تأثير حركة خفيف للفيديو */
@keyframes videoZoom {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.hero-video-background video {
    animation: videoZoom 30s ease-in-out infinite;
}

/* Responsive - تحسينات للهاتف */
@media (max-width: 768px) {
    .hero-video-background {
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
    }
    
    .hero-video-background video {
        opacity: 0.7;
        filter: blur(0.5px);
        animation: none; /* إيقاف الحركة على الموبايل لتحسين الأداء */
        min-width: 100%;
        min-height: 100%;
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
    }
    
    .hero-video-overlay {
        background: transparent !important;
    }
    
    /* التأكد من ظهور الفيديو على الهاتف */
    .hero-video-background {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .hero-video-background video {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .hero-video-background video {
        opacity: 0.6;
        filter: blur(0.3px);
        object-fit: cover;
        object-position: center center;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 360px) {
    .hero-video-background video {
        opacity: 0.5;
        filter: blur(0.2px);
        object-fit: cover;
        object-position: center center;
    }
}

/* للأجهزة ذات الأداء المنخفض - إخفاء الفيديو */
@media (prefers-reduced-motion: reduce) {
    .hero-video-background video {
        display: none;
    }
}

/* تحسين الأداء */
.hero-video-background {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

.hero-video-background video {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* للطباعة - إخفاء الفيديو */
@media print {
    .hero-video-background {
        display: none;
    }
}

/* تأثير إضافي: نقاط متحركة */
.hero-video-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.1;
}

.hero-video-particles::before,
.hero-video-particles::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    filter: blur(40px);
    animation: particleFloat 20s ease-in-out infinite;
}

.hero-video-particles::before {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.hero-video-particles::after {
    bottom: 10%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(30px, -30px);
    }
    50% {
        transform: translate(-20px, 20px);
    }
    75% {
        transform: translate(20px, 30px);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .hero-video-background video {
        opacity: 0.8;
    }
    
    .hero-video-overlay {
        background: transparent !important;
    }
}
