/* ==========================================================================
   BOLD Global Adaptive Tech Styles (Dark / Light Optimized)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Changa:wght=700;800&family=Montserrat:wght=500;600;700;800;900&family=Tajawal:wght=400;500;700;800;900&display=swap');

/* وضع الدارك الافتراضي المحترف */
:root {
    --bg-primary: radial-gradient(circle at top, #0f172a 0%, #0b0f19 100%);
    --bg-secondary: rgba(17, 24, 39, 0.5);
    --surface-strong: rgba(15, 23, 42, 0.72);
    --accent-blue: #2563eb;
    --accent-cyan: #38bdf8;
    --accent-emerald: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-soft: rgba(255, 255, 255, 0.05);
    --shadow-soft: 0 18px 40px rgba(2, 6, 23, 0.3);
    --radius-card: 24px;
    --font-ar: 'Tajawal', sans-serif;
    --font-ar-logo: 'Changa', sans-serif;
    --font-en: 'Montserrat', sans-serif;
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* ألوان الإضاءة الخلفية للدارك */
    --glow-1: rgba(37, 99, 235, 0.2);
    --glow-2: rgba(56, 189, 248, 0.14);
    --hero-gradient: linear-gradient(135deg, #ffffff 10%, #bfdbfe 45%, #cbd5e1 100%);
}

/* وضع اللايت الراضي الأنيق المتناسق 100% */
html[data-theme="light"] {
    --bg-primary: radial-gradient(circle at top, #f8fafc 0%, #e2e8f0 100%);
    --bg-secondary: rgba(255, 255, 255, 0.65);
    --surface-strong: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-soft: rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.06);
    
    /* حماية تباين الألوان في اللايت */
    --glow-1: rgba(37, 99, 235, 0.06);
    --glow-2: rgba(56, 189, 248, 0.05);
    --hero-gradient: linear-gradient(135deg, #0f172a 20%, #1e3a8a 60%, #3b82f6 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    color: var(--text-main);
    background: var(--bg-primary);
    overflow-x: hidden;
    position: relative;
    transition: var(--transition-smooth);
}

/* حركة شبكة الخطوط التقنية الرقمية المتكاملة خلف الصفحات */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image: 
        linear-gradient(var(--border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.4;
    mask-image: radial-gradient(circle at top, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: radial-gradient(circle at top, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%);
    transition: var(--transition-smooth);
}

/* غبار النجوم والإضاءات العائمة المتحركة في الخلفية ببطء */
body::after {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    pointer-events: none;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 30%, var(--glow-1) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, var(--glow-2) 0%, transparent 45%);
    filter: blur(60px);
    animation: backgroundGlowMove 20s ease-in-out infinite alternate;
    transition: var(--transition-smooth);
}

body[dir="rtl"] {
    font-family: var(--font-ar);
    text-align: right;
}

body[dir="ltr"] {
    font-family: var(--font-en);
    text-align: left;
}

a {
    color: inherit;
}

header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    background: var(--bg-secondary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.05);
    transition: var(--transition-smooth);
}

.header-container,
.grid-layout,
.footer-container {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

.header-container {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.95rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    overflow: visible;
}

.logo-text {
    display: inline-block;
}

body[dir="rtl"] .logo {
    font-family: var(--font-ar-logo);
    letter-spacing: 0;
}

body[dir="ltr"] .logo {
    font-family: var(--font-en);
    letter-spacing: -0.04em;
}

.logo-dot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

body[dir="rtl"] .logo-dot {
    margin-right: 6px;
    margin-left: 0;
}

body[dir="ltr"] .logo-dot {
    margin-left: 6px;
    margin-right: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    list-style: none;
    flex-wrap: wrap;
}

.nav-link,
.lang-btn,
.footer-link,
.contact-link,
.inline-link {
    transition: var(--transition-smooth);
}

.nav-link {
    position: relative;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.96rem;
    font-weight: 600;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    inset: auto 0 -2px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    transition: var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.lang-btn:hover {
    border-color: rgba(37, 99, 235, 0.45);
    background: rgba(37, 99, 235, 0.14);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.2);
}

.hero-section {
    position: relative;
    padding: 168px 0 96px;
    min-height: 82vh;
    display: flex;
    align-items: center;
}

.hero-section.hero-compact {
    min-height: auto;
    padding: 156px 0 48px;
}

.hero-container {
    width: min(980px, calc(100% - 48px));
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 20px;
    background: var(--hero-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition-smooth);
}

.hero-subtitle {
    width: min(760px, 100%);
    margin: 0 auto 36px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.9;
    transition: var(--transition-smooth);
}

.section-padding {
    position: relative;
    padding: 96px 0;
}

.section-surface {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.06) 0%, rgba(11, 15, 25, 0.02) 100%);
    border-block: 1px solid var(--border-soft);
}

html[data-theme="dark"] .section-surface {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.46) 0%, rgba(11, 15, 25, 0.18) 100%);
}

