/* ═══════════════════════════════════════════════════════════════════
   VCore Solutions — Enterprise UI Enhancements (Global Standards)
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --bg-midnight: #0a0e17;
    --surface-dark: #111827;
    --surface-elevated: #1e293b;
    --accent-violet: #7c3aed;
    --accent-violet-hover: #6d28d9;
    --accent-violet-glow: rgba(124, 58, 237, 0.28);
    --accent-cyan: #06b6d4;
    --accent-cyan-hover: #0891b2;
    --accent-cyan-glow: rgba(6, 182, 212, 0.25);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --glass-card-bg: rgba(17, 24, 39, 0.72);
    --glass-card-border: rgba(255, 255, 255, 0.10);
    --shadow-enterprise: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    color-scheme: light dark;
}

[data-mode="light"] {
    --bg-midnight: #f8fafc;
    --surface-dark: #ffffff;
    --surface-elevated: #f1f5f9;
    --accent-violet: #6d28d9;
    --accent-violet-hover: #5b21b6;
    --accent-violet-glow: rgba(109, 40, 217, 0.15);
    --accent-cyan: #0284c7;
    --accent-cyan-hover: #0369a1;
    --accent-cyan-glow: rgba(2, 132, 199, 0.15);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.18);
    --glass-card-bg: rgba(255, 255, 255, 0.88);
    --glass-card-border: rgba(15, 23, 42, 0.10);
    --shadow-enterprise: 0 15px 35px -10px rgba(0, 0, 0, 0.08);
}

/* 1. ضبط الخطوط والمسافات (Typography Calibration) */
body {
    font-family: 'IBM Plex Sans Arabic', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

[dir="ltr"] body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* تفعيل الميزات المتقدمة للأرقام والجداول والحاسبة */
.counter-input, .calc-subtext, .connect-node-sub, .trust-chip, .step-badge {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11", "tnum";
    font-variant-numeric: tabular-nums;
}

/* الوسوم والأرقام التقنية (Rajdhani) */
.latency-dot, .connect-node-sub, .trust-chip .leader, .section-badge, 
.type-card-badge, .badge-enterprise, .badge-home, .hero-brand {
    font-family: 'Rajdhani', 'Inter', sans-serif;
    letter-spacing: 0.02em;
}

/* 2. تدرج الإضاءة المحيطية الخلفية للهيرو (Ambient Mesh Glow) */
.page-hero {
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 750px;
    height: 480px;
    background: radial-gradient(circle, var(--accent-violet-glow) 0%, rgba(6, 182, 212, 0.12) 50%, transparent 75%);
    filter: blur(85px);
    pointer-events: none;
    z-index: 1;
}

/* 3. تخطيط الهيرو المزدوج المتطور (Split-Hero Grid Layout) */
.hero-split-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
    align-items: center;
    max-width: 1220px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-align: start;
}

.hero-text-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

[dir="rtl"] .hero-text-col {
    align-items: flex-start;
    text-align: right;
}

[dir="ltr"] .hero-text-col {
    align-items: flex-start;
    text-align: left;
}

.hero-text-col .it-badge {
    margin-inline-start: 0;
    margin-bottom: 1.25rem;
}

.hero-text-col .hero-brand {
    margin-bottom: 0.5rem;
}

.hero-text-col .hero-slogan {
    margin-bottom: 1.25rem;
}

.hero-text-col .gradient-heading {
    margin-bottom: 1.25rem;
    line-height: 1.35;
}

.hero-text-col .hero-hook {
    margin-bottom: 1.75rem;
    width: 100%;
}

.hero-text-col .hero-actions {
    justify-content: flex-start;
    margin-bottom: 2rem;
    width: 100%;
}

.hero-text-col .trust-strip {
    justify-content: flex-start;
    margin-bottom: 1.75rem;
    width: 100%;
}

.hero-text-col .hero-quick-links {
    justify-content: flex-start;
    width: 100%;
    padding-top: 1.25rem;
}

/* 4. إطار وعرض فيديو القناة التعريفي في الهيرو (Hero Video Card) */
.hero-media-col {
    position: relative;
    width: 100%;
    z-index: 2;
}

.hero-video-card {
    background: var(--glass-card-bg);
    border: 1px solid var(--glass-card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-enterprise), 0 0 30px -10px var(--accent-violet-glow);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.hero-video-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 35px -5px var(--accent-cyan-glow);
}

.hero-video-header {
    padding: 1rem 1.35rem 0.8rem;
    background: rgba(10, 14, 23, 0.65);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

[data-mode="light"] .hero-video-header {
    background: rgba(248, 250, 252, 0.75);
}

.hero-video-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-video-badge i {
    color: #ef4444;
    font-size: 0.95rem;
}

.hero-video-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.4;
}

.hero-video-aspect {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    overflow: hidden;
}

