/* =========================
   Why Us Section - Isolated Styles
   These styles are specifically for the Why Us section only
   and have been isolated to prevent conflicts with other sections.
   ========================= */
.why-us-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    position: relative;
    overflow: hidden;
    color: #fff;
    will-change: opacity;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ensure z-index isolation */
    z-index: 1;
}

/* Animated Background with Gradient Overlay */
.why-us-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm-56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
    animation: backgroundMove 60s linear infinite;
}

/* Additional colored gradient overlay */
.why-us-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(214, 255, 246, 0.15), transparent 70%);
    z-index: 0;
}

@keyframes backgroundMove {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

/* Floating Particles */
.why-us-section .particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.why-us-section .particle {
    position: absolute;
    display: block;
    pointer-events: none;
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    25% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
    75% {
        opacity: 0.3;
    }
}

.why-us-section .container {
    position: relative;
    z-index: 2;
}

.why-us-section .why-us-title {
    color: #fff;
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
    background: linear-gradient(45deg, #D6FFF6, #fff, #D6FFF6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shineText 3s infinite linear;
}

@keyframes shineText {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

.why-us-section .why-us-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 60px;
    text-align: center;
    line-height: 1.8;
    position: relative;
    z-index: 2;
    font-weight: 300;
}

.why-us-section .why-us-subtitle::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #D6FFF6, transparent);
    margin: 30px auto 0;
    border-radius: 2px;
}

/* Feature Cards - Enhanced 3D Design */
.why-us-section .why-us-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
    perspective: 1000px;
    z-index: 10;
    position: relative;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.why-us-section .why-us-feature-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-style: preserve-3d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.why-us-section .why-us-feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px; 
    padding: 2px;
    background: linear-gradient(135deg, #D6FFF6, transparent, #D6FFF6, transparent);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.why-us-section .why-us-feature-card:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.why-us-section .why-us-feature-card:hover::before {
    opacity: 1;
    animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 300% 0%;
    }
}

.why-us-section .why-us-feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.why-us-section .why-us-feature-card:hover::after {
    opacity: 1;
}

.why-us-section .why-us-feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.5s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.why-us-section .why-us-feature-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at center, #D6FFF6, transparent 70%);
    opacity: 0.3;
    transition: opacity 0.5s ease;
}

.why-us-section .why-us-feature-icon i {
    font-size: 2rem;
    color: #D6FFF6;
    text-shadow: 0 0 20px rgba(214, 255, 246, 0.7);
    transition: all 0.5s ease;
}

.why-us-section .why-us-feature-card:hover .why-us-feature-icon {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.why-us-section .why-us-feature-card:hover .why-us-feature-icon::before {
    opacity: 0.6;
}

.why-us-section .why-us-feature-card:hover .why-us-feature-icon i {
    transform: scale(1.2);
    text-shadow: 0 0 30px rgba(214, 255, 246, 0.9);
}

.why-us-section .why-us-feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
    position: relative;
    z-index: 1;
    transition: all 0.5s ease;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.why-us-section .why-us-feature-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    position: relative;
    z-index: 1;
    font-weight: 300;
    margin-bottom: 0;
    transition: all 0.5s ease;
}

.why-us-section .why-us-feature-card:hover .why-us-feature-title {
    transform: translateY(-5px);
    color: #D6FFF6;
    text-shadow: 0 0 10px rgba(214, 255, 246, 0.5);
}

.why-us-section .why-us-feature-card:hover .why-us-feature-description {
    transform: translateY(-5px);
    color: rgba(255, 255, 255, 0.95);
}

/* Responsive Styles - Enhanced for Mobile */
@media (max-width: 1200px) {
    .why-us-section .why-us-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 0 15px;
    }
}