.section-header {
    width: min(720px, calc(100% - 48px));
    margin: 0 auto 56px;
    text-align: center;
}

.section-main-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-main);
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.85;
    transition: var(--transition-smooth);
}

.cards-wrapper,
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    align-items: stretch;
}

.custom-card,
.policy-shell {
    background: var(--bg-secondary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.custom-card {
    min-height: 100%;
    padding: 32px;
    border-radius: var(--radius-card);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.custom-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.3);
}

.card-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(56, 189, 248, 0.08));
    color: var(--text-main);
    font-size: 1.65rem;
    box-shadow: inset 0 0 0 1px var(--border-soft);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.45;
    color: var(--text-main);
}

.card-desc {
    color: var(--text-muted);
    line-height: 1.85;
    flex: 1;
    transition: var(--transition-smooth);
}

.content-shell {
    width: min(900px, calc(100% - 48px));
    margin: 0 auto;
}

.content-stack {
    display: grid;
    gap: 24px;
}

.content-heading {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    line-height: 1.25;
    margin-bottom: 16px;
    color: var(--text-main);
}

.content-body {
    color: var(--text-muted);
    line-height: 2;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.highlight-panel {
    padding: 32px;
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.1) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.metric-list {
    list-style: none;
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.metric-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-main);
    line-height: 1.8;
}

.metric-bullet {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    border-radius: 999px;
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.12);
}

.policy-shell {
    padding: 40px;
    border-radius: 28px;
}

.policy-title {
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-main);
}

.policy-intro,
.policy-body {
    color: var(--text-muted);
    line-height: 1.95;
    transition: var(--transition-smooth);
}

.policy-section {
    margin-top: 28px;
}

.policy-section-title {
    font-size: 1.3rem;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--text-main);
}

.contact-card {
    text-align: center;
    align-items: center;
}

.contact-card .card-icon {
    margin-inline: auto;
}

.contact-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
}

.contact-link.email-link {
    color: var(--accent-cyan);
}

.contact-link.phone-link {
    color: var(--accent-emerald);
    direction: ltr;
    display: inline-block;
}

.inline-link {
    color: #93c5fd;
    text-decoration: none;
}

html[data-theme="light"] .inline-link {
    color: var(--accent-blue);
}

.inline-link:hover,
.contact-link:hover {
    opacity: 0.85;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 999px;
    text-decoration: none;
    color: #ffffff !important; /* ثابت دائماً للأزرار */
    font-size: 0.96rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), #1d4ed8);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.35);
}

footer {
    padding: 40px 0 48px;
    background: rgba(7, 10, 16, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-soft);
    transition: var(--transition-smooth);
}

html[data-theme="light"] footer {
    background: rgba(226, 232, 240, 0.8);
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.footer-logo-wrap,
.footer-links-shell {
    width: 100%;
    display: flex;
    justify-content: center;
}

.footer-logo {
    justify-content: center;
}

.footer-links-shell {
    overflow-x: auto;
    scrollbar-width: none;
}

.footer-links-shell::-webkit-scrollbar {
    display: none;
}

.footer-links-inline-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: nowrap;
    white-space: nowrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
}

.footer-link:hover {
    color: var(--text-main);
}

.footer-divider-pipe {
    color: var(--border-soft);
    user-select: none;
}

.footer-rights {
    color: var(--text-muted);
    font-size: 0.88rem;
    transition: var(--transition-smooth);
}




.whatsapp-float {
    position: fixed !important; /* تثبيت الزر في مكانه بشكل مطلق أثناء التصفح */
    bottom: 30px !important;    /* المسافة من الأسفل */
    z-index: 99999 !important;  /* رفعه ليكون فوق كل شيء في الموقع بلا استثناء */
    width: 60px !important;
    height: 60px !important;
    background: transparent !important; /* حظر المربع الباهت كلياً */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: var(--transition-smooth) !important;
    animation: whatsappPulse 2.8s ease-in-out infinite !important;
}

