/* ============================================== */
/* 0. متغيرات CSS (Themes & Fonts) 
/* "هوية خشبية فاخرة" - تحديث بواسطة مبرمج خبير
/* ============================================== */
:root {
    /* الخط الأساسي */
    --main-font: 'Cairo', Tahoma, Geneva, Verdana, sans-serif;

    /* --- الوضع الافتراضي (الوضع الليلي/الخشبي - "Dark Walnut") --- */

    /* اللوحة الجديدة (مستوحاة من خشب الجوز والذهب) */
    --main-bg: #66514c;       /* البني الخشبي الرئيسي */
    --accent-gold: #e5a954;   /* الذهبي كـ Accent أساسي */
    --accent-green-deep: #5f6f52; /* أخضر زيتوني داكن (بديل الأزرق) */
    --accent-olive: #8b8855; /* الزيتوني للروابط (تم استبداله) */
    --accent-terra: #e67c6b;  /* التيراكوتا للملاحظات (تم استبداله) */
    
    --text-light: #f5f5dc;    /* لون بيج فاتح (أرقى من الأبيض) */
    --text-dark: #3a2e2b;     /* بني داكن جداً للنص في الوضع الفاتح */

    /* متغيرات الظل لإعطاء عمق 3D */
    --shadow-color: rgba(40, 30, 28, 0.4);
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.4);
    
    /* (تعديل) ظل النقش الداخلي */
    --engrave-shadow-dark: rgba(0, 0, 0, 0.5);
    --engrave-shadow-light: rgba(255, 255, 255, 0.08);

    /* تكييف المتغيرات القديمة مع اللوحة الجديدة */
    --main-bg-color-fallback: var(--main-bg);
    --accent-color: var(--accent-gold);
    --secondary-accent: var(--accent-green-deep); /* تم التغيير للأخضر */
    --text-color: var(--text-light);
    --text-muted: #c0bbae; /* بيج باهت */

    /* تراكب بلون بني دافئ لإعطاء عمق للصورة الخلفية */
    --bg-overlay: rgba(66, 51, 48, 0.6); 

    /* ملمس خشبي للحاوية (محاكاة بالإضاءة) */
    --container-bg-texture: 
        linear-gradient(270deg, rgba(86, 68, 64, 0.85), rgba(122, 102, 97, 0.85) 50%, rgba(86, 68, 64, 0.85) 100%);
    --container-bg-color: var(--main-bg);
    --wood-grain-overlay: linear-gradient(90deg, rgba(0,0,0,0.07) 1px, transparent 1px);
    --container-bg: var(--wood-grain-overlay), var(--container-bg-texture), var(--container-bg-color);
    --container-bg-size: 50px 100%, 100% 100%, 100% 100%;
    
    /* حدود لإعطاء تأثير 3D (حافة مضيئة) */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-shadow: rgba(0, 0, 0, 0.3);

    /* (تعديل) الروابط - تصميم "النقش" الجديد */
    --link-bg: transparent; /* سيستخدم خلفية الحاوية */
    --link-text: var(--text-light);
    --link-hover-bg: transparent;
    --link-hover-text: var(--accent-gold);

    /* (تعديل) الاتصال - تصميم "النقش" الجديد */
    --contact-bg: transparent;
    --contact-text: var(--text-light);
    --contact-hover-bg: transparent;
    --contact-hover-text: var(--accent-gold);
    
    --footer-text: var(--text-muted);
    --control-bg: var(--accent-gold);
    --control-text: var(--text-dark); /* نص داكن على خلفية ذهبية */
    
    --body-bg-url: url('assets/images/ba.jpg');
}