@media (max-width: 992px) {
    .why-us-section .why-us-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .why-us-section {
        padding: 60px 0;
    }
    
    .why-us-section .why-us-title {
        font-size: 2.2rem;
    }
    
    .why-us-section .why-us-subtitle {
        font-size: 1rem;
        margin-bottom: 35px;
        padding: 0 20px;
    }
    
    .why-us-section .why-us-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
        margin: 0 auto 40px;
        max-width: 95%;
    }
    
    .why-us-section .why-us-feature-card {
        padding: 25px 20px;
        border-radius: 15px;
        min-height: auto;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .why-us-section .why-us-feature-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }
    
    .why-us-section .why-us-feature-icon i {
        font-size: 1.8rem;
    }
    
    .why-us-section .why-us-feature-title {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .why-us-section .why-us-feature-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .why-us-section {
        padding: 50px 0;
    }
    
    .why-us-section .why-us-title {
        font-size: 2rem;
    }
    
    .why-us-section .why-us-subtitle {
        font-size: 0.95rem;
        padding: 0 15px;
    }
    
    .why-us-section .why-us-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 90%;
        margin: 0 auto 30px;
    }
    
    .why-us-section .why-us-feature-card {
        padding: 30px 20px;
        min-height: auto;
        max-width: 320px;
    }
    
    .why-us-section .why-us-feature-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }
    
    .why-us-section .why-us-feature-icon i {
        font-size: 1.8rem;
    }
    
    .why-us-section .why-us-feature-title {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    .why-us-section .why-us-feature-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* Additional Animations and Effects */
@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(214, 255, 246, 0.8), 0 0 30px rgba(214, 255, 246, 0.6), 0 0 40px rgba(214, 255, 246, 0.4);
    }
    50% {
        text-shadow: 0 0 30px rgba(214, 255, 246, 0.9), 0 0 40px rgba(214, 255, 246, 0.7), 0 0 50px rgba(214, 255, 246, 0.5);
    }
}

@keyframes float-in {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes blinking-cursor {
    0%, 100% {
        border-right-color: transparent;
    }
    50% {
        border-right-color: #D6FFF6;
    }
}

/* Interactive particles */
.interactive-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(214, 255, 246, 0.6);
    box-shadow: 0 0 10px rgba(214, 255, 246, 0.8);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    will-change: transform, opacity;
}

/* Enhanced title effect */
.why-us-section.visible .why-us-title {
    animation: glow 3s infinite alternate;
}

/* Enhanced card effects */
.why-us-feature-card {
    will-change: transform;
}

.why-us-feature-card:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(214, 255, 246, 0.2);
}

.why-us-feature-card:hover::before {
    opacity: 1;
    animation: borderRotate 3s linear infinite;
}

/* Card content animation adjustment */
.why-us-feature-card .why-us-feature-icon {
    will-change: transform;
}

/* Typing effect for subtitle */
.subtitle-typing {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid transparent;
    animation: blinking-cursor 0.7s step-end infinite;
}

/* Line effect for subtitle */
.subtitle-line {
    display: block;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #D6FFF6, transparent);
    margin: 30px auto 0;
    border-radius: 2px;
    transition: width 1s ease;
}

/* Enhance 3D effect */
.why-us-feature-card:hover .why-us-feature-icon i {
    filter: drop-shadow(0 0 15px rgba(214, 255, 246, 0.8));
}

/* Ripple effect for icons */
.icon-ripple {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(214, 255, 246, 0.5);
    transform: scale(0.8);
    opacity: 1;
    transition: all 0.5s ease-out;
}

/* Responsive adjustments for animations */
@media (max-width: 768px) {
    .why-us-section.visible .why-us-title {
        animation: glow 2s infinite alternate;
    }
    
    @keyframes glow {
        0%, 100% {
            text-shadow: 0 0 10px rgba(214, 255, 246, 0.7), 0 0 20px rgba(214, 255, 246, 0.5);
        }
        50% {
            text-shadow: 0 0 15px rgba(214, 255, 246, 0.8), 0 0 25px rgba(214, 255, 246, 0.6);
        }
    }
    
    .why-us-feature-card:hover {
        transform: translateY(-10px);
    }
}

/* Animation styles for Why Us section */
.why-us-section {
    overflow: hidden; /* Ensure falling animations don't create scrollbars */
    position: relative;
}

/* Feature cards with falling animation */
.why-us-feature-card {
    position: relative;
    transition: transform 0.5s ease, opacity 0.5s ease;
    will-change: transform, opacity;
    backface-visibility: hidden; /* Performance optimization */
}

/* Card styles when animated */
.why-us-feature-card.animation-ready {
    opacity: 0;
    transform: translateY(-100px);
}

/* Bouncing animation for cards */
@keyframes bounce {
    0% { transform: translateY(-500px) rotate(-10deg); opacity: 0; }
    70% { transform: translateY(20px) rotate(0deg); opacity: 1; }
    85% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(0) rotate(0deg); opacity: 1; }
}

