/* ============================================
   CUSTOM CSS VARIABLES - ألوان مستخرجة من الصورة
   ============================================ */
:root {
    --color-primary-green: #00b549;
    --color-primary-blue: #0c62f5;
    --color-accent-yellow: #fdb813;
    --color-text-dark: #0f4c81;
    --color-text-light: #ffffff;
    --color-background-light: #f7f9fc;
    --color-background-dark: #020f24;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Tajawal', sans-seFrif;
    color: var(--color-text-dark);
    background-color: #fff;
    overflow-x: hidden;
}

/* ============================================
   HEADER STYLES - هيدر احترافي مع تأثيرات
   ============================================ */
.modern-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-speed) ease;
}

.header-scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 1);
}

.nav-link {
    position: relative;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    color: var(--color-text-dark);
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
}

.nav-link i {
    transition: transform var(--transition-speed) ease;
}

.nav-link:hover i {
    transform: scale(1.2) rotate(10deg);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 50%;
    background: linear-gradient(90deg, var(--color-primary-blue), var(--color-primary-green));
    transition: all var(--transition-speed) ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link:hover {
    color: var(--color-primary-green);
    background: rgba(0, 181, 73, 0.05);
}

/* ============================================
   BUTTONS - أزرار خيالية مع تأثيرات
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-blue) 0%, var(--color-primary-green) 100%);
    color: var(--color-text-light);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(12, 98, 245, 0.4);
}

.btn-outline-green {
    border: 2px solid var(--color-primary-green);
    color: var(--color-primary-green);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.btn-outline-green::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--color-primary-green);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    z-index: -1;
}

.btn-outline-green:hover::before {
    width: 300%;
    height: 300%;
}

.btn-outline-green:hover {
    color: var(--color-text-light);
    border-color: var(--color-primary-green);
    transform: translateY(-3px);
}

/* ============================================
   ANIMATED BACKGROUND ICONS - أيقونات متحركة
   ============================================ */
.animated-bg-icons {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.whatsapp-bg-icon {
    position: absolute;
    color: var(--color-primary-green);
    opacity: 0;
    animation: float-fade 20s ease-in-out infinite;
    will-change: transform, opacity;
    filter: blur(1px);
}

.whatsapp-bg-icon.fa-check-double {
    color: var(--color-primary-blue);
}

.whatsapp-bg-icon.fa-comments {
    color: var(--color-accent-yellow);
}

.whatsapp-bg-icon:nth-child(1) { top: 10%; left: 5%; font-size: 3rem; animation-duration: 20s; animation-delay: 0s; }
.whatsapp-bg-icon:nth-child(2) { top: 20%; left: 50%; font-size: 2rem; animation-duration: 15s; animation-delay: 2s; }
.whatsapp-bg-icon:nth-child(3) { top: 70%; left: 80%; font-size: 5rem; animation-duration: 18s; animation-delay: 1s; }
.whatsapp-bg-icon:nth-child(4) { top: 80%; left: 10%; font-size: 2.5rem; animation-duration: 22s; animation-delay: 5s; }
.whatsapp-bg-icon:nth-child(5) { top: 40%; left: 90%; font-size: 3rem; animation-duration: 17s; animation-delay: 3s; }
.whatsapp-bg-icon:nth-child(6) { top: 50%; left: 30%; font-size: 2rem; animation-duration: 19s; animation-delay: 4s; }
.whatsapp-bg-icon:nth-child(7) { top: 15%; left: 75%; font-size: 2.8rem; animation-duration: 21s; animation-delay: 6s; }
.whatsapp-bg-icon:nth-child(8) { top: 60%; left: 15%; font-size: 3.5rem; animation-duration: 16s; animation-delay: 7s; }

@keyframes float-fade {
    0% { transform: translateY(20px) rotate(0deg); opacity: 0; }
    25% { opacity: 0.08; transform: translateY(-10px) rotate(5deg); }
    50% { opacity: 0.15; transform: translateY(-30px) rotate(-5deg); }
    75% { opacity: 0.08; transform: translateY(-10px) rotate(3deg); }
    100% { transform: translateY(20px) rotate(0deg); opacity: 0; }
}

/* ============================================
   TYPING ANIMATION - تأثير الكتابة
   ============================================ */
.typing-icon {
    color: var(--color-accent-yellow);
    margin-left: 10px;
    font-size: 0.8em;
    animation: pen-wave 1.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(253, 184, 19, 0.4));
}

@keyframes pen-wave {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(10deg); }
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.1em;
    background-color: var(--color-accent-yellow);
    animation: blink 0.7s infinite;
    margin-right: 5px;
    position: relative;
    top: 4px;
    box-shadow: 0 0 10px var(--color-accent-yellow);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   ANIMATED TITLE - العنوان المتحرك
   ============================================ */
@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.slide-out-left {
    animation: slideOutLeft 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* ============================================
   FEATURE CARDS - بطاقات خيالية
   ============================================ */
.feature-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 181, 73, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(15, 76, 129, 0.15);
}

.service-icon {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

.feature-card:hover .service-icon {
    transform: scale(1.2) rotate(-10deg);
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
}

/* ============================================
   FLOATING ANIMATION - حركة الطفو
   ============================================ */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* ============================================
   SLIDE IN ANIMATION - حركة الظهور
   ============================================ */
.slide-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in.appear {
    opacity: 1;
    transform: translateY(0);
}




/* ============================================
   MOBILE MENU - قائمة الموبايل
   ============================================ */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease-in-out;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 990;
    padding: 0 1rem;
}

.mobile-menu.open {
    max-height: 600px;
    padding-bottom: 1.5rem;
}

.dark .mobile-menu {
    background: rgba(30, 30, 30, 0.98);
}

.hamburger {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    outline: none;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background: linear-gradient(90deg, var(--color-primary-blue), var(--color-primary-green));
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

.hamburger:hover span {
    background: linear-gradient(90deg, var(--color-primary-green), var(--color-primary-blue));
}




/* ============================================
   GRADIENT TEXT - نص متدرج
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--color-primary-blue), var(--color-primary-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   ICON PULSE - نبض الأيقونات
   ============================================ */
.icon-pulse {
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ============================================
   GLOW EFFECT - تأثير التوهج
   ============================================ */
.glow {
    box-shadow: 0 0 20px rgba(0, 181, 73, 0.3);
}

.glow:hover {
    box-shadow: 0 0 30px rgba(0, 181, 73, 0.5);
}

/* ============================================
   SCROLL TO TOP BUTTON - زر العودة للأعلى
   ============================================ */
#backToTop {
    transition: all var(--transition-speed) ease;
}

#backToTop:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 181, 73, 0.4);
}

/* ============================================
   MODAL STYLES - أنماط المودال
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 800px;
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: slideInModal 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideInModal {
    from {
        transform: translateY(-100px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--color-primary-blue) 0%, var(--color-primary-green) 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 30px;
}

.close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    opacity: 0.9;
    line-height: 1;
}

.close:hover {
    color: var(--color-accent-yellow);
    opacity: 1;
    transform: rotate(90deg) scale(1.2);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .typing-icon {
        font-size: 1em;
    }

    .whatsapp-bg-icon {
        font-size: 2rem !important;
    }
}

/* ============================================
   CUSTOM SCROLLBAR - شريط التمرير المخصص
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-background-light);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-primary-blue), var(--color-primary-green));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-green);
}

/* ============================================
   DARK MODE SUPPORT - دعم الوضع الداكن
   ============================================ */
.dark body {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.dark .modern-header {
    background: rgba(30, 30, 30, 0.98);
}

.dark .nav-link {
    color: #e0e0e0;
}

.dark .feature-card {
    background-color: #2a2a2a !important;
    border-color: #3a3a3a;
}

.dark .modal-content {
    background-color: #2a2a2a;
}

.dark .modal-body {
    color: #e0e0e0;
}

.dark .modal-body h3 {
    color: var(--color-primary-green);
}

.dark .modal-body p,
.dark .modal-body li {
    color: #c0c0c0;
    
}



/* ============================================
   (جديد) تنسيقات السلايدر (Swiper)
   ============================================ */
.swiper-container {
    width: 100%;
    /* إضافة مساحة سفلية للنقاط */
    padding-bottom: 50px !important; 
    overflow: hidden; /* إخفاء أي تجاوز أفقي */
}

.swiper-slide {
    height: auto; /* يجعل السلايد يتمدد حسب المحتوى */
    display: flex;
    justify-content: center;
    align-items: stretch; /* يضمن أن جميع البطاقات بنفس الارتفاع */
}

/* تخصيص نقاط التنقل (Pagination) لتناسب تصميمك */
.swiper-pagination-bullet {
    background: var(--color-primary-blue) !important;
    opacity: 0.5 !important;
    width: 10px !important;
    height: 10px !important;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: var(--color-primary-green) !important;
    width: 25px !important;
    border-radius: 5px !important;
    opacity: 1 !important;
}

/* ============================================
   (جديد) تنسيقات القلم المتحرك للعناوين
   ============================================ */
.animated-title {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* لإصلاح مشكلة بسيطة في العرض على بعض المتصفحات */
    flex-wrap: wrap; 
}

.title-pen-icon {
    color: var(--color-accent-yellow);
    margin-left: 12px;
    font-size: 0.8em; /* أصغر من الأيقونة في الهيرو */
    animation: pen-wave 1.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(253, 184, 19, 0.4));
}

/* (ملاحظة: هذا الكود مكرر من الهيرو، إذا كان موجوداً في ملفك، لا داعي لتكراره) */
@keyframes pen-wave {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(10deg); }
}



