/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;800;900&display=swap');

:root {
    --bg-page: #f8fafc;        
    --bg-surface: rgba(255, 255, 255, 0.85); 
    --text-main: #0f172a;      
    --text-muted: #64748b;     
    --primary: #0ea5e9;        
    --primary-dark: #0284c7;
    --accent: #6366f1;         
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px -5px rgba(14, 165, 233, 0.1); 
    --border-light: rgba(15, 23, 42, 0.05);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Cairo', sans-serif; 
    scroll-behavior: smooth; 
}

body { 
    background-color: var(--bg-page); 
    color: var(--text-main); 
    overflow-x: hidden; 
    line-height: 1.7;
    position: relative;
}

.container { 
    max-width: 1250px; 
    margin: 0 auto; 
    padding: 0 24px; 
    position: relative; 
    z-index: 10; 
}

/* ==========================================================================
   2. DYNAMIC NETWORK BACKGROUND
   ========================================================================== */
#network-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 0; 
    pointer-events: none;
    background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.03), transparent 60%),
                radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.03), transparent 60%);
}

/* ==========================================================================
   3. HEADER & CUSTOM LOGO
   ========================================================================== */
header { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 15px 30px; margin-top: 20px;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(16px);
    border: 1px solid var(--border-light); border-radius: 20px;
    box-shadow: var(--shadow-sm);
    position: sticky; top: 20px; z-index: 100; 
}

.brand-logo {
    height: 45px; /* Scales your 300x300 logo perfectly for the header */
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.brand-logo:hover {
    transform: scale(1.05);
}

nav { display: flex; gap: 35px; }
nav a { color: var(--text-muted); text-decoration: none; font-size: 1rem; font-weight: 600; transition: 0.3s; }
nav a:hover, nav a.active { color: var(--primary); }

.header-cta { 
    background: var(--text-main); color: white; padding: 10px 24px; border-radius: 12px; 
    font-weight: 700; text-decoration: none; transition: 0.3s;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}
.header-cta:hover { background: var(--primary); transform: translateY(-2px); }

/* ==========================================================================
   4. HERO SECTION
   ========================================================================== */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 60px; padding: 80px 0; min-height: 80vh; }
.hero-badge {
    display: inline-block; background: rgba(14, 165, 233, 0.1); color: var(--primary-dark);
    padding: 8px 20px; border-radius: 50px; font-weight: 700; font-size: 0.9rem;
    margin-bottom: 25px; border: 1px solid rgba(14, 165, 233, 0.2); backdrop-filter: blur(5px);
}
.hero h1 { font-size: 4rem; font-weight: 900; line-height: 1.15; margin-bottom: 25px; }
.text-gradient { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 40px; max-width: 90%; }

.cta-group { display: flex; gap: 20px; }
.btn-main {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; border: none; 
    padding: 16px 36px; border-radius: 14px; font-size: 1.1rem; font-weight: 800; cursor: pointer; transition: 0.3s;
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.3);
}
.btn-main:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(14, 165, 233, 0.4); }