/* Icon animation */
@keyframes iconBounce {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Shadow effect for feature cards */
.why-us-feature-card {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.why-us-feature-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

/* For very small screens */
@media (max-width: 480px) {
    .why-us-feature-card.animation-ready {
        transform: translateY(-80px); /* Shorter animation distance for mobile */
    }
    
    @keyframes bounce {
        0% { transform: translateY(-200px) rotate(-5deg); opacity: 0; }
        70% { transform: translateY(10px) rotate(0deg); opacity: 1; }
        85% { transform: translateY(-5px) rotate(0deg); opacity: 1; }
        100% { transform: translateY(0) rotate(0deg); opacity: 1; }
    }
}

/* Animation styles for scroll-based effects */
.why-us-section {
    overflow: hidden; /* Ensure animations don't cause scrollbars */
    position: relative;
}

/* Feature cards with scroll-based animation */
.why-us-feature-card {
    position: relative;
    transition: transform 0.5s ease, opacity 0.5s ease;
    will-change: transform, opacity;
    backface-visibility: hidden; /* Performance optimization */
    transform-style: preserve-3d; /* Better 3D effects */
}

/* Smooth transitioning for elements */
.why-us-feature-card .why-us-feature-icon,
.why-us-feature-card .why-us-feature-title,
.why-us-feature-card .why-us-feature-description {
    transition: opacity 0.5s ease, transform 0.5s ease;
    will-change: opacity, transform;
}

/* Animation phases for cards */
.why-us-feature-card[data-animation-phase="falling"] {
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.17, 0.67, 0.83, 0.97);
}

.why-us-feature-card[data-animation-phase="bounce"] {
    transition: transform 0.5s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

/* For very small screens, adjust animation distances */
@media (max-width: 480px) {
    .why-us-feature-card {
        transform: translateY(-50px) rotate(-5deg); /* Smaller initial offset for mobile */
    }
}

/* تحسينات للأداء وتوافق الأجهزة */
.why-us-section {
    will-change: opacity;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* تحسين أداء الحركة للمتصفحات الحديثة */
.why-us-feature-card,
.why-us-feature-icon,
.why-us-feature-title,
.why-us-feature-description,
.interactive-particle,
.particle {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* تحسين أداء الرسوم المتحركة */
@media (prefers-reduced-motion: reduce) {
    .why-us-feature-card {
        transition: none !important;
        transform: none !important;
    }
    
    .why-us-feature-card .why-us-feature-icon,
    .why-us-feature-card .why-us-feature-title,
    .why-us-feature-card .why-us-feature-description {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .particle, 
    .interactive-particle {
        animation: none !important;
        display: none;
    }
    
    .why-us-section .why-us-title,
    .why-us-section .why-us-subtitle {
        transform: none !important;
        opacity: 1 !important;
        transition: none !important;
    }
}

/* تحسينات للأجهزة القديمة ومتصفحات IE */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .why-us-feature-card {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .why-us-section::before,
    .why-us-section::after {
        content: none;
    }
}

/* تحسينات للأجهزة المحمولة */
@media (max-width: 768px) {
    /* تسريع الانتقالات على الأجهزة المحمولة */
    .why-us-feature-card,
    .why-us-feature-card .why-us-feature-icon,
    .why-us-feature-card .why-us-feature-title,
    .why-us-feature-card .why-us-feature-description {
        transition-duration: 0.3s !important;
    }
    
    /* تقليل عدد الجزيئات المتحركة للأداء الأفضل */
    .particle:nth-child(odd) {
        display: none;
    }
    
    /* تحسين مساحة العرض */
    .why-us-grid {
        gap: 15px;
    }
    
    /* تحسين أحجام العناصر للشاشات الصغيرة */
    .why-us-section .why-us-title {
        font-size: 2.2rem;
    }
    
    .why-us-section .why-us-subtitle {
        font-size: 1rem;
        margin-bottom: 35px;
    }
}

/* تحسينات للأجهزة الصغيرة جداً */
@media (max-width: 480px) {
    /* تبسيط أكثر للتأثيرات */
    .why-us-feature-card {
        transform: translateY(-30px) !important;
    }
    
    .why-us-section .why-us-title {
        font-size: 1.8rem;
    }
    
    .why-us-feature-icon {
        width: 60px !important;
        height: 60px !important;
    }
    
    .why-us-feature-icon i {
        font-size: 1.6rem !important;
    }
}

/* تحسين تجربة المستخدم على أجهزة اللمس */
@media (hover: none) and (pointer: coarse) {
    .why-us-feature-card:hover {
        transform: none !important;
    }
    
    .why-us-feature-card:hover::before,
    .why-us-feature-card:hover::after {
        opacity: 0 !important;
    }
}

/* إصلاح بعض مشاكل التوافق مع سفاري */
@supports (-webkit-overflow-scrolling: touch) {
    .why-us-section::before,
    .why-us-section::after {
        background-attachment: scroll;
    }
}

/* تحسين وضوح النص على الأجهزة الشاشات ذات الدقة العالية */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .why-us-section .why-us-title,
    .why-us-section .why-us-subtitle,
    .why-us-feature-title,
    .why-us-feature-description {
        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    }
} 