/* ============================================
   (جديد) تنسيقات تأثير الكتابة للعناوين
   ============================================ */
.animated-title .title-text-container {
    /* لإخفاء النص في البداية */
    display: inline-block; 
    position: relative;
    vertical-align: middle; /* لمحاذاة النص مع الأيقونة */
}

/* حالة النص قبل بدء الكتابة (يكون فارغاً) */
.animated-title .title-text-container:empty {
    min-width: 1px; /* للحفاظ على المساحة */
}

/* مؤشر الكتابة الوامض للعناوين */
.title-typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em; /* ارتفاع مناسب للعنوان */
    background-color: var(--color-accent-yellow);
    animation: blink 0.7s infinite;
    margin-right: 5px; /* مسافة بين المؤشر والنص */
    position: relative;
    top: 3px; /* تعديل بسيط للمحاذاة العمودية */
    box-shadow: 0 0 8px var(--color-accent-yellow);
    opacity: 0; /* يبدأ مخفياً */
    transition: opacity 0.1s;
}

/* إظهار المؤشر عند بدء الكتابة */
.animated-title.typing .title-typing-cursor {
    opacity: 1;
}

/* حركة القلم أثناء الكتابة */
.animated-title .title-pen-icon {
    transition: transform 0.1s ease-out; /* حركة ناعمة وسريعة */
}

.animated-title.typing .title-pen-icon {
    /* حركة اهتزاز بسيطة جداً لمحاكاة الكتابة */
    animation: writing-shake 0.2s infinite; 
}

@keyframes writing-shake {
    0%, 100% { transform: translate(0, 0) rotate(-5deg); }
    25% { transform: translate(1px, -1px) rotate(-4deg); }
    50% { transform: translate(0, 1px) rotate(-6deg); }
    75% { transform: translate(-1px, 0) rotate(-5deg); }
}

/* (ملاحظة: هذا الكود مكرر من الهيرو، إذا كان موجوداً في ملفك، لا داعي لتكراره) */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}