/* Hero Visual & Glass Panels */
.hero-visual { position: relative; height: 500px; }
.glass-panel {
    position: absolute; background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 24px; box-shadow: var(--shadow-lg);
    padding: 30px; animation: float 6s ease-in-out infinite;
}
.panel-1 { top: 10%; right: 5%; width: 70%; height: 60%; z-index: 2; }
.panel-2 { bottom: 10%; left: 5%; width: 60%; height: 50%; z-index: 3; animation-delay: -3s; }
.decor-circle {
    position: absolute; top: -5%; left: 10%; width: 150px; height: 150px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%; filter: blur(40px); opacity: 0.3; z-index: 1;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

/* Mock UI lines */
.mock-ui-header { display: flex; gap: 8px; margin-bottom: 20px; }
.mock-dot { width: 12px; height: 12px; border-radius: 50%; background: #e2e8f0; }
.mock-dot:nth-child(1) { background: #ef4444; } .mock-dot:nth-child(2) { background: #f59e0b; } .mock-dot:nth-child(3) { background: #10b981; }
.mock-line { height: 12px; background: #f1f5f9; border-radius: 6px; margin-bottom: 12px; width: 100%; }
.mock-line.short { width: 60%; } .mock-line.accent { background: rgba(14, 165, 233, 0.2); width: 80%; }
.shield-icon { font-size: 3rem; margin-bottom: 15px; text-align: center; }

/* ==========================================================================
   5. STATS SECTION (4 Cards)
   ========================================================================== */
.stats-container { display: flex; gap: 24px; margin-top: -40px; position: relative; z-index: 20; }
.stat-card {
    background: var(--bg-surface); padding: 25px 20px; border-radius: 20px; box-shadow: var(--shadow-lg); 
    border: 1px solid var(--border-light); backdrop-filter: blur(10px); flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; transition: 0.3s;
}
.stat-card:hover { transform: translateY(-5px); border-color: rgba(14, 165, 233, 0.3); }
.stat-icon {
    width: 55px; height: 55px; border-radius: 16px; background: rgba(14, 165, 233, 0.08); 
    color: var(--primary); display: flex; justify-content: center; align-items: center; margin-bottom: 15px;
}
.stat-info h4 { font-size: 2.2rem; font-weight: 900; line-height: 1; color: var(--primary-dark); }
.stat-info p { color: var(--text-muted); font-weight: 600; margin-top: 5px; font-size: 0.9rem;}

/* ==========================================================================
   6. SERVICES GRID
   ========================================================================== */
.services { padding: 120px 0; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 3rem; font-weight: 900; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

/* Asymmetrical Layout for Desktop */
.push-down { transform: translateY(30px); }
.push-down:hover { transform: translateY(20px) !important; }

.service-card {
    background: var(--bg-surface); padding: 40px; border-radius: 24px; box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light); backdrop-filter: blur(10px); transition: 0.4s; position: relative;
}
.service-card:hover { box-shadow: var(--shadow-lg); border-color: rgba(14, 165, 233, 0.3); transform: translateY(-10px); }

.service-icon-wrapper {
    width: 70px; height: 70px; border-radius: 20px; display: flex; justify-content: center; align-items: center; margin-bottom: 25px;
}
.color-vpn { background: linear-gradient(135deg, rgba(14,165,233,0.1), rgba(99,102,241,0.1)); }
.color-infra { background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1)); }
.color-devops { background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(14,165,233,0.1)); }

.service-card h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 15px; }
.service-card p { color: var(--text-muted); line-height: 1.7; font-size: 1.05rem; }

/* ==========================================================================
   7. METHODOLOGY
   ========================================================================== */
.methodology { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; padding: 60px 0 120px; }
.method-text h2 { font-size: 2.5rem; font-weight: 900; margin-bottom: 20px; }
.method-text p { font-size: 1.1rem; color: var(--text-muted); line-height: 1.8; }
.method-text ul { list-style: none; margin-top: 30px; }
.method-text li { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 20px; font-size: 1.1rem; color: var(--text-muted); }
.check-icon { 
    background: rgba(16, 185, 129, 0.1); color: #10b981; border-radius: 50%; 
    width: 28px; height: 28px; display: flex; justify-content: center; align-items: center; flex-shrink: 0; font-weight: bold;
}

.method-cards { display: flex; flex-direction: column; gap: 20px; position: relative; }
.step-card {
    background: var(--bg-surface); padding: 25px; border-radius: 16px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 20px; backdrop-filter: blur(10px); transition: 0.3s;
}
.push-left { margin-right: 30px; } /* RTL shifting */
.step-card:hover { transform: translateX(-10px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.step-num { font-size: 2rem; font-weight: 900; color: rgba(14, 165, 233, 0.2); }
.step-card h4 { font-size: 1.2rem; font-weight: 800; margin-bottom: 5px; }

/* ==========================================================================
   8. TECH STACK MARQUEE
   ========================================================================== */
.tech-section { padding: 40px 0 100px; overflow: hidden; }
.tech-header { text-align: center; margin-bottom: 40px; color: var(--text-muted); font-weight: 600; letter-spacing: 1px;}
.marquee-mask { overflow: hidden; mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent); }
.marquee-wrapper { display: flex; width: 200%; animation: scroll 20s linear infinite; }
.marquee-wrapper:hover { animation-play-state: paused; }
.tech-item {
    background: var(--bg-surface); border: 1px solid var(--border-light);
    padding: 15px 30px; border-radius: 50px; margin: 0 15px;
    font-weight: 700; color: var(--text-main); font-size: 1.1rem;
    box-shadow: var(--shadow-sm); backdrop-filter: blur(5px); display: flex; align-items: center; gap: 10px;
}
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(50%); } }

