/* ===== Global Styles ===== */
:root {
    --primary: #1a2a5e;
    --primary-light: #2d4a8c;
    --secondary: #e53e3e;
    --secondary-light: #fc5c5c;
    --accent: #d4af37;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html, body { 
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* القضاء على الإزاحة الأفقية */
    font-family: 'Cairo', sans-serif;
    color: var(--gray-800);
    background: var(--white);
    line-height: 1.8;
    scroll-behavior: smooth;
    position: relative;
}

img { 
    max-width: 100%; 
    height: auto; 
    display: block; 
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container { 
    width: 100%;
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

.section { padding: 80px 0; overflow: hidden; }

/* ===== Navbar ===== */
.navbar { 
    position: fixed; 
    top: 0; 
    width: 100%; 
    z-index: 9999; 
    background: rgba(26, 42, 94, 0.98); 
    padding: 12px 0; 
    transition: var(--transition); 
}

.nav-container { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
}

.nav-logo { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 45px; width: auto; border-radius: 8px; }
.logo-text { font-size: 1.2rem; font-weight: 800; color: #fff; }

.nav-links { 
    display: flex; 
    gap: 20px; 
}

.nav-links a { 
    color: #fff; 
    font-weight: 600; 
    font-size: 0.9rem; 
}

.mobile-toggle { 
    display: none; 
    background: none; 
    border: none; 
    color: #fff; 
    font-size: 1.5rem; 
    cursor: pointer; 
}

/* ===== Hero Section ===== */
.hero { 
    position: relative; 
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: var(--primary);
    padding: 100px 0 60px;
    text-align: center;
    color: #fff;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(26,42,94,0.9), rgba(26,42,94,0.7));
    z-index: 1;
}

.hero-content { 
    position: relative; 
    z-index: 2; 
    width: 100%;
    padding: 0 20px;
}

.hero h1 { 
    font-size: 3rem; 
    font-weight: 900; 
    margin-bottom: 20px; 
    line-height: 1.2; 
}

.hero-buttons { 
    display: flex; 
    gap: 15px; 
    justify-content: center; 
    flex-wrap: wrap; 
}

.btn { 
    padding: 12px 30px; 
    border-radius: 50px; 
    font-weight: 700; 
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary { background: var(--secondary); color: #fff; }
.btn-whatsapp { background: #25D366; color: #fff; }

/* ===== Grid Systems ===== */
.services-grid, .amn-grid, .req-grid, .testimonials-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; 
}

.service-card, .amn-card, .req-card, .testimonial-card { 
    background: #fff; 
    padding: 30px; 
    border-radius: var(--radius); 
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

/* ===== Smart Popup ===== */
.smart-popup { 
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.8); 
    z-index: 10000; 
    display: none; 
    align-items: center; 
    justify-content: center;
    padding: 20px;
}

.smart-popup.active { display: flex; }

.popup-content { 
    background: #fff; 
    padding: 30px; 
    border-radius: 20px; 
    text-align: center; 
    max-width: 450px; 
    width: 100%;
    position: relative;
}

.popup-close { 
    position: absolute; 
    top: 10px; left: 10px; 
    font-size: 2rem; 
    border: none; background: none; cursor: pointer; 
}

/* ===== Responsive Mobile Fixes ===== */
@media (max-width: 992px) {
    .mobile-toggle { display: block; }
    .nav-links { 
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        background: var(--primary);
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }
    .nav-links.active { display: flex; }
}

@media (max-width: 768px) {
    .section { padding: 50px 0; }
    .hero { min-height: auto; padding: 120px 0 80px; }
    .hero h1 { font-size: 1.8rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .btn { width: 100%; justify-content: center; }
    
    /* منع الإزاحة الأفقية بشكل إجباري */
    .container { padding: 0 15px; overflow: hidden; }
    
    /* تصغير صور الشهادات لتناسب الجوال */
    .amn-image img, .specs-image img, .steps-image img, .req-image-center img {
        width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.5rem; }
    .logo-text { font-size: 1rem; }
}

/* Dark Mode */
body.dark-mode { background: #121212; color: #eee; }
body.dark-mode .section, body.dark-mode .service-card { background: #1e1e1e !important; color: #eee; border-color: #333; }
.dark-mode-toggle {
    position: fixed; bottom: 80px; left: 20px;
    width: 45px; height: 45px; border-radius: 50%;
    background: var(--primary); color: #fff;
    border: none; cursor: pointer; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