.hero-video-aspect iframe {
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.hero-video-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.35rem;
    background: rgba(10, 14, 23, 0.85);
    border-top: 1px solid var(--border-subtle);
}

[data-mode="light"] .hero-video-footer {
    background: rgba(248, 250, 252, 0.95);
}

.hero-video-desc {
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
}

.hero-video-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.btn-yt-subscribe {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #ef4444;
    color: #ffffff !important;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.45rem 0.95rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-yt-subscribe:hover {
    background: #dc2626;
    transform: scale(1.03);
}

/* 5. بطاقات المسار المزدوج (Dual-Funnel Architecture) */
.dual-funnel-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.5rem;
    max-width: 1220px;
    margin: 2.5rem auto 1.5rem auto;
    position: relative;
    z-index: 2;
    width: 100%;
}

.funnel-card {
    background: var(--glass-card-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 2rem;
    text-align: right;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

[dir="ltr"] .funnel-card {
    text-align: left;
}

.funnel-card::after, .service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.funnel-enterprise:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 16px 36px -12px var(--accent-cyan-glow);
    transform: translateY(-5px);
}

.funnel-home:hover {
    border-color: var(--accent-violet);
    box-shadow: 0 16px 36px -12px var(--accent-violet-glow);
    transform: translateY(-5px);
}

.funnel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    width: fit-content;
    margin-bottom: 1rem;
}

.badge-enterprise {
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-home {
    background: rgba(124, 58, 237, 0.12);
    color: var(--accent-violet);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.funnel-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    color: inherit;
}

.funnel-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.88;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.funnel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.85rem 1.4rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.funnel-btn-biz {
    background: var(--accent-cyan);
    color: #04131d !important;
}

.funnel-btn-biz:hover {
    background: var(--accent-cyan-hover);
    color: #ffffff !important;
    transform: scale(1.02);
}

.funnel-btn-home {
    background: var(--accent-violet);
    color: #ffffff !important;
}

.funnel-btn-home:hover {
    background: var(--accent-violet-hover);
    transform: scale(1.02);
}

.nav-funnel-link {
    font-weight: 600 !important;
}

/* 6. البطاقات الشاملة (Service, Problem, Info, Contact Cards) */
.service-card, .vcore-calc-card, .problem-card, .info-card, .contact-card {
    background: var(--glass-card-bg);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.service-card:hover, .problem-card:hover, .info-card:hover, .contact-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-enterprise);
}

/* 7. الأزرار الاحترافية (Micro-Elevation Buttons) */
.btn-primary, .funnel-btn-biz, .funnel-btn-home, .btn-calc-whatsapp {
    position: relative;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover, .funnel-btn-home:hover {
    box-shadow: 0 6px 20px var(--accent-violet-glow);
    filter: brightness(1.06);
}

.btn-primary:active, .funnel-btn-biz:active, .funnel-btn-home:active {
    transform: scale(0.98);
}

/* 8. ترقية مخطط ربط الفروع (Network Diagram Elevation) */
.connect-diagram {
    background: var(--glass-card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.25);
}

.connect-node.hq {
    box-shadow: 0 0 26px var(--accent-cyan-glow);
    border-color: var(--accent-cyan);
}

.latency-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: pulse-ping 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ping {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* 9. تحسينات حاسبة الفروع (Branch Calculator Polish) */
.calc-context-banner {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.calc-context-banner i {
    font-size: 1.4rem;
    color: var(--accent-cyan);
}

/* 10. الصور والأصول البصرية (Image Polish) */
.card-media img, .section-media img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card--media:hover .card-media img {
    transform: scale(1.04);
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
    box-shadow: 0 0 20px var(--accent-violet-glow);
    margin: 0 auto 1rem;
}

.profile-avatar-wrapper img {
    border-radius: 50%;
    display: block;
    object-fit: cover;
    object-position: 82% 50%;
    width: 84px;
    height: 84px;
}

/* 11. التجاوب مع الشاشات (Responsive Breakpoints) */
@media (max-width: 992px) {
    .hero-split-grid {
        grid-template-columns: 1fr;
        gap: 2.25rem;
        text-align: center;
    }
    
    .hero-text-col {
        align-items: center;
        text-align: center;
    }
    
    [dir="rtl"] .hero-text-col,
    [dir="ltr"] .hero-text-col {
        align-items: center;
        text-align: center;
    }
    
    .hero-text-col .hero-actions,
    .hero-text-col .trust-strip,
    .hero-text-col .hero-quick-links {
        justify-content: center;
    }
    
    .hero-media-col {
        max-width: 640px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .hero-video-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .hero-video-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .dual-funnel-wrapper {
        grid-template-columns: 1fr;
    }
}

/* 12. احترام تقليل الحركة (Reduced Motion) */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .latency-dot {
        animation: none !important;
    }
}