body.light-mode {
    /* --- الوضع النهاري ("Ash Wood" - خشب الدردار الفاتح) --- */
    
    --main-bg: #e0d9cf;       
    --accent-gold: #b38600;   /* ذهبي أغمق للوضع الفاتح */
    --accent-green-deep: #5f6f52; /* أخضر زيتوني داكن (بديل الأزرق) */
    --accent-olive: #a2a078; 
    --accent-terra: #d47061;  
    
    --text-light: #f5f5dc;
    --text-dark: #3a2e2b;     /* <<< تم التعديل (أكثر غمقاً وتناسقاً) */

    --shadow-color: rgba(102, 81, 76, 0.2);
    --shadow-light: rgba(255, 255, 255, 0.7);
    --shadow-dark: rgba(0, 0, 0, 0.15);
    
    /* (تعديل) ظل النقش الداخلي (فاتح) */
    --engrave-shadow-dark: rgba(0, 0, 0, 0.15);
    --engrave-shadow-light: rgba(255, 255, 255, 0.8);

    --main-bg-color-fallback: var(--main-bg);
    --accent-color: var(--accent-gold); /* تم التغيير للذهبي */
    --secondary-accent: var(--accent-green-deep); /* تم التغيير للأخضر */
    --text-color: var(--text-dark);
    --text-muted: #7a6a65;
    
    --bg-overlay: rgba(245, 240, 230, 0.6); 
    
    /* ملمس الخشب الفاتح */
    --container-bg-texture: 
        linear-gradient(270deg, rgba(230, 224, 214, 0.85), rgba(245, 242, 237, 0.85) 50%, rgba(230, 224, 214, 0.85) 100%);
    --container-bg-color: var(--main-bg);
    --wood-grain-overlay: linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    --container-bg: var(--wood-grain-overlay), var(--container-bg-texture), var(--container-bg-color);
    --container-bg-size: 50px 100%, 100% 100%, 100% 100%;
    
    --border-color: rgba(255, 255, 255, 0.6);
    --border-shadow: rgba(0, 0, 0, 0.1);

    /* (تعديل) روابط "النقش" (فاتح) */
    --link-bg: transparent;
    --link-text: var(--text-dark);
    --link-hover-bg: transparent;
    --link-hover-text: var(--accent-gold); /* تم التغيير للذهبي */

    /* (تعديل) الاتصال "النقش" (فاتح) */
    --contact-bg: transparent;
    --contact-text: var(--text-dark);
    --contact-hover-bg: transparent;
    --contact-hover-text: var(--accent-gold); /* تم التغيير للذهبي */
    
    --footer-text: var(--text-muted);
    --control-bg: var(--accent-gold); /* تم التغيير للذهبي */
    --control-text: #fff;
}

/* ============================================== */
/* 1. إعدادات عامة (Global) & Preloader */
/* ============================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased; /* جديد: لتنعيم الخطوط */
    -moz-osx-font-smoothing: grayscale; /* جديد: لتنعيم الخطوط */
    text-rendering: optimizeLegibility; /* جديد: لتحسين عرض الخطوط */
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--main-font);
    background-image: var(--body-bg-url);
    background-color: var(--main-bg-color-fallback); /* لون احتياطي */
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-color);
    direction: rtl;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative; 
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* التراكب والبلور (Blur) */
body::before {
    content: "";
    position: fixed;
    inset: 0; 
    background-color: var(--bg-overlay);
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    z-index: 0; 
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

/* --- شاشة التحميل --- */
#preloader {
    position: fixed;
    inset: 0;
    background-color: var(--main-bg-color-fallback); 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease-out 0.2s, visibility 0.6s ease-out 0.2s;
    opacity: 1;
    visibility: visible;
}
#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader-logo img {
    width: 150px;
    height: auto;
    animation: pulse-loader 1.8s ease-in-out infinite alternate;
    margin-bottom: 25px;
}

.loader-dots { display: flex; gap: 12px; }
.loader-dots .dot {
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    animation: bounce-loader 1.4s infinite ease-in-out both;
}
.loader-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.loader-dots .dot:nth-child(2) { animation-delay: -0.16s; }
.loader-dots .dot:nth-child(3) { animation-delay: 0s; }

@keyframes pulse-loader {
    from { transform: scale(1); opacity: 0.7; }
    to { transform: scale(1.08); opacity: 1; }
}
@keyframes bounce-loader {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1.0); opacity: 1; }
}
/* --- نهاية شاشة التحميل --- */


