/* =========================================
   1. المتغيرات وإعدادات الألوان (الأساس)
   ========================================= */
:root {
    --primary-color: #0ef6cc;    /* أخضر نيون */
    --secondary-color: #00badf;  /* أزرق سماوي */
    --bg-dark: #0c111f;          /* خلفية الصفحة */
    --bg-darker: #070b14;        /* خلفية الأقسام */
    --card-bg: #131b2e;          /* خلفية الكروت */
    --text-light: #e9f1f7;       /* لون النص */
    --text-muted: #8896ab;       /* لون فرعي */
    --facebook: #1877f2;
    --whatsapp: #25d366;
    --linkedin: #0077b5;
    --github: #333;
    --gradient-main: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    --font-main: 'Cairo', sans-serif;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* =========================================
   2. تنسيقات عامة (Reset)
   ========================================= */
* {
    margin: 0; padding: 0; box-sizing: border-box;
    text-decoration: none; border: none; outline: none;
    scroll-behavior: smooth; font-family: var(--font-main);
}

html {
    font-size: 16px; /* حجم الخط الأساسي */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden; /* منع التمرير الأفقي */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    padding: 80px 0; /* مسافة موحدة للأقسام */
}

.bg-darker { background-color: var(--bg-darker); }
.highlight, .dot { color: var(--primary-color); }

/* =========================================
   3. العناوين والأزرار
   ========================================= */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 60px;
    position: relative;
    text-transform: uppercase;
    font-weight: 800;
    text-align: center;
}

.section-title::after {
    content: ''; position: absolute; width: 70px; height: 4px;
    background: var(--gradient-main); bottom: -15px; left: 50%;
    transform: translateX(-50%); border-radius: 10px;
}

.section-title-left { font-size: 2rem; margin-bottom: 20px; font-weight: 700; line-height: 1.4; }
.sub-title { color: var(--primary-color); margin-bottom: 10px; font-weight: 600; display: block; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 30px; border-radius: 50px; font-weight: 700;
    transition: 0.4s; cursor: pointer; font-size: 1rem; z-index: 1;
}

.btn-primary { background: var(--gradient-main); color: var(--bg-dark); }
.btn-primary:hover { box-shadow: 0 0 20px var(--primary-color); transform: translateY(-3px); }

.btn-outline { background: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }
.btn-outline:hover { background: var(--primary-color); color: var(--bg-dark); transform: translateY(-3px); }

.full-width { width: 100%; }

/* =========================================
   4. الهيدر (Navbar)
   ========================================= */
header {
    position: fixed; top: 0; width: 100%; padding: 20px 0; z-index: 1000; transition: 0.4s;
}

header.sticky {
    background: rgba(7, 11, 20, 0.95); padding: 10px 0;
    box-shadow: var(--box-shadow); backdrop-filter: blur(10px);
}

.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.8rem; font-weight: 900; color: white; }

nav ul { display: flex; list-style: none; gap: 30px; }
nav ul li a { color: var(--text-light); font-weight: 600; transition: 0.3s; position: relative; }
nav ul li a:hover, nav ul li a.active { color: var(--primary-color); }

.menu-toggle { display: none; font-size: 1.8rem; color: var(--text-light); cursor: pointer; }

/* =========================================
   5. قسم البداية (Hero)
   ========================================= */
.hero-section {
    min-height: 100vh; display: flex; align-items: center; padding-top: 80px; position: relative; overflow: hidden;
}

/* أشكال الخلفية */
.bg-shape { position: absolute; border-radius: 50%; filter: blur(90px); z-index: -1; opacity: 0.3; }
.shape-1 { width: 300px; height: 300px; background: var(--primary-color); top: -50px; left: -50px; animation: float 10s infinite alternate; }
.shape-2 { width: 250px; height: 250px; background: var(--secondary-color); bottom: 50px; right: -50px; animation: float 8s infinite alternate-reverse; }
@keyframes float { 0% { transform: translate(0,0); } 100% { transform: translate(30px,30px); } }

.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; align-items: center; gap: 30px; }

.hero-text h1 { font-size: 3.5rem; font-weight: 900; line-height: 1.2; margin-bottom: 15px; }
.hero-text h4 { color: var(--primary-color); font-size: 1.5rem; font-weight: 700; }
.hero-text p { color: var(--text-muted); font-size: 1.1rem; line-height: 1.6; margin-bottom: 30px; }
.hero-btns { display: flex; gap: 15px; }

/* الصورة الشخصية */
.hero-image-container {
    position: relative; width: 380px; height: 380px; display: flex; justify-content: center; align-items: center; margin: 0 auto;
}
.rotating-border {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)) border-box;
    
    /* --- التعديل هنا --- */
    /* استخدام صيغة الألوان الكاملة لضمان التوافق */
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    
    /* استخدام xor بدلاً من destination-out لأنه البديل الأصح لـ exclude في webkit */
    -webkit-mask-composite: xor; 
    mask-composite: exclude;
    /* ------------------ */
    
    animation: rotate 10s linear infinite;
}

@keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.image-wrapper {
    width: 92%; height: 92%; border-radius: 50%; overflow: hidden;
    border: 6px solid var(--bg-dark); z-index: 2;
}
.image-wrapper img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(20%); transition: 0.5s; }
.hero-image-container:hover img { filter: grayscale(0%); transform: scale(1.05); }

