/* ===== 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: #2d3748; /* تباين أقوى للنصوص الثانوية للوصول لـ 100% */
    --gray-800: #111827; /* تباين أقوى للنصوص الأساسية */
    --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;
    font-display: swap;
    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; 
    -webkit-transition: var(--transition); 
    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; min-width: 150px; display: inline-block; }

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

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

.nav-cta {
    padding: 10px 20px;
    border-radius: 25px;
    background: var(--secondary);
    color: #fff !important;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-cta:hover {
    background: #c92a2a;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(229, 62, 62, 0.4);
}

.nav-cta-prominent {
    font-size: 0.95rem;
    box-shadow: 0 6px 15px rgba(229, 62, 62, 0.3);
    animation: nav-pulse 2s infinite;
}

@keyframes nav-pulse {
    0%, 100% { box-shadow: 0 6px 15px rgba(229, 62, 62, 0.3); }
    50% { box-shadow: 0 6px 25px rgba(229, 62, 62, 0.5); }
}

.nav-cta-prominent:hover {
    animation: none;
}

.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: -webkit-box;
    display: -ms-flexbox;
    display: flex; 
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center; 
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center; 
    background: var(--primary);
    padding: 120px 0 80px;
    text-align: center;
    color: #fff;
    overflow: hidden;
    contain: layout size; /* تثبيت الأبعاد لتقليل CLS */
}

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

.hero-bg-slider {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.hero-bg-slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    -webkit-transition: opacity 1.5s ease-in-out;
    transition: opacity 1.5s ease-in-out;
}

.hero-bg-slide.active {
    opacity: 1;
}

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

.hero h1 { 
    font-size: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.hero-title { 
    font-size: clamp(1.8rem, 5vw, 3.5rem); 
    font-weight: 900; 
    margin-bottom: 20px; 
    line-height: 1.2; 
    -webkit-font-smoothing: antialiased;
    color: #fff;
    min-height: 1.2em; /* حجز مساحة للعنوان لمنع CLS */
}

.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-primary:hover { background: #c92a2a; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(229, 62, 62, 0.3); }
.btn-prominent { 
    font-size: 1.1rem; 
    padding: 15px 40px; 
    box-shadow: 0 8px 20px rgba(229, 62, 62, 0.4);
    animation: pulse-btn 2s infinite;
}
.btn-prominent:hover { 
    box-shadow: 0 12px 30px rgba(229, 62, 62, 0.5);
    animation: none;
}
@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 8px 20px rgba(229, 62, 62, 0.4); }
    50% { box-shadow: 0 8px 30px rgba(229, 62, 62, 0.6); }
}
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #20ba5f; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3); }

/* ===== 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; }
}

/* Sticky Contact Bar for Mobile */
.sticky-contact-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

@media (min-width: 769px) {
    .sticky-contact-bar {
        display: none;
    }
}

.contact-btn {
    flex: 1;
    padding: 15px;
    text-align: center;
    color: white !important;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.contact-btn.phone {
    background-color: #2c3e50;
}

.contact-btn.whatsapp {
    background-color: #25d366;
}

.contact-btn i {
    font-size: 1.3rem;
}

/* 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;
}


/* ===== Footer Contact Buttons ===== */
.footer-contact-buttons {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.footer-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: #fff !important;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.footer-btn-call {
    background: #2c3e50;
    border: 2px solid #2c3e50;
}

.footer-btn-call:hover {
    background: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 62, 80, 0.3);
}

.footer-btn-whatsapp {
    background: #25d366;
    border: 2px solid #25d366;
}

.footer-btn-whatsapp:hover {
    background: #20ba5f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.footer-btn i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .footer-contact-buttons {
        flex-direction: column;
    }
    
    .footer-btn {
        width: 100%;
        min-width: auto;
    }
}

/* ===== Trust Badges in Header ===== */
.trust-badges-header {
    display: flex;
    gap: 15px;
    margin-right: 20px;
    align-items: center;
}
.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
}
.trust-badge-item i { color: #10b981; font-size: 0.8rem; }

@media (max-width: 1200px) {
    .trust-badges-header { display: none; }
}

/* ===== Success Proof Section ===== */
.success-proof-section { padding: 60px 0; background: #fff; }
.proof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
}
.proof-card {
    background: #f8fafc;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    border: 1px solid #e2e8f0;
}
.proof-card:hover { transform: translateY(-5px); }
.proof-img-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #eee;
}
.proof-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(4px);
    opacity: 0.7;
}
.proof-status-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #10b981;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}
.proof-content { padding: 20px; text-align: right; }
.proof-content h4 { color: #1a2a5e; margin-bottom: 8px; font-size: 1.1rem; }
.proof-content p { color: #64748b; font-size: 0.85rem; margin: 0; }
.proof-time { color: #94a3b8; font-size: 0.75rem; margin-top: 10px; display: block; }

/* ===== Social Proof Toasts ===== */
.toast-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}
.social-toast {
    background: #fff;
    color: #1a2a5e;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    transform: translateX(120%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    border-right: 4px solid #10b981;
    max-width: 320px;
}
.social-toast.active { transform: translateX(0); }
.toast-icon {
    width: 40px;
    height: 40px;
    background: #f0fdf4;
    color: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.toast-body { text-align: right; }
.toast-body b { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.toast-body span { font-size: 0.8rem; color: #64748b; }

@media (max-width: 768px) {
    .toast-container { bottom: 80px; right: 10px; left: 10px; }
    .social-toast { max-width: none; width: 100%; }
}

/* ===== Pricing Section ===== */
.pricing-section { background: var(--gray-50); padding: 80px 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 40px; justify-content: center; max-width: 900px; margin-left: auto; margin-right: auto; }
.pricing-card { background: var(--white); border-radius: 20px; padding: 40px; text-align: center; box-shadow: var(--shadow-lg); transition: var(--transition); border: 2px solid transparent; position: relative; display: flex; flex-direction: column; }
.pricing-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-xl); }
.pricing-card.popular { border-color: var(--secondary); transform: scale(1.05); z-index: 10; }
.pricing-card.popular:hover { transform: scale(1.05) translateY(-10px); }
.pricing-badge { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); background: var(--secondary); color: #fff; padding: 5px 20px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; }
.pricing-header h3 { font-size: 1.5rem; color: var(--primary); margin-bottom: 15px; }
.price { font-size: 3rem; font-weight: 800; color: var(--primary); margin-bottom: 5px; }
.price span { font-size: 1rem; color: var(--gray-600); }
.pricing-features { margin: 30px 0; text-align: right; flex-grow: 1; }
.pricing-features li { margin-bottom: 12px; color: var(--gray-600); display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }
.pricing-features li i { color: #10b981; }
.pricing-features li.not-included { color: #a0aec0; }
.pricing-features li.not-included i { color: #e53e3e; }
.btn-outline-primary { border: 2px solid var(--secondary); color: var(--secondary); background: transparent; }
.btn-outline-primary:hover { background: var(--secondary); color: #fff; }
.w-100 { width: 100%; justify-content: center; }

@media (max-width: 768px) {
    .pricing-card.popular { transform: scale(1); margin-top: 20px; }
    .pricing-card.popular:hover { transform: translateY(-10px); }
}
