/* --- إعدادات عامة مع ألوان الشفق القطبي --- */
:root {
    --primary-color: #ffffff;
    --text-color: #f0f0f0;
    --accent-color: #80deea;
    --container-width: 960px;
    --card-bg: rgba(40, 52, 67, 0.8);
    --header-bg: rgba(31, 40, 51, 0.8);
}

body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(225deg, #1f2833, #4b5d67, #00c9b7, #93278f);
    background-size: 400% 400%;
    animation: auroraAnimation 20s ease infinite;
}

@keyframes auroraAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- تصميم صفحة البداية --- */
.splash-body { overflow: hidden; }
.splash-container { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; text-align: center; padding: 1rem; }
.dramatic-text { color: var(--primary-color); font-family: 'Playfair Display', serif; font-size: 6vw; font-weight: 700; letter-spacing: 5px; text-transform: uppercase; text-shadow: 0 0 15px rgba(255, 255, 255, 0.5), 0 0 30px rgba(128, 222, 234, 0.5); animation: dramaticFadeIn 3s ease-out forwards; white-space: nowrap; }
.enter-btn { color: var(--accent-color); text-decoration: none; border: 2px solid var(--accent-color); padding: 10px 30px; border-radius: 50px; margin-top: 2rem; font-weight: bold; opacity: 0; transition: all 0.3s ease; animation: fadeIn 2s ease 2s forwards; }
.enter-btn:hover { background: var(--accent-color); color: #1f2833; box-shadow: 0 0 20px var(--accent-color); }
@keyframes dramaticFadeIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- تصميم باقي الموقع --- */
.container { max-width: var(--container-width); margin: auto; overflow: hidden; padding: 0 2rem; }
header { background: var(--header-bg); backdrop-filter: blur(10px); color: var(--primary-color); padding: 1rem 0; position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
header .container { display: flex; justify-content: space-between; align-items: center; }
header .logo { font-size: 1.5rem; font-weight: bold; }
header .nav-links { list-style: none; padding: 0; margin: 0; display: flex; align-items:center; }
header .nav-links li { margin-left: 20px; }
header nav a { color: var(--primary-color); text-decoration: none; font-weight: bold; transition: color 0.3s ease; }
header nav a:hover { color: var(--accent-color); }
.lang-switcher a { font-size: 0.9rem; padding: 5px 10px; border: 1px solid var(--accent-color); border-radius: 5px; }
.lang-switcher a:hover { background-color: var(--accent-color); color: #1f2833; }
.hamburger { display: none; cursor: pointer; }
.hamburger .line { width: 25px; height: 3px; background-color: var(--primary-color); margin: 5px; transition: all 0.3s ease; }
main { padding: 2rem 0; }
.section { background: var(--card-bg); padding: 2.5rem; margin-bottom: 1.5rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); }
.section h1, .section h2 { color: var(--primary-color); margin-bottom: 1rem; text-align: center; }

/* --- تصميم السيرة الذاتية --- */
.resume-section h3 { color: var(--accent-color); margin-top: 2rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--accent-color); display: inline-block; }
.resume-section ul { list-style: none; padding: 0; }
.resume-section li { margin-bottom: 1.5rem; }
.resume-section li p { margin: 0.3rem 0 0 0; color: var(--text-color); }
.job-title { font-size: 1.2rem; font-weight: bold; color: #fff; }
.job-meta { font-size: 0.9rem; color: #ccc; }
.skills-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.skill-category h4 { color: #fff; margin-bottom: 1rem; }
.skill-category p { margin: 0; line-height: 1.8; }

/* --- تصميم معرض الشهادات --- */
.certificates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.certificate-thumbnail { border-radius: 8px; cursor: pointer; transition: transform 0.3s ease; overflow: hidden; }
.certificate-thumbnail img { width: 100%; height: auto; display: block; }
.certificate-thumbnail:hover { transform: scale(1.05); }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2000; display: none; justify-content: center; align-items: center; }
.modal-content { max-width: 80%; max-height: 90%; }
.modal-content img { width: 100%; height: 100%; object-fit: contain; }
.close-modal { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 3rem; font-weight: bold; cursor: pointer; }

/* --- تصميم قسم المشاريع (البطاقات) --- */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.project-card { background: rgba(31, 40, 51, 0.9); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.project-card:hover { transform: translateY(-10px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.project-image { height: 180px; background-size: cover; background-position: center; }
.project-content { padding: 1.5rem; }
.project-content h3 { margin-top: 0; color: var(--primary-color); }
.project-content p { font-size: 0.9rem; color: var(--text-color); }
.project-tags { margin-top: 1rem; }
.project-tags span { display: inline-block; background: var(--accent-color); color: #1f2833; padding: 5px 10px; border-radius: 5px; font-size: 0.75rem; font-weight: bold; margin-left: 5px; margin-bottom: 5px; }

/* --- تصميم قسم المقالات --- */
.blog-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin-top: 2rem; }
.article-card { background: rgba(31, 40, 51, 0.9); border-radius: 12px; padding: 2rem; box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: transform 0.3s ease, box-shadow 0.3s ease; border: 1px solid rgba(255, 255, 255, 0.1); }
.article-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.article-card h3 { margin-top: 0; }
.article-card h3 a { color: var(--primary-color); text-decoration: none; font-size: 1.5rem; transition: color 0.3s ease; }
.article-card h3 a:hover { color: var(--accent-color); }
.article-card p { color: var(--text-color); }
.article-card .read-more { display: inline-block; margin-top: 1rem; color: var(--accent-color); text-decoration: none; font-weight: bold; }

/* --- تصميم نموذج التواصل (مع الإصلاح) --- */
.contact-form .form-group { margin-bottom: 1rem; }
.contact-form label { display: block; margin-bottom: 5px; font-weight: bold; text-align: right; }
[dir="ltr"] .contact-form label { text-align: left; }
.contact-form input, .contact-form textarea { width: 100%; padding: 12px; border: 1px solid #4b5d67; border-radius: 8px; box-sizing: border-box; background: rgba(31, 40, 51, 0.9); color: var(--primary-color); }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 8px rgba(128, 222, 234, 0.5); }
.contact-form button { margin-top: 1rem; }
.btn { display: inline-block; background: transparent; color: var(--accent-color); border: 2px solid var(--accent-color); padding: 12px 25px; border-radius: 8px; cursor: pointer; text-decoration: none; font-weight: bold; font-size: 1rem; transition: all 0.3s ease; }
.btn:hover { background-color: var(--accent-color); color: #1f2833; box-shadow: 0 0 15px var(--accent-color); }

.social-media { text-align: center; margin-top: 2rem; }
.social-link { /* التعديل هنا ليتطابق مع زر LinkedIn في الصورة الثانية */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color); /* لون النص أبيض */
    text-decoration: none;
    font-size: 1.2rem;
    padding: 10px 30px; /* زيادة العرض للزر */
    border: 2px solid var(--primary-color); /* حدود بيضاء */
    border-radius: 50px; /* حواف دائرية جداً */
    transition: all 0.3s ease;
    background-color: transparent; /* خلفية شفافة */
}
.social-link i { margin-left: 10px; margin-right: 0; } /* تبديل الهامش للأيقونة للغة العربية */
[dir="ltr"] .social-link i { margin-right: 10px; margin-left: 0; } /* للغة الإنجليزية */

.social-link:hover {
    background-color: var(--primary-color); /* خلفية بيضاء عند التحويم */
    color: #1f2833; /* لون نص داكن عند التحويم */
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5); /* ظل أنيق */
}

/* --- أكواد أخرى --- */
footer { text-align: center; padding: 1.5rem; background: rgba(31, 40, 51, 0.8); color: var(--text-color); }
.scroll-top-btn { position: fixed; bottom: 20px; right: 20px; background-color: var(--accent-color); color: #1f2833; width: 50px; height: 50px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; text-decoration: none; cursor: pointer; z-index: 1000; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.4s ease; }
.scroll-top-btn.visible { opacity: 1; visibility: visible; transform: translateY(0); }
[dir="ltr"] header .nav-links li { margin-left: 0; margin-right: 20px; }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    header .container { flex-wrap: wrap; }
    header .nav-links { display: none; flex-direction: column; width: 100%; text-align: center; background: rgba(31, 40, 51, 0.95); padding: 1rem 0; order: 3; }
    header .nav-links.active { display: flex; }
    header .nav-links li { margin: 10px 0; }
    [dir="ltr"] header .nav-links li { margin: 10px 0; }
    header .hamburger { display: block; order: 2; }
    header .logo { order: 1; }
    .dramatic-text { font-size: 8vw; }
    .section { padding: 1.5rem; }
    .portfolio-grid, .certificates-grid { grid-template-columns: 1fr; }
}