:root {
    --primary: #3b2722;
    --secondary: #8b5e3c;
    --accent: #d7b594;
    --bg-light: #fdfaf5;
    --bg-dark: #1b1613;
    --text-light: #3e2723;
    --text-dark: #efebe9;
    --transition: 0.4s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

body.light-theme {
    background: var(--bg-light);
    color: var(--text-light);
}

body.dark-theme {
    background: var(--bg-dark);
    color: var(--text-dark);
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 8%;
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-theme nav {
    background: rgba(27, 22, 19, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-links a {
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-light);
    transition: var(--transition);
    font-weight: 500;
}

body.dark-theme .nav-links a {
    color: var(--text-dark);
}

.nav-links a:hover {
    background: var(--secondary);
    color: white;
    border-radius: 5px;
}

.nav-controls {
    display: flex;
    gap: 10px;
}

.nav-controls button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

/* --- [بداية تعديل الـ Hero في مكانه] --- */
.hero {
    min-height: 100vh;
    /* تغيير الارتفاع ليكون مرنًا */
    display: flex;
    align-items: center;
    padding: 120px 8%;
    /* مسافة علوية كافية أسفل الـ Nav */
}

.hero-container {
    display: flex;
    justify-content: space-between;
    /* توزيع العناصر على الجوانب */
    align-items: center;
    width: 100%;
    gap: 50px;
    /* فجوة معقولة */
    flex-wrap: wrap;
    /* للسماح بنزول العناصر في الموبايل */
}

.hero-left {
    text-align: left;
    max-width: 550px;
    flex: 1;
    min-width: 300px;
    /* لضمان عدم صغر النص أكثر من اللازم */
}

.hero-left h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    /* حجم خط مرن */
    line-height: 1.1;
    margin-bottom: 15px;
}

.hero-right {
    flex: 1;
    display: flex;
    justify-content: center;
}

.big-profile {
    width: min(100%, 350px);
    /* حجم الصورة لا يتعدى 100% أو 350px */
    height: auto;
    aspect-ratio: 4/5;
    /* الحفاظ على تناسق الأبعاد */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 20px 20px 0px var(--secondary);
    border: 5px solid var(--primary);
}

/* --- [نهاية تعديل الـ Hero] --- */

.hero-left h1 span {
    color: #5c4033;
}

.role {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

body.dark-theme .role {
    color: #e6c3a3;
}

.big-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-links {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-top: 20px;
    flex-wrap: wrap;
    /* مرونة في ترتيب الأيقونات */
}

.hero-links a {
    font-size: 30px;
    color: var(--secondary);
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.hero-links a:hover {
    color: var(--primary);
    transform: translateY(-5px);
}

.hero-links .loc {
    font-size: 16px;
    margin-left: 10px;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section {
    padding: 120px 10%;
    text-align: center;
}

.section-title {
    font-size: 32px;
    margin-bottom: 60px;
    display: inline-block;
    border-bottom: 4px solid var(--secondary);
    padding-bottom: 10px;
}

.about-container {
    display: flex;
    align-items: center;
    gap: 50px;
    text-align: left;
}

.about-image img {
    width: 320px;
    border-radius: 20px;
}

.about-text p {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.edu-grid {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    /* السطر اللي جاي هو الحل */
    align-items: flex-start;
}

.edu-card {
    flex: 1 1 280px;
    /* يسمح للكارد بالنمو والتقلص بعرض أساسي 280px */
    max-width: 320px;
    /* تم تصغير أقصى عرض للكارد ليصبح 320px بدلاً من 350px */
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    background: white;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

/* --- [نهاية تعديل الـ Grids] --- */
/* تعديل لون مربعات الإدخال فقط في الدارك مود */
body.dark-theme .contact-side-form input,
body.dark-theme .contact-side-form textarea {
    background-color: #edd4b9 !important;
    /* اللون البيج */
    color: #3b2722 !important;
    /* لون الخط بني غامق عشان يبان على البيج */
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

/* لون الكلام المؤقت (Placeholder) جوه المربعات */
body.dark-theme .contact-side-form input::placeholder,
body.dark-theme .contact-side-form textarea::placeholder {
    color: rgba(59, 39, 34, 0.7) !important;
}

.edu-card:hover {
    transform: translateY(-10px);
}

.edu-img-wrapper {
    height: 180px;
    position: relative;
    overflow: hidden;
}

.edu-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.edu-card:hover .edu-img-wrapper img {
    transform: scale(1.1);
}

.edu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(78, 52, 46, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: 0.3s;
}

.edu-card:hover .edu-overlay {
    opacity: 1;
}

.card-content {
    padding: 20px;
    text-align: left;
}

.service-icon {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 10px;
    display: block;
}

.hidden-info {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.edu-card.active .hidden-info {
    display: block;
}

.project-link {
    color: var(--secondary);
    text-decoration: underline;
    font-weight: 600;
    display: inline-block;
    margin-top: 10px;
}

.filter-bar {
    margin-bottom: 30px;
}

.filter-btn {
    padding: 10px 25px;
    border: none;
    background: var(--accent);
    margin: 5px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px 0;
}

.skill-card {
    padding: 20px 10px;
    border-radius: 15px;
    width: 160px;
    min-height: 150px;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.skill-card p {
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    word-wrap: break-word;
    width: 100%;
}

.skill-card[style*="display: none"] {
    display: none !important;
}

body.dark-theme .skill-card {
    background: #2c2420;
}

.skill-card i {
    font-size: 35px;
    color: var(--secondary);
    margin-bottom: 5px;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.standalone-card {
    padding: 40px;
    border-radius: 20px;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.dark-theme .standalone-card {
    background: #2c2420;
}

.contact-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 1000px;
    margin: 60px auto;
    gap: 80px;
    padding: 0 20px;
}

.contact-side-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
}

.icon-box {
    width: 55px;
    height: 55px;
    background: #c89b74;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 5px 15px rgba(200, 155, 116, 0.2);
    transition: all 0.3s ease;
}

.icon-box:hover {
    transform: translateY(-5px);
    background: #2c2420;
}

.contact-side-form {
    flex: 1;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-side-form input,
.contact-side-form textarea {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(200, 155, 116, 0.3);
    background: #fdfaf7;
    font-size: 0.95rem;
    outline: none;
    transition: 0.3s;
}

.contact-side-form input:focus,
.contact-side-form textarea:focus {
    border-color: #c89b74;
    background: white;
    box-shadow: 0 0 10px rgba(200, 155, 116, 0.1);
}

.contact-side-form button {
    padding: 15px;
    background: #2c2420;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.contact-side-form button:hover {
    background: #c89b74;
    letter-spacing: 1px;
}

/* --- [بداية تعديل الـ Media Queries في مكانه] --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-container {
        flex-direction: column-reverse;
        /* الصورة تظهر تحت النص في الموبايل */
        text-align: center;
        gap: 40px;
    }

    .hero-left {
        text-align: center;
    }

    .hero-links {
        justify-content: center;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
    }

    .about-image img {
        width: 100%;
        max-width: 300px;
    }

    .section {
        padding: 80px 5%;
        /* تقليل الحواف في الموبايل */
    }

    .contact-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .contact-side-info {
        flex-direction: row;
        justify-content: center;
    }
}

/* --- [نهاية تعديل الـ Media Queries] --- */

body,
html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

.services-slider-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 50px;
}

#services .edu-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 10px;
    scrollbar-width: none;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

#services .edu-grid::-webkit-scrollbar {
    display: none;
}

/* --- [بداية تعديل الـ Services Slider في مكانه] --- */
#services .edu-card {
    flex: 0 0 85%;
    /* الكارت يأخذ أغلب عرض الموبايل */
    max-width: 85%;
}

@media (min-width: 768px) {
    #services .edu-card {
        flex: 0 0 calc(45% - 20px);
        max-width: calc(45% - 20px);
    }
}

@media (min-width: 1024px) {
    #services .edu-card {
        flex: 0 0 calc(33.333% - 20px);
        max-width: calc(33.333% - 20px);
    }
}

/* --- [نهاية تعديل الـ Services Slider] --- */

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.prev-arrow {
    left: 0;
}

.next-arrow {
    right: 0;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.dot {
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background: var(--secondary);
    width: 25px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .slider-arrow {
        display: none;
    }
}

/* نص الهوم في الوضع الليلي */
body.dark-theme .hero-left h1,
body.dark-theme .hero-left h3,
body.dark-theme .hero-left p,
body.dark-theme .hero-left span,
body.dark-theme .hero-links a,
body.dark-theme .hero-links span {
    color: #e4bca1 !important;
}

/* تحويل خلفية كروت التعليم والخدمات للوضع الداكن */
body.dark-theme .edu-card {
    background: #2c2420;
    /* نفس لون الكروت الأخرى في الداكن */
    color: var(--text-dark);
    /* لضمان أن النص بداخلها يصبح فاتحاً */
}

/* لضمان أن الخطوط الفاصلة بداخل الكروت لا تختفي أو تظهر بشكل سيء */
body.dark-theme .hidden-info {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* إذا أردت تغيير لون الظل ليكون أنعم في الوضع الداكن */
body.dark-theme .edu-card,
body.dark-theme .skill-card,
body.dark-theme .standalone-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}