/* ==========================================================================
   9. HEALTH WIDGET
   ========================================================================== */
.health-widget {
    background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 30px; padding: 60px; margin-bottom: 100px;
    display: flex; justify-content: space-between; align-items: center; color: white; box-shadow: 0 30px 60px rgba(99, 102, 241, 0.3);
    position: relative; overflow: hidden;
}
.health-widget::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%); pointer-events: none;
}
.health-text { position: relative; z-index: 1; }
.health-text h2 { font-size: 2.5rem; font-weight: 900; margin-bottom: 15px; }
.health-text p { font-size: 1.2rem; opacity: 0.9; max-width: 500px; margin-bottom: 30px; }
.health-btn {
    background: white; color: var(--primary-dark); border: none; padding: 15px 30px; border-radius: 12px; 
    font-weight: 800; font-size: 1.1rem; cursor: pointer; transition: 0.3s; position: relative; z-index: 1;
}
.health-btn:hover { box-shadow: 0 10px 20px rgba(0,0,0,0.15); transform: scale(1.05); }

.progress-ring { position: relative; width: 150px; height: 150px; z-index: 1; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle { fill: transparent; stroke-width: 12; stroke-linecap: round; }
.ring-bg { stroke: rgba(255,255,255,0.2); }
.ring-fill { stroke: white; stroke-dasharray: 440; stroke-dashoffset: 440; transition: stroke-dashoffset 1.5s ease-in-out; }
.ring-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.5rem; font-weight: 900; }

/* ==========================================================================
   10. CONTACT (MAP + FORM) & FOOTER
   ========================================================================== */
#contact { background: var(--bg-surface); padding: 80px 0; border-top: 1px solid var(--border-light); backdrop-filter: blur(10px); }
.contact-card {
    background: linear-gradient(135deg, #ffffff, #f1f5f9); border-radius: 24px; padding: 50px; 
    box-shadow: var(--shadow-lg); border: 1px solid var(--border-light);
}
.contact-card h2 { font-size: 2.5rem; margin-bottom: 15px; text-align: center; }
.contact-card > p { color: var(--text-muted); margin-bottom: 40px; font-size: 1.1rem; text-align: center;}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Splits Form and Map 50/50 */
    gap: 40px;
    align-items: stretch; /* Makes map and form equal height */
}

.form-row { display: flex; gap: 20px; margin-bottom: 20px; }
.form-input {
    width: 100%; padding: 15px 20px; border-radius: 12px; border: 1px solid #e2e8f0;
    background: white; font-size: 1rem; outline: none; transition: 0.3s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); }
.form-btn {
    background: var(--text-main); color: white; border: none; padding: 16px 40px; border-radius: 12px;
    font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: 0.3s; width: 100%; margin-top: 10px;
}
.form-btn:hover { background: var(--primary); }

.contact-map {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    min-height: 350px;
}

/* Footer Styling */
footer { padding: 60px 0 30px; text-align: right; background: white; border-top: 1px solid var(--border-light); position: relative; z-index: 10;}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-logo-img { height: 40px; margin-bottom: 15px; }
.footer-desc { color: var(--text-muted); line-height: 1.6; max-width: 300px; }
.footer-links h4 { color: var(--text-main); margin-bottom: 20px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; color: var(--text-muted);}
.footer-links a { color: var(--text-muted); text-decoration: none; transition: 0.3s; }
.footer-links a:hover { color: var(--primary); }
.ltr-text { direction: ltr; text-align: right; }
.footer-bottom { border-top: 1px solid #e2e8f0; padding-top: 20px; font-size: 0.9rem; text-align: center; color: var(--text-muted); }

/* ==========================================================================
   11. WHATSAPP FLOATING BUTTON
   ========================================================================== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px; /* Placed on the left so it doesn't overlap scrollbars */
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    box-shadow: 0px 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    transition: all 0.3s ease;
}
.whatsapp-float:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0px 8px 25px rgba(37, 211, 102, 0.6);
}

