/* ---------------------------------------------------- */
/* التصميم النهائي: الاحترافية القصوى والحركة (الأبيض/الأخضر) */
/* ---------------------------------------------------- */

/* الألوان: White (#FFFFFF), Black (#111111), Teal Green (#00A99D), Light Gray (#F5F5F5) */

/* الحركة: ظهور العناصر ببطء عند تحميل الصفحة/التمرير */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* الحركة: نبض شريط المهارات */
@keyframes skillPulse {
    0% {
        box-shadow: 0 0 0px rgba(0, 169, 157, 0.6);
    }
    50% {
        box-shadow: 0 0 8px rgba(0, 169, 157, 0.8);
    }
    100% {
        box-shadow: 0 0 0px rgba(0, 169, 157, 0.6);
    }
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* تثبيت خط كايرو كخط رئيسي لضمان الاستقرار */
    font-family: 'Cairo', sans-serif; 
}

body {
    background-color: #FFFFFF; 
    color: #111111;
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden; 
}

.main-layout {
    display: flex;
    width: 100%;
}

/* 1. الشريط الجانبي (Sidebar) */
.sidebar {
    width: 280px;
    background-color: #F5F5F5; 
    padding: 30px 20px;
    position: fixed;
    top: 0;
    height: 100%;
    overflow-y: auto;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05); 
    transition: all 0.3s ease-in-out;
    border-left: 5px solid #00A99D; 
}

/* توجيه RTL/LTR */
[dir="rtl"] .sidebar { right: 0; left: auto; border-left: 5px solid #00A99D; border-right: none; }
[dir="ltr"] .sidebar { left: 0; right: auto; border-right: 5px solid #00A99D; border-left: none; }


.name {
    color: #111111; 
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 5px;
    border-bottom: 3px solid #00A99D;
    display: inline-block;
    padding-bottom: 5px;
}

.title {
    color: #00A99D;
    font-size: 0.9em;
    margin-bottom: 25px;
    font-weight: 600;
}

.lang-switch a { color: #888; transition: color 0.2s; }
.lang-switch a:hover { color: #00A99D; }

.nav-menu a {
    display: block;
    color: #333333;
    padding: 12px 10px;
    text-decoration: none;
    font-size: 1em;
    border-bottom: 1px solid #E0E0E0;
    transition: all 0.2s ease-in-out;
}

/* الحركة: تحريك الروابط عند التمرير عليها */
.nav-menu a:hover {
    background-color: rgba(0, 169, 157, 0.1); 
    color: #00A99D;
    border-right: 4px solid #00A99D;
    padding-right: 20px; 
}
[dir="ltr"] .nav-menu a:hover {
    border-right: none;
    border-left: 4px solid #00A99D;
    padding-right: 10px;
    padding-left: 20px;
}

/* 2. منطقة المحتوى */
.content-area {
    padding: 40px;
    flex-grow: 1;
}
[dir="rtl"] .content-area { margin-right: 280px; }
[dir="ltr"] .content-area { margin-left: 280px; }

/* تطبيق حركة الظهور على كل قسم (Section) */
.section {
    opacity: 0; 
    animation: fadeInUp 1s ease-out forwards;
    padding-bottom: 40px;
}
/* تأخير الحركة لكل قسم */
#skills { animation-delay: 0.2s; }
#memberships { animation-delay: 0.4s; }
#courses { animation-delay: 0.6s; }
#contact { animation-delay: 0.8s; }


.section-title {
    color: #111111;
    font-size: 2em;
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 3px solid #00A99D;
    font-weight: 700;
}

.content-block p {
    color: #333333;
    line-height: 1.7;
}

/* 3. تصميم المهارات */
.skill-bar {
    background-color: #E0E0E0;
    height: 10px;
    border-radius: 5px;
}
.skill-level {
    background-color: #00A99D;
    animation: skillPulse 2s infinite alternate; 
    transition: width 1s ease-out; 
}

/* 4. العضويات (بطاقات نظيفة) */
.memberships-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.membership-item {
    padding: 20px;
    border: 1px solid #CCCCCC;
    background-color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 8px;
    text-align: center;
}

.membership-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 169, 157, 0.2);
    border-color: #00A99D;
}

.logo-image {
    max-width: 120px; 
    height: 60px;
    object-fit: contain;
    filter: grayscale(0); 
    margin-bottom: 15px;
}
.membership-item h3 {
    color: #00A99D;
    font-size: 1.1em;
}

/* 5. تصميم وحدة الشهادات (Certifications Widget) - (تم إصلاح التداخل) */
.courses-list {
    background-color: #F5F5F5; 
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #CCCCCC;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    display: flex; 
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease-in-out;
}

.courses-list:hover {
    box-shadow: 0 10px 25px rgba(0, 169, 157, 0.3); 
    transform: translateY(-5px);
}

/* إضافة أيقونة وهمية للشهادة */
.courses-list::before {
    content: '🎓'; 
    font-size: 3em;
    color: #00A99D;
    margin-bottom: 15px;
    animation: skillPulse 2s infinite alternate; 
}

.courses-list p {
    color: #333333;
    margin-bottom: 20px;
    font-size: 1.1em;
    max-width: 600px;
    width: 100%; /* ضمان أن النص يأخذ عرضه الطبيعي */
    padding: 0 10px;
}

/* 6. الأزرار (Buttons) */
.btn {
    background-color: #00A99D; 
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #008f83; 
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 169, 157, 0.4);
}

/* إصلاح مشكلة تداخل زر الشهادات */
.courses-list .btn {
    padding: 12px 30px;
    font-size: 1em;
    display: block; /* **الحل: جعل الزر كتلة منفصلة تأخذ سطراً جديداً** */
    margin-top: 5px;
    margin-left: auto; /* لتوسيط الزر */
    margin-right: auto;
}

/* 7. الفوتر */
footer {
    background-color: #EFEFEF;
    color: #555555;
    border-top: 1px solid #CCCCCC;
    padding: 15px;
    margin-top: 50px;
    font-size: 0.9em;
    text-align: center;
}

/* 8. التجاوب (Media Queries) */
@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-left: none;
        border-right: none;
        border-bottom: 5px solid #00A99D;
    }
    .content-area {
        margin-right: 0;
        margin-left: 0;
        padding: 20px;
    }
    .memberships-grid {
        grid-template-columns: 1fr;
    }
}