/* --- استيراد الخط --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* --- المتغيرات والألوان --- */
:root {
    --bg-color: #000000;
    --second-bg-color: #1a1a1a;
    --text-color: #fff;
    --main-color: #D4AF37;
}

/* --- تصفير الإعدادات الأساسية --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* --- تنسيق الهيدر (Navbar) --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 9%;
    background: #1a1a1a; /* لون الخلفية عشان يغطي اللي تحته */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000; /* رقم عالي عشان يفضل فوق كل حاجة */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: 1.8rem;
    color: var(--text-color);
    font-weight: 700;
    white-space: nowrap; /* يمنع نزول الاسم سطرين */
}

.logo span {
    color: var(--main-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 3rem;
}

.nav-links a {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 500;
    transition: .3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--main-color);
}

/* --- تنسيق القسم الرئيسي (Hero Section) --- */
section {
    min-height: 100vh;
    padding: 10rem 9% 2rem;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.hero-content {
    flex: 1;
}

.hero-content h3 {
    font-size: 2rem;
    font-weight: 700;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.3;
}

.hero-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--main-color);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* أيقونات السوشيال ميديا */
.social-icons a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    border: 2px solid var(--main-color);
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--main-color);
    margin: 0 1rem 2rem 0;
    transition: .5s ease;
}

.social-icons a:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    box-shadow: 0 0 20px var(--main-color);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--main-color);
    border-radius: 2rem;
    box-shadow: 0 0 10px var(--main-color);
    font-size: 1.2rem;
    color: var(--second-bg-color);
    letter-spacing: 1px;
    font-weight: 600;
    transition: .5s ease;
}

/* --- تنسيق الصورة --- */
.hero-img {
    flex: 1;
    display: flex;
    justify-content: center;
}

.img-box {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    border: 5px solid var(--main-color);
    box-shadow: 0 0 20px var(--main-color);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.5s;
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- باقي الأقسام --- */
.heading {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
}
.heading span { color: var(--main-color); }

.about-content, .contact-form, .skill-card, .project-card {
    background: var(--second-bg-color);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
}

.skills-container, .projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card i { font-size: 3rem; color: var(--main-color); margin-bottom: 1rem; }
.tags span { display: inline-block; background: #000; color: var(--main-color); padding: 5px 10px; border-radius: 5px; font-size: 0.8rem; margin: 5px; }
.links { margin-top: 1.5rem; }
.btn-small { display: inline-block; padding: 0.5rem 1.5rem; border: 2px solid var(--main-color); color: var(--main-color); border-radius: 2rem; font-weight: 600; transition: 0.3s; }

/* Contact Styles */
.contact-container {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}
.contact-info { flex: 1; max-width: 500px; text-align: left; }
.info-box .item { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.info-box .item i { font-size: 1.2rem; color: var(--main-color); width: 45px; height: 45px; background: var(--second-bg-color); border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.contact-form { flex: 1; max-width: 600px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 1rem; background: var(--bg-color); color: white; margin-bottom: 1rem; border-radius: 0.5rem; }

footer {
    background: var(--second-bg-color);
    padding: 2rem 9%;
    text-align: center;
    margin-top: auto;
}

/* ================================================= */
/* === التعديلات الخاصة بالموبايل (الحل الجذري) === */
/* ================================================= */

@media (max-width: 991px) {
    header { padding: 2rem 3%; }
    section { padding: 10rem 3% 2rem; }
    .contact-info { text-align: center; }
    .info-box .item { justify-content: center; }
}

@media (max-width: 768px) {
    
    /* 1. تظبيط الهيدر واللينكات */
    header {
        flex-direction: column;
        padding: 1rem 3%;
        gap: 1rem; /* مسافة بين اللوجو واللينكات */
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        margin: 0;
        gap: 15px; /* مسافة واضحة بين كل لينك والتاني */
    }

    .nav-links li {
        margin: 0; /* الغاء الهوامش القديمة */
    }

    .nav-links a {
        font-size: 0.9rem; /* تصغير الخط شوية عشان يساعوا */
        padding: 5px;
    }

    /* 2. تظبيط ترتيب الصفحة الرئيسية */
    section {
        padding-top: 13rem; /* مسافة كبيرة من فوق عشان الهيدر ميعملش زحمة */
    }

    .hero {
        flex-direction: column-reverse; /* اعكس الترتيب: الكلام الأول وبعدين الصورة تحت */
        text-align: center;
        gap: 2rem;
    }

    /* 3. تظبيط الصورة */
    .img-box {
        width: 220px; /* تصغير الصورة في الموبايل */
        height: 220px;
        margin: 0 auto; /* توسيط الصورة */
    }

    /* 4. تظبيط حجم الخطوط */
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-content h3 {
        font-size: 1.4rem;
    }

    .heading {
        font-size: 2.2rem;
    }
}