/* ============================================== */
/* 2. الحاوية الرئيسية & العناصر الأساسية
/* ============================================== */
.container {
    position: relative;
    z-index: 1; 
    max-width: 650px;
    width: 100%;
    
    background-image: var(--container-bg); 
    background-size: var(--container-bg-size);
    background-color: var(--container-bg-color);
    
    padding: 35px 45px;
    border-radius: 20px;
    text-align: center;
    
    transition: background-color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, transform 0.2s ease-out;
    perspective: 1000px; 
    will-change: transform; /* جديد: لإخبار المتصفح بالاستعداد للحركة */
    
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid var(--border-color);
    border-bottom-color: var(--border-shadow);
    border-right-color: var(--border-shadow);

    box-shadow: 0 15px 40px var(--shadow-color),
                inset 0 1px 2px var(--shadow-light),
                inset 0 -1px 2px var(--shadow-dark);
}

.profile-image {
    width: 160px;
    height: auto;
    border-radius: 0;
    margin: 0 auto 25px auto;
    object-fit: contain;
    border: none;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
    transform: translateZ(30px);
}
.profile-image:hover {
    transform: scale(1.05) translateZ(40px) rotateY(3deg);
    filter: drop-shadow(0 8px 15px var(--shadow-color));
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color); 
    /* cursor: pointer;  <-- تم حذف هذا السطر */
    transition: color 0.3s ease, text-shadow 0.3s ease;
    margin-bottom: 30px; 
    user-select: none;
    
    text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.4), 
                 1px 1px 1px rgba(255, 255, 255, 0.1);
                 
    transform: translateZ(20px);
}
.title:hover {
    /* color: var(--secondary-accent); <-- تم الإلغاء */
    text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.4), 
                 1px 1px 1px rgba(255, 255, 255, 0.1); /* <-- تم إلغاء التوهج */
    transform: translateZ(25px) scale(1.02); 
}

body.light-mode .title {
    text-shadow: -1px -1px 1px rgba(255, 255, 255, 0.7), 
                 1px 1px 1px rgba(0, 0, 0, 0.2);
}
body.light-mode .title:hover {
    text-shadow: -1px -1px 1px rgba(255, 255, 255, 0.7), 
                 1px 1px 1px rgba(0, 0, 0, 0.2),
                
}

/* ============================================== */
/* 3. (تطوير) أزرار الروابط "الخشب المنقوش"
/* ============================================== */
.link-button, .contact a, .location .map-link {
    display: flex;
    align-items: center;
    justify-content: center; 
    background: var(--link-bg); 
    color: var(--link-text);
    text-decoration: none;
    padding: 15px 22px;
    margin: 12px 0;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    
    text-shadow: 0 1px 2px var(--engrave-shadow-dark);
    
    /* (جديد) تأثير النقش */
    border: 1px solid var(--border-shadow); /* حد سفلي غامق */
    border-top-color: var(--border-color); /* حد علوي مضيء */
    border-left-color: var(--border-color); /* حد أيسر مضيء */
    box-shadow: inset 1px 1px 3px var(--engrave-shadow-dark),
                inset -1px -1px 2px var(--engrave-shadow-light),
                0 1px 0px var(--shadow-light);

    transition: all 0.3s ease;
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden; 
}
.contact a {
    background: var(--contact-bg);
    color: var(--contact-text);
}
.location .map-link {
    margin-top: 10px;
}
/* (تم الحذف) إزالة عنصر اللمعان ::before */

.link-button i, .contact a i, .location .map-link i {
    margin-left: 15px;
    font-size: 1.5rem;
    color: var(--accent-gold); /* (جديد) لون ذهبي للأيقونات */
    min-width: 35px;
    text-align: center;
    transition: color 0.3s ease, transform 0.3s ease;
    filter: drop-shadow(0 1px 2px var(--shadow-dark));
    transform: translateZ(10px);
}
[dir="ltr"] .link-button i, [dir="ltr"] .contact a i, [dir="ltr"] .location .map-link i { 
    margin-left: 0; margin-right: 15px; 
}
.contact a i { 
    color: var(--accent-gold); 
    direction: ltr; /* لضمان الأيقونة قبل الرقم */
} 
body.light-mode .link-button i, body.light-mode .contact a i, body.light-mode .location .map-link i {
    color: var(--accent-gold); /* تم التغيير للذهبي */
}

