/**
 * ============================================================
 * ICFSME - Main Stylesheet (الأنماط غير الحرجة)
 * ملاحظة: critical.css يُحمّل أولاً في <head>
 * ============================================================
 */

/* ============================================================
   Utilities
   ============================================================ */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.bg-light-gray { background-color: var(--gray-light); }

/* ✅ تدرج تركوازي للإحصائيات */
.bg-primary-gradient { 
    background: linear-gradient(135deg, #2d7a83 0%, #46A6AF 50%, #6fc5cc 100%); 
    position: relative;
}
.bg-primary-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.06) 0%, transparent 40%);
    pointer-events: none;
}

.relative-z { position: relative; z-index: 10; }
.overflow-hidden { overflow: hidden; }
.fw-black { font-weight: 900; }

/* ============================================================
   الأزرار - جميعها باللون الأحمر للهوية البصرية
   ============================================================ */
.btn-primary {
    background: linear-gradient(135deg, #ED1C24, #c41820);
    border: none; border-radius: 50px; padding: 12px 25px; font-weight: 700; font-size: 0.95rem;
    color: white; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: inline-flex; align-items: center; gap: 8px;
    min-height: 48px;
    cursor: pointer;
}
.btn-primary:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 15px 30px rgba(237, 28, 36, 0.4); 
    color: white; 
    background: linear-gradient(135deg, #c41820, #a01419);
}
.btn-primary:hover i { transform: translateX(-5px); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary-custom {
    background: linear-gradient(135deg, #ED1C24, #c41820);
    color: white; border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 48px;
}
.btn-secondary-custom:hover { 
    background: linear-gradient(135deg, #c41820, #a01419);
    color: white; transform: translateY(-3px); 
    box-shadow: 0 15px 30px rgba(237, 28, 36, 0.4); 
}

.btn-outline-light {
    background: transparent; border: 2px solid white; border-radius: 50px; padding: 12px 25px; font-weight: 700;
    font-size: 0.95rem; color: white; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: inline-flex; align-items: center; gap: 8px;
    min-height: 48px;
}
.btn-outline-light:hover { background: white; color: #ED1C24; transform: translateY(-3px); }

.btn-outline-primary {
    border: 2px solid #ED1C24; color: #ED1C24; background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 48px;
}
.btn-outline-primary:hover { 
    background: #ED1C24; color: white; border-color: #ED1C24; 
    box-shadow: 0 10px 25px rgba(237, 28, 36, 0.3);
}

/* ============================================================
   Accordion Hero
   ============================================================ */
.accordion-hero-section {
    padding: 40px 0 60px;
    background-color: #f4f7f6;
}

.bh-accordion-container {
    display: flex;
    gap: 16px;
    height: 550px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.bh-accordion-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: flex 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    background-color: #111;
    background-size: cover;
    background-position: center;
    flex: 0 0 85px;
    outline: none;
}
.bh-accordion-item:focus-visible { box-shadow: 0 0 0 4px rgba(70, 166, 175, 0.5); }
.bh-accordion-item.active { flex: 1 1 0; cursor: default; }

.bh-accordion-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 1;
    pointer-events: none;
}
.bh-accordion-item.active::before { opacity: 1; }

.bh-accordion-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(70, 166, 175, 0.85);
    opacity: 1;
    transition: opacity 0.6s ease;
    z-index: 1;
    pointer-events: none;
}
.bh-accordion-item.active::after { opacity: 0; }

.bh-vertical-title {
    position: absolute;
    left: 50%;
    right: 50%;
    transform: translateX(-50%) rotate(180deg);
    bottom: 50px;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    white-space: nowrap;
    writing-mode: vertical-rl;
    z-index: 2;
    transition: opacity 0.3s;
}
.bh-accordion-item:hover:not(.active) .bh-vertical-title { transform: translateX(-50%) scale(1.05); }
.bh-accordion-item.active .bh-vertical-title { opacity: 0; pointer-events: none; }

.bh-expanded-content {
    position: absolute;
    inset: 0;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-30px);
    transition: opacity 0.5s ease 0.4s, transform 0.5s ease 0.4s;
    z-index: 2;
    overflow: hidden;
}
.bh-accordion-item.active .bh-expanded-content { opacity: 1; visibility: visible; transform: translateX(0); }

.bh-eyebrow { font-size: clamp(0.8rem, 2vw, 0.9rem); font-weight: 700; color: rgba(255,255,255,0.8); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.bh-headline { font-size: clamp(2rem, 4vw, 2.7rem); font-weight: 800; color: #fff; margin-bottom: 1.5rem; line-height: 1.2; text-shadow: 0 4px 10px rgba(0,0,0,0.5); max-width: 600px; }
.bh-desc { font-size: clamp(1rem, 2vw, 1.15rem); color: rgba(255,255,255,0.9); margin-bottom: 2.5rem; line-height: 1.6; max-width: 550px; }

.bh-actions { display: flex; gap: 15px; flex-wrap: wrap; justify-content: flex-start; }

/* ✅ أزرار الأكورديون باللون الأحمر */
.bh-btn-acc { 
    display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; 
    border-radius: 50px; font-weight: 700; font-size: 1rem; text-decoration: none; 
    transition: all 0.3s ease; 
    min-height: 48px;
}
.bh-btn-acc.primary { 
    background: linear-gradient(135deg, #ED1C24, #c41820); 
    color: #fff; 
    border: 2px solid #ED1C24; 
    box-shadow: 0 8px 20px rgba(237, 28, 36, 0.3);
}
.bh-btn-acc.primary:hover, 
.bh-btn-acc.primary:focus { 
    background: linear-gradient(135deg, #c41820, #a01419); 
    border-color: #c41820; 
    transform: translateY(-3px); 
    color: #fff; 
    box-shadow: 0 15px 30px rgba(237, 28, 36, 0.5);
}
.bh-btn-acc.white { background: #fff; color: #ED1C24; border: 2px solid #fff; }
.bh-btn-acc.white:hover, .bh-btn-acc.white:focus { background: #f8f9fa; transform: translateY(-2px); color: #c41820; }

@media (max-width: 991px) {
    .bh-accordion-container { height: 480px; }
    .bh-expanded-content { padding: 40px 30px; }
}
@media (max-width: 768px) {
    .bh-accordion-container { 
        flex-direction: column; 
        height: auto; 
        min-height: 600px; 
    }
    .bh-accordion-item { 
        flex: 0 0 70px; 
        width: 100%; 
    }
    .bh-accordion-item.active { 
        flex: 1 0 420px; 
    }
    .bh-vertical-title { 
        bottom: auto; 
        left: 30px; 
        right: auto;
        top: 50%; 
        transform: translateY(-50%) !important; 
        writing-mode: horizontal-tb !important; 
        text-orientation: mixed !important;
        width: auto; 
        white-space: nowrap;
    }
    .bh-accordion-item:hover:not(.active) .bh-vertical-title { 
        transform: translateY(-50%) !important; 
    }
    .bh-actions { 
        flex-direction: column; 
        align-items: stretch; 
    }
    .bh-btn-acc { 
        width: 100%; 
        justify-content: center; 
    }
}

/* ============================================================
   Why Choose Us
   ============================================================ */
.feature-card-centered { background: #ffffff; border: 1px solid #f1f5f9; padding: 45px 25px; border-radius: 28px; transition: all 0.4s ease; }
.feature-card-centered:hover { transform: translateY(-10px); box-shadow: 0 25px 50px rgba(0, 0, 0, 0.05); border-color: #e2e8f0; }

.icon-wrapper { width: 80px; height: 80px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #fff; margin-bottom: 25px; }
.bg-gradient-dark-grey { background: linear-gradient(135deg, #475569, #1e293b); }
.bg-gradient-success { background: linear-gradient(135deg, #22c55e, #16a34a); }
.bg-gradient-gold { background: linear-gradient(135deg, #f59e0b, #d97706); }

.feature-card-centered h4 { color: #0f172a; }
.feature-card-centered p { color: #64748b !important; line-height: 1.7; }

/* ============================================================
   Quick Cards, Stats, Program Cards
   ============================================================ */
.quick-card { display: block; background: white; border-radius: 20px; padding: 25px 20px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.05); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); height: 100%; text-decoration: none; border: 1px solid rgba(0,0,0,0.03); }
.quick-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(237,28,36,0.12); border-color: rgba(237,28,36,0.3); }
.quick-icon-wrapper { margin-bottom: 15px; }
.quick-icon { width: 70px; height: 70px; background: linear-gradient(135deg, rgba(237,28,36,0.08), rgba(237,28,36,0.15)); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; font-size: 1.8rem; color: #ED1C24; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.quick-card:hover .quick-icon { background: linear-gradient(135deg, #ED1C24, #c41820); color: white; transform: rotate(5deg) scale(1.1); }
.quick-card h4 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; color: #1e2a3a; }
.quick-card p { color: #6c757d; margin-bottom: 15px; font-size: 0.9rem; line-height: 1.5; }
.quick-link { color: #ED1C24; font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; }

.stat-card { 
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 20px; 
    padding: 25px 15px; 
    color: white; 
    position: relative; 
    overflow: hidden; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    height: 100%; 
}
.stat-card:hover { 
    transform: translateY(-5px); 
    background: rgba(255, 255, 255, 0.18); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.stat-number { font-size: 2.5rem; font-weight: 900; line-height: 1; margin-bottom: 8px; }
.stat-label { font-size: 1rem; font-weight: 600; opacity: 0.95; }
.stat-icon { position: absolute; bottom: -5px; left: -5px; font-size: 4rem; opacity: 0.15; transform: rotate(-15deg); }

/* ============================================================
   Calculator - إصلاح الرقم الطويل
   ============================================================ */
.calc-glass-container { background: white; border-radius: 30px; overflow: hidden; border: 1px solid rgba(0,0,0,0.05); }

.input-with-currency {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 2px solid #f4f7f6;
    border-radius: 12px;
    padding: 6px 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 240px;
    min-width: 140px;
    overflow: hidden;
}

.input-with-currency:focus-within {
    border-color: #ED1C24;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12);
}

.calc-text-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-weight: 800;
    font-size: 1.05rem;
    color: #1e2a3a;
    text-align: center;
    font-family: 'Cairo', sans-serif;
    padding: 4px 0;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.input-with-currency .currency-label {
    flex: 0 0 auto;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 700;
    pointer-events: none;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .input-with-currency {
        max-width: 180px;
        min-width: 120px;
        padding: 5px 10px;
        gap: 4px;
    }
    .calc-text-input {
        font-size: 0.95rem;
    }
    .input-with-currency .currency-label {
        font-size: 0.8rem;
    }
}

/* ✅ Quick Amounts - أزرار سريعة */
.quick-amounts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.quick-amounts button {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
}

.quick-amounts button:hover {
    background: #ED1C24;
    color: white;
    border-color: #ED1C24;
    transform: translateY(-2px);
}

/* ✅ Range Hints */
.range-hints {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 6px;
    font-weight: 600;
}

.custom-range-slider { 
    -webkit-appearance: none; 
    appearance: none; 
    width: 100%; 
    height: 8px; 
    border-radius: 10px; 
    background: #f4f7f6; 
    outline: none; 
    margin-top: 15px; 
    cursor: pointer;
}
.custom-range-slider::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    appearance: none; 
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    background: white; 
    cursor: pointer; 
    border: 5px solid #ED1C24; 
    box-shadow: 0 4px 10px rgba(237, 28, 36, 0.25); 
    transition: transform 0.1s; 
    box-sizing: border-box;
}
.custom-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.custom-range-slider::-moz-range-thumb { 
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    background: white; 
    cursor: pointer; 
    border: 5px solid #ED1C24; 
    box-shadow: 0 4px 10px rgba(237, 28, 36, 0.25); 
    box-sizing: border-box;
}
.custom-range-slider:focus-visible {
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.25);
}
.monthly-amount { font-size: 2.2rem; }

/* ============================================================
   News Cards
   ============================================================ */
.news-card-3d { background: white; border-radius: 24px; overflow: hidden; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,0.05); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid rgba(0,0,0,0.05); display: block; }
.news-card-3d:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.12); border-color: rgba(237,28,36,0.3); }
.news-img-box { height: 220px; position: relative; overflow: hidden; background: #f1f5f9; }
.news-img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.news-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.news-category-tag { position: absolute; top: 15px; right: 15px; padding: 6px 15px; border-radius: 50px; font-size: 0.8rem; z-index: 2; }
html[dir="rtl"] .news-category-tag { right: 15px; left: auto; }
html[dir="ltr"] .news-category-tag { left: 15px; right: auto; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.read-more-arrow { position: absolute; bottom: 20px; left: 20px; width: 40px; height: 40px; background: #f4f7f6; color: #1e2a3a; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
html[dir="rtl"] .read-more-arrow { left: 20px; right: auto; }
html[dir="ltr"] .read-more-arrow { right: 20px; left: auto; }
.news-card-3d:hover .read-more-arrow { background: #ED1C24; color: white; transform: rotate(-45deg); }

.newsSwiper .swiper-button-next, .newsSwiper .swiper-button-prev { background: white; width: 45px; height: 45px; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.05); color: #ED1C24; }
.newsSwiper .swiper-button-next:hover, .newsSwiper .swiper-button-prev:hover { background: #ED1C24; color: white; }
.newsSwiper .swiper-button-next::after, .newsSwiper .swiper-button-prev::after { font-size: 1.1rem; font-weight: 700; }
.newsSwiper .swiper-pagination-bullet { width: 10px; height: 10px; background: #6c757d; opacity: 0.4; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.newsSwiper .swiper-pagination-bullet-active { background: #ED1C24; width: 25px; border-radius: 5px; opacity: 1; }

/* ============================================================
   App Section
   ============================================================ */
.app-bg-decor { background-image: radial-gradient(rgba(255,255,255,0.2) 2px, transparent 2px); background-size: 30px 30px; }
.absolute-inset { position: absolute; inset: 0; }

.btn-app-store { 
    display: inline-flex; 
    align-items: center; 
    gap: 12px; 
    background: linear-gradient(135deg, #ED1C24, #c41820);
    border: 1px solid rgba(255, 255, 255, 0.3); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    color: white; 
    padding: 10px 20px; 
    border-radius: 16px; 
    text-decoration: none; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    min-width: 170px; 
    text-align: right; 
    box-shadow: 0 8px 20px rgba(237, 28, 36, 0.3);
}
.btn-app-store i { font-size: 1.8rem; flex-shrink: 0; }
.btn-app-store small { display: block; font-size: 0.7rem; opacity: 0.9; line-height: 1; margin-bottom: 2px; }
.btn-app-store span { display: block; font-size: 1.1rem; font-weight: 700; line-height: 1; }
.btn-app-store:hover { 
    background: linear-gradient(135deg, #c41820, #a01419);
    color: #ffffff !important; 
    transform: translateY(-5px); 
    box-shadow: 0 15px 30px rgba(237, 28, 36, 0.5); 
    border-color: white; 
}
.btn-app-store:hover small { color: rgba(255,255,255,0.9); }

@media (max-width: 991px) {
    .btn-app-store { padding: 8px 16px; min-width: 150px; }
    .btn-app-store i { font-size: 1.5rem; }
    .btn-app-store span { font-size: 1rem; }
}
@media (max-width: 576px) { .btn-app-store { width: 100%; justify-content: center; min-width: unset; margin-bottom: 5px; } }

.app-mockup-wrapper { perspective: 1000px; height: 450px; }
.tilt-box { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; }
.app-mockup-3d { position: absolute; border-radius: 30px; background: white; }
.main-phone { width: 220px; left: 50%; top: 50%; transform: translate(-50%, -50%) translateZ(20px); z-index: 2; }
.float-phone { width: 180px; right: 0; bottom: -20px; transform: translateZ(60px); z-index: 3; }

@media (max-width: 991px) {
    .calc-input-side, .calc-result-side { padding: 30px !important; }
    .app-mockup-wrapper { height: 350px; margin-top: 40px; }
    .main-phone { width: 180px; }
    .float-phone { width: 140px; }
}
@media (max-width: 767px) {
    .btn-primary, .btn-outline-light { width: 100%; justify-content: center; }
    .quick-card { padding: 15px 10px; }
    .quick-icon { width: 50px; height: 50px; font-size: 1.4rem; }
    .quick-card h4 { font-size: 1rem; }
}

/* ============================================================
   Cookie Banner
   ============================================================ */
.cookie-settings-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 10000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.cookie-settings-content { background: #fff; width: 95%; max-width: 700px; max-height: 85vh; border-radius: 25px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.2); }
.cookie-settings-header, .cookie-settings-footer { padding: 20px 30px; background: #f8fafc; display: flex; justify-content: space-between; align-items: center; }
.cookie-settings-body { padding: 30px; overflow-y: auto; }
.cookie-option { background: #f9fafb; padding: 20px; border-radius: 15px; margin-bottom: 20px; border: 1px solid #edf2f7; }
.cookie-option p { line-height: 1.8; color: #555; font-size: 0.9rem; margin-top: 10px; }

.switch { position: relative; display: inline-block; width: 45px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #ED1C24; }
input:checked + .slider:before { transform: translateX(21px); }

.cookie-banner { position: fixed; bottom: 20px; left: 20px; right: 20px; background: #ffffff; border-radius: 20px; padding: 20px; z-index: 9999; display: none; border: 1px solid rgba(0,0,0,0.05); }
@media (max-width: 767px) {
    .cookie-banner { bottom: 0; left: 0; right: 0; border-radius: 20px 20px 0 0; padding: 25px 15px; }
    .w-100-mobile { width: 100%; margin-bottom: 10px; }
    .cookie-banner .text-section { text-align: center; }
    .cookie-banner i { display: none; }
}

/* ============================================================
   Footer Improvements
   ============================================================ */
footer a { transition: all 0.2s ease; }
footer a:hover { color: var(--secondary) !important; padding-inline-start: 4px; }

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    overflow: hidden;
}

/* ============================================================
   Accessibility Helpers
   ============================================================ */
*:focus-visible {
    outline: 3px solid rgba(237, 28, 36, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

button, a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* منع السكرول الأفقي */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* تكبير حقول الإدخال على iOS لمنع zoom */
@media screen and (max-width: 767px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}