/* =========================================
   6. باقي الأقسام (About, Services, Portfolio)
   ========================================= */
/* About */
.about-container { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 50px; align-items: center; }
.img-placeholder-about {
    height: 350px; background: var(--card-bg); border-radius: 20px; display: flex;
    justify-content: center; align-items: center; font-size: 5rem; color: var(--secondary-color); border: 2px solid var(--secondary-color);
}
.stats-grid { display: flex; gap: 30px; margin-top: 20px; flex-wrap: wrap; }
.stat-item h3 { font-size: 2rem; color: var(--primary-color); }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; }
.service-card {
    background: var(--card-bg); padding: 30px; border-radius: 15px; text-align: center;
    transition: 0.4s; border-bottom: 3px solid transparent;
}
.service-card:hover { transform: translateY(-10px); border-bottom-color: var(--primary-color); }
.icon-box { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 20px; display: inline-block; }

/* Portfolio */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
.portfolio-item { position: relative; border-radius: 15px; overflow: hidden; height: 280px; box-shadow: var(--box-shadow); }
.portfolio-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.portfolio-item:hover img { transform: scale(1.1); }
.portfolio-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(7, 11, 20, 0.9); display: flex; flex-direction: column; justify-content: center; align-items: center;
    opacity: 0; transition: 0.4s;
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.btn-icon { width: 45px; height: 45px; background: var(--gradient-main); color: var(--bg-dark); border-radius: 50%; display: flex; justify-content: center; align-items: center; }

/* Contact */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1.2fr; gap: 50px; }
.info-box { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; background: var(--card-bg); padding: 20px; border-radius: 10px; }
.social-links-big { display: flex; gap: 10px; flex-wrap: wrap; }
.social-btn {
    width: 50px; height: 50px; display: flex; justify-content: center; align-items: center;
    background: var(--card-bg); color: var(--text-light); border-radius: 10px; font-size: 1.4rem; transition: 0.3s;
}
.social-btn:hover { background: var(--primary-color); color: var(--bg-dark); transform: translateY(-5px); }
.contact-form-box { background: var(--card-bg); padding: 30px; border-radius: 20px; }
.input-field { background: var(--bg-darker); margin-bottom: 15px; border-radius: 10px; display: flex; align-items: center; padding: 0 15px; }
.input-field input, .input-field textarea { width: 100%; background: transparent; padding: 15px; color: white; border: none; }
.input-field i { color: var(--text-muted); }

/* Footer */
footer { background: #05080f; text-align: center; padding: 20px 0; margin-top: 50px; border-top: 1px solid rgba(255,255,255,0.05); }


/* =========================================
   7. التجاوب (Media Queries) - أهم جزء
   ========================================= */

/* شاشات اللابتوب المتوسطة والتابلت (Max Width: 1024px) */
@media (max-width: 1024px) {
    .container { width: 92%; }
    .hero-text h1 { font-size: 3rem; }
    .hero-image-container { width: 320px; height: 320px; }
    .section-title { font-size: 2.2rem; }
}

/* شاشات التابلت والموبايل الكبير (Max Width: 768px) */
@media (max-width: 768px) {
    /* تفعيل القائمة الجانبية (Hamburger Menu) */
    .menu-toggle { display: block; }
    nav ul {
        position: fixed; top: 0; left: -100%; width: 75%; height: 100vh;
        background: var(--bg-darker); flex-direction: column; justify-content: center; align-items: center;
        transition: 0.4s; z-index: 999; box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }
    nav ul.active { left: 0; }
    nav ul li { margin: 15px 0; }
    nav ul li a { font-size: 1.2rem; }

    /* تعديل الهيرو (Hero Section) */
    .hero-section { padding-top: 100px; text-align: center; }
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    /* جعل الصورة تظهر قبل النص في الموبايل */
    .hero-image-container { order: -1; width: 280px; height: 280px; margin-bottom: 20px; }
    .hero-btns { justify-content: center; }
    .hero-text h1 { font-size: 2.5rem; }

    /* تعديل باقي الأقسام */
    .about-container { grid-template-columns: 1fr; text-align: center; }
    .about-img { display: none; } /* إخفاء صورة About لتوفير المساحة */
    .stats-grid { justify-content: center; }
    
    .contact-wrapper { grid-template-columns: 1fr; }
    .contact-info { order: -1; text-align: center; margin-bottom: 30px; }
    .info-box { justify-content: flex-start; text-align: right; } /* جعل معلومات الاتصال واضحة */
    .social-links-big { justify-content: center; }
}

/* شاشات الموبايل الصغيرة (Max Width: 480px) */
@media (max-width: 480px) {
    html { font-size: 14px; } /* تصغير الخط العام قليلاً */
    .hero-text h1 { font-size: 2rem; }
    .hero-image-container { width: 240px; height: 240px; }
    .btn { padding: 10px 20px; font-size: 0.9rem; }
    
    .section-title { font-size: 1.8rem; margin-bottom: 40px; }
    .contact-form-box { padding: 20px; }
    
    /* جعل كروت الخدمات والمشاريع تأخذ العرض الكامل */
    .services-grid, .portfolio-grid { grid-template-columns: 1fr; }
}