/* ============================================= */
/* HOW IT WORKS SECTION - ظهور تدريجي عند السكرول */
/* ============================================= */

.how-it-works {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

/* خلفية متحركة خفيفة */
.how-it-works::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,193,7,0.03) 0%, transparent 70%);
    animation: rotateBg 30s linear infinite;
    pointer-events: none;
}

@keyframes rotateBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.how-it-works .container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    position: relative;
    z-index: 1;
}

/* عنوان القسم - يظهر فوراً لكن مع أنيميشن خفيف */
.how-it-works h2 {
    text-align: center;
    font-size: 42px;
    font-weight: 800;
    color: #0b1f3a;
    margin-bottom: 60px;
    position: relative;
    animation: fadeInDown 0.8s ease-out forwards;
}

.how-it-works h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: #ffc107;
    margin: 15px auto 0;
    border-radius: 4px;
    animation: expandWidth 0.6s ease-out 0.3s forwards;
}

@keyframes expandWidth {
    0% { width: 0; opacity: 0; }
    100% { width: 80px; opacity: 1; }
}

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

/* حاوية الخطوات */
.how-it-works .steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

/* البطاقة - الحالة الافتراضية (مخفية تماماً) */
.how-it-works .step {
    background: white;
    padding: 45px 20px 28px;
    text-align: center;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    position: relative;
    cursor: pointer;
    border-bottom: 4px solid #ffc107;
    
    /* مخفية تماماً في البداية */
    opacity: 0;
    transform: translateY(50px);
}

/* الدائرة الصفراء - الحالة الافتراضية */
.how-it-works .step .circle-number {
    width: 56px;
    height: 56px;
    background: #ffc107;
    color: #0b1f3a;
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border: 3px solid white;
    z-index: 2;
    opacity: 0;
}

/* الأيقونة - الحالة الافتراضية */
.how-it-works .step i {
    font-size: 45px;
    color: #0b1f3a;
    margin: 15px 0 15px;
    display: inline-block;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

/* عنوان الخطوة - الحالة الافتراضية */
.how-it-works .step h3 {
    font-size: 1.35rem;
    margin: 12px 0 8px;
    color: #0b1f3a;
    font-weight: 700;
    opacity: 0;
    transform: translateY(20px);
}

/* النص الوصفي - الحالة الافتراضية */
.how-it-works .step p {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px);
}

/* تأثير hover على البطاقة */
.how-it-works .step:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ============================================= */
/* RESPONSIVE */
/* ============================================= */

@media (max-width: 768px) {
    .how-it-works {
        padding: 60px 0;
    }
    
    .how-it-works h2 {
        font-size: 32px;
    }
    
    .how-it-works .step .circle-number {
        width: 48px;
        height: 48px;
        font-size: 24px;
        top: -24px;
    }
    
    .how-it-works .step {
        padding: 40px 15px 22px;
        min-width: 180px;
    }
    
    .how-it-works .step i {
        font-size: 38px;
    }
    
    .how-it-works .step h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .how-it-works {
        padding: 50px 0;
    }
    
    .how-it-works h2 {
        font-size: 28px;
        margin-bottom: 45px;
    }
    
    .how-it-works .step .circle-number {
        width: 44px;
        height: 44px;
        font-size: 22px;
        top: -22px;
    }
    
    .how-it-works .step {
        min-width: 160px;
        padding: 35px 12px 20px;
    }
    
    .how-it-works .step i {
        font-size: 32px;
    }
    
    .how-it-works .step h3 {
        font-size: 1.1rem;
    }
}