/* ==========================================================================
   12. RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 992px) {
    header { flex-direction: column; gap: 15px; padding: 15px; border-radius: 12px;}
    nav { gap: 15px; flex-wrap: wrap; justify-content: center;}
    
    .hero, .service-grid, .methodology, .footer-grid, .contact-grid { grid-template-columns: 1fr; }
    
    .hero-visual { display: none; } /* Hide complex graphic on mobile to save space/performance */
    .hero { text-align: center; padding: 40px 0; min-height: auto; }
    .cta-group { justify-content: center; }
    
    .stats-container { flex-wrap: wrap; margin-top: 40px; }
    .stat-card { flex: 1 1 40%; } /* 2x2 grid on tablets */
    
    .push-down, .push-left { transform: none; margin: 0; } /* Reset asymmetrical layout on mobile */
    .service-card:nth-child(2):hover { transform: translateY(-10px) !important; }
    
    .health-widget { flex-direction: column; text-align: center; gap: 40px; padding: 40px 20px;}
    
    .contact-card { padding: 30px 20px; }
    .contact-map { min-height: 250px; }
    .footer-grid { text-align: center; }
    .footer-desc { margin: 0 auto; }
    .ltr-text { text-align: center; }
    
    .whatsapp-float { bottom: 20px; left: 20px; width: 55px; height: 55px;}
    .whatsapp-float svg { width: 30px; height: 30px; }
}
/* ==========================================================================
   13. SCROLL PROGRESS BAR — شريط التقدم أعلى الصفحة
   ========================================================================== */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 9999;
    transition: width 0.1s linear;
}


/* ==========================================================================
   14. BACK TO TOP BUTTON
   ========================================================================== */
#back-to-top {
    position: fixed;
    bottom: 110px; /* فوق زر واتساب */
    left: 30px;
    width: 50px; height: 50px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    color: var(--primary);
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}
#back-to-top:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}


/* ==========================================================================
   15. TOAST NOTIFICATION — رسالة تأكيد الإرسال
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10b981;
    color: white;
    padding: 16px 28px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}


/* ==========================================================================
   16. SECTION FADE-IN ON SCROLL
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ==========================================================================
   17. FORM VALIDATION STATES
   ========================================================================== */
.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.form-input.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}


/* ==========================================================================
   18. ACTIVE NAV INDICATOR
   ========================================================================== */
nav a {
    position: relative;
}
nav a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%; height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: transform 0.3s ease;
}
nav a:hover::after,
nav a.active::after {
    transform: translateX(-50%) scaleX(1);
}


/* ==========================================================================
   19. SKELETON LOADING لبطاقات الإحصائيات
   ========================================================================== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}


/* ==========================================================================
   20. MOBILE NAV — تحسين الهيدر للموبايل
   ========================================================================== */
@media (max-width: 640px) {
    .hero h1 { font-size: 2.5rem; }
    .section-header h2 { font-size: 2rem; }
    .health-text h2 { font-size: 1.8rem; }
    .contact-card h2 { font-size: 1.8rem; }
    .stat-card { flex: 1 1 100%; }
    
    /* تخفيف blur على الأجهزة الضعيفة */
    .glass-panel, .stat-card, .service-card {
        backdrop-filter: blur(8px);
    }
    
    #back-to-top { left: 20px; bottom: 90px; }
}


/* ==========================================================================
   21. PRINT STYLES
   ========================================================================== */
@media print {
    #network-bg, .whatsapp-float, #back-to-top, #scroll-progress,
    .header-cta, .health-widget, .btn-main { display: none !important; }
    body { background: white; }
    header { position: relative; box-shadow: none; border: 1px solid #e2e8f0; }
}