.link-button .text, .contact a .text, .location .map-link .text {
    display: inline-block;
    transform: translateZ(10px);
}

/* (جديد) تأثير الضغط "Engraved Press" */
.link-button:hover, .contact a:hover, .location .map-link:hover {
    background: var(--link-hover-bg);
    color: var(--link-hover-text);
    transform: translateY(1px); /* حركة بسيطة للأسفل */
    
    /* (جديد) عكس الظل ليبدو مضغوطاً */
    box-shadow: inset 2px 2px 6px var(--engrave-shadow-dark),
                inset -1px -1px 2px var(--engrave-shadow-light);
}
.link-button:hover i, .contact a:hover i, .location .map-link:hover i {
    color: var(--accent-gold); /* يبقى ذهبياً */
    transform: scale(1.05) translateZ(10px);
}
body.light-mode .link-button:hover i, body.light-mode .contact a:hover i, body.light-mode .location .map-link:hover i {
    color: var(--accent-gold); /* تم التغيير للذهبي */
}
/* (تعديل) أنيميشن النقر "الغوص" 3D */
@keyframes click-feedback {
    0% { 
        transform: translateY(0); 
        box-shadow: inset 1px 1px 3px var(--engrave-shadow-dark),
                    inset -1px -1px 2px var(--engrave-shadow-light),
                    0 1px 0px var(--shadow-light);
    }
    50% { 
        transform: translateY(2px); 
        filter: brightness(0.9);
        box-shadow: inset 3px 3px 8px var(--engrave-shadow-dark); 
    }
    100% { 
        transform: translateY(0); 
        filter: brightness(1);
        box-shadow: inset 1px 1px 3px var(--engrave-shadow-dark),
                    inset -1px -1px 2px var(--engrave-shadow-light),
                    0 1px 0px var(--shadow-light);
    }
}
.animate-click {
    animation: click-feedback 0.3s ease-out;
}

/* ============================================== */
/* 4. قسم الاتصال والموقع (تعديلات طفيفة)
/* ============================================== */
.contact, .location {
    margin-top: 40px;
    text-align: center; 
    transform: translateZ(5px);
}

/* (تم حذف الأنماط القديمة للعناوين ونقلها للقسم الموحد) */

.contact a {
    direction: ltr;
    text-align: center;
}

.location iframe {
    width: 100%;
    height: 300px;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 6px 20px var(--shadow-color);
    margin-bottom: 20px;
}

/* ============================================== */
/* 5. التذييل ورصيد LINKEY
/* ============================================== */
.footer {
    margin-top: 50px;
    font-size: 0.9rem;
    color: var(--footer-text);
    font-weight: 600;
    user-select: none;
    transition: color 0.3s ease;
}

.footer .copyright {
    margin-bottom: 15px;
}

