/* تصفير الإعدادات الافتراضية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0d0d0d; /* أسود فخم مطفي */
    color: #ffffff;
    font-family: 'Syne', 'Cairo', sans-serif;
    padding: 40px 20px;
    line-height: 1.6;
}

/* تنسيق الهيدر */
.main-header {
    text-align: center;
    margin-bottom: 60px;
    max-width: 600px;
    margin-right: auto;
    margin-left: auto;
}

.main-header .logo {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 15px;
}

.main-header .bio {
    color: #888888; /* لون رمادي خفيف للنصوص الثانوية */
    font-size: 1.1rem;
}

/* شبكة توزيع الأعمال المجاوبة للجوال والكمبيوتر */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px; /* المسافة بين المربعات */
    max-width: 1200px;
    margin: 0 auto;
}

/* تنسيق كرت المشروع */
.project-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1; /* يجعل المربعات متساوية الطول والعرض تماماً */
    background-color: #1a1a1a;
    cursor: pointer;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* التأثير الظلي والنصوص عند تمرير الماوس (Hover) */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.project-card:hover img {
    transform: scale(1.05); /* زووم خفيف للصورة عندHover */
}

.project-card:hover .card-overlay {
    opacity: 1; /* إظهار النص والظل عند الـ Hover */
}

.card-overlay h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.card-overlay p {
    color: #b3b3b3;
    font-size: 0.9rem;
}

/* فوتر التواصل */
.main-footer {
    text-align: center;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid #222;
}

.main-footer p {
    color: #888;
    margin-bottom: 15px;
}

.social-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    font-weight: 700;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #888;
}

/* إعدادات النافذة الخلفية المظلمة */
.modal {
    display: none; /* مخفية تلقائياً */
    position: fixed;
    z-index: 1000; /* لتكون فوق كل عناصر الموقع */
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95); /* خلفية سوداء شبه شفافة */
    overflow: auto;
}

/* تنسيق الصورة بداخل النافذة */
.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh; /* لا تتعدى 80% من طول الشاشة لتناسب الجوالات */
    object-fit: contain; /* تحافظ على أبعاد وتفاصيل الديزاين الأصلية */
    border-radius: 8px;
    
    /* حركة ناعمة لظهور الصورة */
    animation-name: zoomIn;
    animation-duration: 0.3s;
}

@keyframes zoomIn {
    from {transform: scale(0.8); opacity: 0;} 
    to {transform: scale(1); opacity: 1;}
}

/* زر الإغلاق (X) */
.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    color: #888;
}

/* تنسيق قسم السيرة الذاتية الاحترافي */
.cv-section {
    padding: 80px 20px;
    background-color: #0c0c0c;
    color: #ffffff;
    direction: rtl;
    text-align: right;
}

.cv-main-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.cv-column {
    flex: 1;
    min-width: 300px;
}

.cv-block {
    background-color: #141414;
    border: 1px solid #222;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.block-title {
    font-size: 1.4rem;
    color: #ffffff;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cv-item {
    margin-bottom: 20px;
    border-right: 3px solid #444;
    padding-right: 15px;
}

.cv-item h4 {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 5px;
}

.cv-item p {
    color: #aaa;
    font-size: 0.95rem;
}

.cv-date {
    display: inline-block;
    font-size: 0.85rem;
    color: #888;
    background-color: #222;
    padding: 2px 10px;
    border-radius: 20px;
    margin-top: 5px;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background-color: #222;
    color: #eee;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    border: 1px solid #333;
}

.cv-list {
    list-style: none;
    padding: 0;
}

.cv-list li {
    margin-bottom: 12px;
    color: #ccc;
    position: relative;
    padding-right: 20px;
}

.cv-list li::before {
    content: "✦";
    color: #888;
    position: absolute;
    right: 0;
}

/* تنسيق زر التحميل */
.cv-download-zone {
    text-align: center;
    margin-top: 20px;
}

.btn-download-cv {
    display: inline-block;
    padding: 14px 35px;
    background-color: #ffffff;
    color: #000000;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.btn-download-cv:hover {
    background-color: #dddddd;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .cv-main-grid {
        gap: 20px;
    }
    .cv-block {
        padding: 20px;
    }
}