/* ------------------------------------- */
/* 1. التنسيقات الأساسية والخطوط */
/* ------------------------------------- */

/* متغيرات CSS لتوحيد الألوان والتظليل */
:root {
    /* الألوان الأساسية */
    --primary-color: #1A1A1A;     /* اللون الداكن (للشريط الجانبي/الأزرار) */
    --secondary-color: #fff;      /* اللون الفاتح (للخلفية) */
    --accent-color: #1f8ffc;      /* لون التمييز (الأزرق الجديد) */
    --text-color: #333;           /* لون النص الأساسي */
    --sidebar-text-color: #f4f4f4; /* لون نص الشريط الجانبي */
    --hover-color: #007bff;       /* لون التحويم لزر CV */
    
    /* متغيرات الـ Box Shadow */
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.1);
}

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

/* تحسين التركيز لجميع العناصر التفاعلية (Accessibility) */
a:focus, button:focus, input:focus, textarea:focus {
    outline: none; 
    /* استخدام لون التمييز */
    box-shadow: 0 0 0 3px rgba(31, 143, 252, 0.5); 
    border-radius: 4px; 
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; 
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: var(--text-color);
}

h1, h2, h3 {
    margin-bottom: 0.8rem;
    font-weight: 700;
}

h2 {
    font-size: 1.6rem;
    color: var(--primary-color);
    /* تخفيف سمك خط الفصل */
    border-bottom: 1px solid #ddd; 
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* ------------------------------------- */
/* 2. تقسيم الصفحة الرئيسية (Flexbox Layout) */
/* ------------------------------------- */

.portfolio-container {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    min-height: 100vh;
}

/* ------------------------------------- */
/* 3. الشريط الجانبي الداكن (.sidebar) */
/* ------------------------------------- */

.sidebar {
    width: 350px;
    background-color: var(--primary-color); 
    color: var(--sidebar-text-color);
    padding: 30px;
    flex-shrink: 0;
    position: relative;
}

/* تنسيق رأس الشريط الجانبي (الصورة، الاسم) */
.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* تعديلاتك: حجم 250px وشكل مربع بزوايا مستديرة (10%) */
.profile-image-container {
    width: 250px; 
    height: 250px;
    border-radius: 10%; 
    overflow: hidden;
    margin: 0 auto 15px;
    border: 4px solid var(--secondary-color); 
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.job-title {
    color: #d1d1d1;
    font-size: 1.1rem;
    font-weight: 300;
}

/* العناوين والأقسام في الشريط الجانبي */
.sidebar h2 {
    color: var(--secondary-color);
    border-bottom: 2px solid #555;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.section {
    padding: 1.5rem 0;
}

/* قسم المهارات (Skills) - قائمة المهارات الأخرى */
.skills-list {
    list-style: none;
}

.skills-list li {
    margin-bottom: 0.6rem;
}

.skills-list i {
    margin-right: 8px;
    color: var(--accent-color); 
}

/* قسم التواصل (Connect) */
.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.contact-item i {
    width: 25px;
    color: var(--accent-color); 
    text-align: center;
    margin-inline-end: 10px; 
}

.contact-item span, .contact-item a {
    color: var(--sidebar-text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: #a0e0ff;
}

/* تنسيق أشرطة التقدم للمهارات */

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-label {
    margin-bottom: 5px;
    font-size: 1rem;
    color: var(--sidebar-text-color);
}

.skill-label i {
    color: var(--accent-color); 
    margin-right: 8px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #333; 
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color); 
    border-radius: 4px;
    transition: width 1s ease-in-out; 
}

/* ------------------------------------- */
/* 4. المحتوى الرئيسي الفاتح (.main-content) */
/* ------------------------------------- */

.main-content {
    flex-grow: 1; 
    background-color: var(--secondary-color);
    padding: 40px 50px;
    /* استخدام متغير الـ Shadow */
    box-shadow: var(--shadow-light); 
}

.content-section {
    margin-bottom: 3rem;
}

/* ------------------------------------- */
/* 5. تصميم المشاريع (Featured Projects) */
/* ------------------------------------- */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px;
}

.project-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--secondary-color);
    transition: box-shadow 0.3s;
}

.project-item:hover {
    box-shadow: var(--shadow-hover);
}