/* ضبط إحداثيات التموضع الجغرافي للزر حسب لغة الموقع */
body[dir="rtl"] .whatsapp-float {
    left: 30px !important;      /* جهة اليسار في النسخة العربية لعدم تغطية النصوص */
    right: auto !important;
}

body[dir="ltr"] .whatsapp-float {
    right: 30px !important;     /* جهة اليمين في النسخة الإنجليزية */
    left: auto !important;
}




/* ==========================================================================
   Advanced Adaptive WhatsApp System (Optimized UX Direction)
   ========================================================================== */

.whatsapp-float {
    position: fixed !important;
    bottom: 30px !important;
    z-index: 99999 !important;
    width: 60px !important;
    height: 60px !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: var(--transition-smooth) !important;
    animation: whatsappPulse 2.8s ease-in-out infinite !important;
}

/* التموضع الجغرافي للأيقونة حسب لغة الموقع */
body[dir="rtl"] .whatsapp-float {
    right: 30px !important;     /* الأيقونة على اليمين تماماً في النسخة العربية */
    left: auto !important;
}
body[dir="ltr"] .whatsapp-float {
    left: 30px !important;      /* الأيقونة على اليسار تماماً في النسخة الإنجليزية */
    right: auto !important;
}

/* حماية ظهور التلميح الذكي ومحاذاته بدقة */
.whatsapp-float::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 15px;
    white-space: nowrap;
    background: var(--surface-strong);
    color: var(--text-main);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    z-index: 100000 !important;
}

/* توجيه خروج العبارة بالاتجاه المعاكس النظيف هندسياً لمنع التداخل */
body[dir="rtl"] .whatsapp-float::before {
    right: 75px !important;     /* تخرج العبارة جهة اليسار (نحو الداخل) لأن الأيقونة على اليمين */
    left: auto !important;
}
body[dir="ltr"] .whatsapp-float::before {
    left: 75px !important;      /* تخرج العبارة جهة اليمين (نحو الداخل) لأن الأيقونة على اليسار */
    right: auto !important;
}

/* إظهار التلميح وتكبير الأيقونة بنعومة فائقة عند تمرير الماوس */
.whatsapp-float:hover::before {
    opacity: 1 !important;
    visibility: visible !important;
}
.whatsapp-float:hover {
    transform: scale(1.1) !important;
    filter: drop-shadow(0 8px 20px rgba(37, 211, 102, 0.45)) !important;
}















.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
}

.animate-on-scroll.is-visible {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: var(--animation-delay, 0s);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes whatsappPulse {
    0%, 100% {
        box-shadow: 0 10px 25px rgba(5, 150, 105, 0.3);
    }
    50% {
        box-shadow: 0 14px 32px rgba(5, 150, 105, 0.42);
    }
}

/* أنيميشن حركة غبار النجوم العائم ببطء في الخلفية */
@keyframes backgroundGlowMove {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(40px, 30px) scale(1.05);
    }
}

@media (max-width: 900px) {
    .header-container {
        min-height: auto;
        padding: 18px 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-menu {
        justify-content: center;
        gap: 16px;
    }

    .hero-section {
        min-height: auto;
        padding-top: 208px;
    }

    .hero-section.hero-compact {
        padding-top: 190px;
    }

    .whatsapp-float {
        bottom: 22px;
        width: 56px;
        height: 56px;
        font-size: 26px;
    }

    body[dir="rtl"] .whatsapp-float {
        left: 22px;
    }

    body[dir="ltr"] .whatsapp-float {
        right: 22px;
    }
}

@media (max-width: 640px) {
    .header-container,
    .grid-layout,
    .footer-container,
    .hero-container,
    .section-header,
    .content-shell {
        width: min(100% - 32px, 1200px);
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 2.8rem);
    }

    .hero-subtitle,
    .section-subtitle,
    .content-body,
    .policy-intro,
    .policy-body,
    .card-desc {
        line-height: 1.8;
    }

    .custom-card,
    .policy-shell,
    .highlight-panel {
        padding: 28px;
    }

    .nav-menu {
        gap: 12px;
    }

    .nav-link,
    .lang-btn,
    .footer-link {
        font-size: 0.9rem;
    }

    .footer-links-inline-wrapper {
        gap: 10px;
    }
}