.powered-by-linkey {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    transition: border-color 0.4s ease;
}
.powered-by-linkey a {
    font-family: var(--main-font);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.3s ease, color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.powered-by-linkey a:hover {
    opacity: 1;
    color: var(--accent-color);
}
.linkey-credit-logo {
    width: 65px;
    height: 65px;
    vertical-align: middle;
    filter: invert(1) brightness(0.9);
    transition: filter 0.4s ease;
}
body.light-mode .linkey-credit-logo {
    filter: none;
}


/* ============================================== */
/* 6. أزرار التحكم (اللغة والثيم)
/* ============================================== */
.controls-container {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 10;
    display: flex;
    gap: 12px;
}
[dir="rtl"] .controls-container { left: auto; right: 25px; }

.control-button {
    background: var(--control-bg);
    color: var(--control-text);
    border: none;
    width: 55px;
    height: 55px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-bottom-color: var(--border-shadow);
    border-right-color: var(--border-shadow);
    box-shadow: 0 5px 15px var(--shadow-color), 
                inset 0 1px 1px var(--shadow-light);

    transition: all 0.3s ease;
    user-select: none;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.control-button:hover {
    transform: translateY(-4px) scale(1.1) rotateZ(-3deg);
    box-shadow: 0 10px 22px var(--shadow-color), 
                inset 0 1px 1px var(--shadow-light);
    filter: brightness(1.15);
}
.control-button:active {
    transform: scale(0.95);
    filter: brightness(0.9);
    box-shadow: inset 0 2px 4px var(--shadow-dark);
}

#theme-toggle .fa-sun { display: none; }
body.light-mode #theme-toggle .fa-sun { display: block; }
body.light-mode #theme-toggle .fa-moon { display: none; }

/* ============================================== */
/* 6.5. (تم الحذف) سلايدر الصور 
/* ============================================== */
/* (تم حذف الأنماط الخاصة بالسلايدر القديم) */


/* ============================================== */
/* 7. التجاوب (Responsive Design)
/* ============================================== */

/* أ. شاشات الجوال (أصغر من 600px) */
@media (max-width: 599px) {
    body { 
        padding: 15px; 
    }

    .container { padding: 25px 20px; border-radius: 15px; }
    .profile-image { width: 120px; margin-bottom: 20px; }
    .title { font-size: 1.8rem; margin-bottom: 20px; }
    
    .link-button, .contact a, .location .map-link { 
        padding: 12px 15px; 
        font-size: 1rem; 
        border-radius: 10px; 
    }
    .link-button i, .contact a i, .location .map-link i { 
        font-size: 1.2rem; 
        margin-left: 10px; 
        min-width: 25px; 
    }
    [dir="ltr"] .link-button i, [dir="ltr"] .contact a i, [dir="ltr"] .location .map-link i { 
        margin-left: 0; margin-right: 10px; 
    }
    .contact h3, .location h3 { font-size: 1.5rem; margin-bottom: 15px; }
    .contact a { padding: 10px 14px; font-size: 1rem; border-radius: 8px; }
    .location iframe { height: 200px; border-radius: 10px; }
    .location .map-link { padding: 12px 15px; font-size: 1rem; }
    .footer { margin-top: 35px; font-size: 0.8rem; }
    .powered-by-linkey a { font-size: 0.75rem; }
    .linkey-credit-logo { width: 50px; height: 50px; }
    .controls-container { top: 15px; left: 15px; gap: 8px; }
    [dir="rtl"] .controls-container { left: auto; right: 15px; }
    .control-button { width: 45px; height: 45px; font-size: 0.9rem; border-radius: 10px; }
}

/* ب. شاشات التابلت (بين 600px و 900px) */
@media (min-width: 600px) and (max-width: 899px) {
    .container { max-width: 85vw; padding: 30px 35px; }
    .profile-image { width: 140px; }
    .title { font-size: 2.2rem; }
    .contact h3, .location h3 { font-size: 1.6rem; }
    .location iframe { height: 250px; }
}

/* ============================================== */
/* 8. أنماط علامة التوثيق (الخاصة بك)
/* ============================================== */

/* استهداف الأيقونة التي أضفتها */
.title .verification-badge {
    color: #0095f6 !important; 
    font-size: 2.2rem;
    vertical-align: middle;
    margin-right: 8px; 
    text-shadow: none !important; 
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
    transition: none !important;
}
.title:hover .verification-badge {
    color: #0095f6 !important; 
    transform: none !important; 
}
body.light-mode .title .verification-badge {
    color: #0095f6 !important; 
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}
body.light-mode .title:hover .verification-badge {
    color: #0095f6 !important; 
}
@media (max-width: 599px) {
    .title .verification-badge {
        font-size: 1.6rem; 
        margin-right: 6px;
    }
}

/* ============================================== */
/* (تعديل) أنماط العناوين الرئيسية للأقسام (مع تطريز)
/* ============================================== */

.contact h3, .location h3, .portfolio h3, .services h3 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 30px; /* زيادة الهامش لإعطاء مساحة للتطريز */
    font-weight: 700;
    transition: color 0.3s ease;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    position: relative; /* ضروري لوضع التطريز */
}

/* (جديد) إضافة "التطريز" الخشبي للخطوط */
.contact h3::after, .location h3::after, 
.portfolio h3::after, .services h3::after {
    content: '❖'; /* رمز زخرفي (Fleuron) */
    font-size: 1.6rem;
    line-height: 1;
    color: var(--accent-gold); /* لون ذهبي متناسق */
    position: absolute;
    bottom: -13px; /* لوضعه في منتصف الخط السفلي */
    left: 50%;
    transform: translateX(-50%);
    background: var(--container-bg-color); /* خلفية بلون الحاوية لـ "قطع" الخط */
    padding: 0 10px; /* لإعطاء مساحة حول الرمز */
    text-shadow: 0 1px 2px var(--shadow-dark);
    transition: background 0.4s ease, color 0.4s ease; /* للتحويل السلس */
}

/* (جديد) تعديل لون العناوين والتطريز في الوضع الفاتح */
body.light-mode .contact h3, body.light-mode .location h3, 
body.light-mode .portfolio h3, body.light-mode .services h3 {
    color: var(--accent-color); /* تم التغيير للذهبي */
}

body.light-mode .contact h3::after, 
body.light-mode .location h3::after, 
body.light-mode .portfolio h3::after, 
body.light-mode .services h3::after {
    color: var(--accent-color); /* تم التغيير للذهبي */
    background: var(--container-bg-color);
}

/* ============================================== */
/* 9. (جديد) معرض الأعمال و Lightbox
/* ============================================== */

/* --- 9.1. قسم المعرض الرئيسي --- */
.portfolio {
    width: 100%;
    margin: 35px 0;
    text-align: center;
}

/* (تم حذف نمط H3 من هنا ونقله للقسم الموحد) */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.portfolio-item {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: zoom-in;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    background-color: #000; 
}

.portfolio-item::before {
    content: '\f00e'; /* أيقونة "بحث" (تكبير) من Font Awesome */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    font-size: 40px;
    color: #fff;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    z-index: 2;
    transition: all 0.3s ease;
}

.portfolio-item:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1; 
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.portfolio-item:hover {
    transform: scale(1.03) translateZ(10px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.portfolio-item:hover img {
    transform: scale(1.1);
    opacity: 0.6;
}

/* --- 9.2. أنماط نافذة العرض (Lightbox) --- */
.lightbox-container {
    position: fixed;
    inset: 0; 
    background-color: rgba(30, 25, 23, 0.9); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 9990;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lightbox-container.open {
    display: flex;
    opacity: 1;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
    transform: scale(0.8);
    transition: transform 0.4s ease;
}
.lightbox-container.open .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 40px;
    font-size: 3.5rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s ease, color 0.3s ease;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
    color: var(--accent-gold);
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 600;
    background: rgba(0,0,0,0.4);
    padding: 10px 20px;
    border-radius: 8px;
    text-align: center;
}

/* --- 9.3. تجاوب المعرض --- */
@media (max-width: 599px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
    }
    .portfolio h3 {
        font-size: 1.5rem;
    }
    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 2.5rem;
    }
    .lightbox-caption {
        font-size: 1rem;
        bottom: 15px;
        width: 80%;
    }
}

/* ============================================== */
/* 10. (جديد) قسم "خدماتنا"
/* ============================================== */
.services {
    width: 100%;
    margin: 35px 0;
    text-align: center;
}

/* (تم حذف نمط H3 من هنا ونقله للقسم الموحد) */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    border-radius: 12px;
    background-image: var(--container-bg);
    background-size: var(--container-bg-size);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-item:hover {
    transform: scale(1.05) translateZ(15px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.service-item i {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px var(--shadow-dark));
}
body.light-mode .service-item i {
    color: var(--accent-color); /* تم التغيير للذهبي */
}

.service-item span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

@media (max-width: 599px) {
    .services h3 {
        font-size: 1.5rem;
    }
    .services-grid {
        grid-template-columns: repeat(2, 1fr); /* عمودين في الموبايل */
        gap: 10px;
    }
    .service-item i {
        font-size: 2rem;
    }
    .service-item span {
        font-size: 0.8rem;
    }
}


/* ============================================== */
/* 11. (جديد) أنيميشن التمرير (Scroll Animation)
/* ============================================== */
@keyframes fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
        filter: blur(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* الحالة الأولية (مخفي) */
.scroll-animate {
    opacity: 0;
    transition: opacity 0.7s ease-out, transform 0.7s ease-out, filter 0.7s ease-out;
    transition-delay: var(--delay, 0s);
    will-change: opacity, transform, filter; /* جديد: لتحسين أداء الأنيميشن */
}

/* الحالة عند الظهور (تطبيق الأنيميشن) */
.scroll-animate.visible.fade-in {
    animation: fade-in 0.7s forwards ease-out;
    animation-delay: var(--delay, 0s);
}
.scroll-animate.visible.fade-in-up {
    animation: fade-in-up 0.7s forwards ease-out;
    animation-delay: var(--delay, 0s);
}

/* (تعديل) إزالة الأنيميشن القديم من العناصر */
.profile-image,
.title-wrapper,
.link-button, 
.contact a, 
.location .map-link,
.contact, 
.location,
.image-slider {
    animation: none;
    opacity: 1; /* إعادة الوضع الافتراضي ليتم التحكم به عبر JS */
}

/* تطبيق الحالة الأولية (مخفي) على العناصر التي ستتحرك */
.scroll-animate {
    opacity: 0;
    /* تطبيق الأنيميشن المحدد في data-animation */
}
.scroll-animate.fade-in-up {
    transform: translateY(40px) scale(0.95);
    filter: blur(3px);
}
.scroll-animate.fade-in {
    transform: scale(0.95);
}

/* كلاس "visible" الذي سيضيفه الـ JS */
.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* ============================================== */
/* ============================================== */
/* 12. (جديد) فاصل الأقسام المنقوش
/* ============================================== */
.section-divider {
    font-size: 1.8rem; /* بحجم التطريز */
    line-height: 1;
    color: var(--accent-gold); /* لون ذهبي متناسق */
    text-shadow: 0 1px 2px var(--shadow-dark);
    text-align: center;
    margin: 40px 0; /* هوامش ليفصل بين الأقسام */
    user-select: none;
    transition: color 0.4s ease;
    
    /* (جديد) تحويله إلى فاصل خطي */
    display: flex;
    align-items: center;
    gap: 15px; /* مسافة بين الخط والرمز */
}

/* (جديد) الخطوط المنقوشة على جانبي الرمز */
.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1; /* لجعل الخطوط تملأ المساحة المتاحة */
    height: 2px;
    background-color: var(--border-color); /* الخط المضيء العلوي */
    border-bottom: 1px solid var(--border-shadow); /* الظل السفلي للخط */
    opacity: 0.6;
}

/* تعديل اللون في الوضع الفاتح */
body.light-mode .section-divider {
    color: var(--accent-color);
}

body.light-mode .section-divider::before,
body.light-mode .section-divider::after {
    background-color: var(--border-color);
    border-bottom: 1px solid var(--border-shadow);
}


/* تقليل الهوامش في الموبايل */
@media (max-width: 599px) {
    .section-divider {
        margin: 30px 0;
        font-size: 1.6rem;
        gap: 10px; /* تقليل المسافة */
    }
}

/* تعديل اللون في الوضع الفاتح */
body.light-mode .section-divider {
    color: var(--accent-color);
}

/* تقليل الهوامش في الموبايل */
@media (max-width: 599px) {
    .section-divider {
        margin: 30px 0;
        font-size: 1.6rem;
    }
}