.project-item img {
    width: 100%;
    height: 270px;
    object-fit: cover;
}

.project-item h3 {
    padding: 15px 15px 5px;
    font-size: 1.25rem;
    color: var(--text-color);
}

.project-item p {
    padding: 0 15px 10px;
    font-size: 0.95rem;
    color: #666;
    overflow: hidden; 
    text-align: justify; 
}

.project-links {
    display: block; 
    padding: 15px;
    border-top: 1px solid #eee;
    text-align: center; 
}

.project-links a {
    display: block; 
    padding: 10px; 
    background-color: transparent; 
    border: 1px solid transparent; 
    border-radius: 4px; 
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: background-color 0.3s, border-color 0.3s; 
}

.project-links a i {
    margin-right: 5px;
    color: var(--accent-color);
}

.project-links a:hover {
    color: var(--primary-color);
    background-color: #f0f0f0; 
    border-color: #ddd; 
}

/* ------------------------------------- */
/* 6. تصميم الخط الزمني (Timeline Effect) */
/* ------------------------------------- */

.timeline {
    list-style: none;
    position: relative;
    padding: 10px 0;
    margin-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background-color: #ddd;
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
    padding-left: 30px;
}

.timeline-dot {
    content: '';
    position: absolute;
    top: 5px;
    left: -7px;
    width: 14px;
    height: 14px;
    background-color: var(--primary-color); 
    border: 3px solid var(--accent-color); 
    border-radius: 50%;
}

.timeline-date {
    font-size: 0.9rem;
    color: #999;
    font-weight: 400;
}

.timeline-item h3 {
    margin: 5px 0;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.company-name {
    color: var(--accent-color);
    font-weight: 500;
    margin-bottom: 5px;
}

.description {
    font-size: 0.95rem;
    color: #555;
}

/* ------------------------------------- */
/* 7. تصميم نموذج الاتصال (Contact Form) */
/* ------------------------------------- */

.contact-form-section {
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.contact-form p {
    margin-bottom: 1.5rem;
    color: #666;
}

.form-group {
    margin-bottom: 1rem;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.contact-form textarea {
    resize: vertical;
}

.btn-submit {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color); 
    color: var(--secondary-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-submit:hover {
    background-color: #333;
}

/* تنسيق رسالة النجاح (UX Enhancement) */
.form-message {
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #e6f7ff; 
    color: #004d99; 
    border: 1px solid #b3e0ff;
    border-radius: 4px;
    font-weight: 500;
    opacity: 0; /* نبدأ بإخفاء الرسالة */
    transition: opacity 0.5s ease-in-out;
}

.form-message.success {
    opacity: 1;
}

/* ------------------------------------- */
/* 9. زر الـ CV الثابت (Fixed CV Button) */
/* ------------------------------------- */

.fixed-cv-button {
    position: fixed; 
    bottom: 6%; 
    left: 8%; 
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background-color: var(--accent-color); 
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px; 
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); 
    z-index: 1000;
    transition: background-color 0.3s, transform 0.2s;
    width: auto; 
    overflow: visible;
}

.fixed-cv-button i {
    margin-right: 8px;
    font-size: 1.2rem;
}

.fixed-cv-button:hover {
    background-color: var(--hover-color); 
    transform: translateY(-2px); 
}

/* تطبيق تأثير التركيز على الزر الثابت بشكل منفصل */
.fixed-cv-button:focus {
    background-color: var(--hover-color); 
    transform: translateY(-2px); 
    box-shadow: 0 0 0 4px rgba(31, 143, 252, 0.7); /* إطار تركيز أكثر وضوحًا */
}

/* ------------------------------------- */
/* 10. تصميم الاستجابة (Responsive Design) */
/* ------------------------------------- */

@media (max-width: 900px) {
    .portfolio-container {
        flex-direction: column; 
        margin: 0; 
        box-shadow: none;
    }

    .sidebar {
        width: 100%; 
        padding: 30px 20px;
    }
    
    .main-content {
        padding: 30px 20px;
        box-shadow: none;
    }

    .profile-image-container {
        width: 150px; 
        height: 150px;
        border-radius: 10%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .fixed-cv-button {
        bottom: 15px;
        left: 15px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}