:root {
    --color-core: #3b82f6;
    --color-accent: #60a5fa;
    --color-success: #10b981;
    --bg-void: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --text-light: #f1f5f9;
    --text-dim: #cbd5e1;
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow-glow: 0 0 60px rgba(59, 130, 246, 0.25);
}
/* منع المتصفحات التي تدعم الوضع المظلم من تطبيق الألوان المعكوسة */
@media (prefers-color-scheme: dark) {
    /* هذه القاعدة تجبر عناصر النموذج والواجهة على استخدام ألوان فاتحة */
    html {
        color-scheme: light !important;
    }
}
html, body {
    overflow-x: hidden !important;
}

.bg-core { background-color: var(--color-core); }
.text-core { color: var(--color-core); }
.border-core { border-color: var(--color-core); }
* { font-family: 'Tajawal', sans-serif; }
body {
    background-color: var(--bg-void);
    color: var(--text-light);
    overflow-x: hidden;
}

/* ------------------------------------ */
/* STAR FIELD & CORE GLOW (خلفية النجوم والتوهج) */
/* ------------------------------------ */
.star-field {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 100%);
    overflow: hidden;
}
.star {
    position: absolute;
    width: 2px; height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: star-fly 4s infinite linear;
}
@keyframes star-fly {
    0% { transform: translateY(0); opacity: 0; }
    50% { opacity: 0.8; }
    100% { transform: translateY(-100vh); opacity: 0; }
}
.core-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
    filter: blur(100px);
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
}


@keyframes pulse {
    0% { opacity: 0.5; scale: 1; }
    100% { opacity: 0.9; scale: 1.1; }
}

/* ------------------------------------ */
/* HERO SECTION & DEVICES (قسم البطل والأجهزة) */
/* ------------------------------------ */
.hero {
    min-height: 100vh;
    padding: 8rem 0 5rem 0;
    position: relative;
}
.device-wrapper {
    position: relative;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4rem;
    perspective: 1000px;
}

/* Laptop Frame */
.laptop-frame {
    position: absolute;
    width: 780px; height: 520px;
    background: #1e293b;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    transform: rotateX(5deg);
    transition: 0.5s;
    z-index: 10;
}
.laptop-frame:hover {
    transform: rotateX(0deg) translateY(-10px) scale(1.02);
    box-shadow: 0 0 100px rgba(59, 130, 246, 0.3);
    border-color: var(--color-core);
}
.laptop-screen {
    width: 100%; height: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}
.laptop-img {
    width: 100%; height: 100%;
    object-fit: contain;
}

/* Phone Frame */
.phone-frame {
    position: absolute;
    width: 260px; height: 540px;
    background: #020617;
    border-radius: 45px;
    padding: 10px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    border: 4px solid #334155;
    z-index: 20;
    left: 5%; bottom: 0;
    transform: rotateZ(-10deg) translateZ(50px);
    transition: 0.5s;
}
.phone-frame:hover {
    transform: rotateZ(0deg) scale(1.05) translateZ(100px);
    border-color: var(--color-core);
}
.phone-screen {
    width: 100%; height: 100%;
    background: #f8fafc;
    border-radius: 35px;
    overflow: hidden;
    position: relative;
}
.phone-img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.phone-notch {
    position: absolute;
    top: 15px; left: 50%;
    transform: translateX(-50%);
    width: 70px; height: 20px;
    background: #000;
    border-radius: 12px;
    z-index: 30;
}

/* Tabs */
.feature-tabs {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 6px;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-top: 3rem;
    backdrop-filter: blur(10px);
}
.tab-btn {
    padding: 10px 24px;
    border-radius: 50px;
    color: var(--text-dim);
    font-weight: 600;
    transition: 0.3s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tab-btn.active {
    background: var(--color-core);
    color: white;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.5);
}
.tab-btn:hover:not(.active) {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Monolith Button */
.btn-monolith {
    background: white;
    color: var(--bg-void);
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 800;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-monolith:hover {
    background: var(--color-core);
    color: white;
    box-shadow: 0 0 30px var(--color-core);
}

/* Bento Cards */
.bento-card { background: var(--bg-panel); border-radius: 24px; padding: 2rem; border: 1px solid var(--glass-border); transition: 0.4s; position: relative; overflow: hidden; backdrop-filter: blur(10px); }
.bento-card:hover { transform: translateY(-5px); border-color: var(--color-core); box-shadow: 0 0 40px rgba(59, 130, 246, 0.2); background: rgba(30, 41, 59, 0.9); }
.bento-icon { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 1.5rem; background: rgba(59, 130, 246, 0.15); color: var(--color-accent); border: 1px solid rgba(59, 130, 246, 0.3); }

/* System Cards */
.system-card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%); border-radius: 20px; border: 1px solid var(--glass-border); overflow: hidden; transition: 0.4s; height: 100%; display: flex; flex-direction: column; backdrop-filter: blur(5px); }
.system-card:hover { border-color: var(--color-core); box-shadow: 0 0 40px rgba(59, 130, 246, 0.25); transform: translateY(-8px); }
.system-header { height: 180px; background: rgba(0, 0, 0, 0.2); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--glass-border); }
.system-icon-lg { font-size: 5rem; color: #475569; transition: 0.4s; }
.system-card:hover .system-icon-lg { color: var(--color-core); transform: scale(1.1); filter: drop-shadow(0 0 15px var(--color-core)); }
.system-badge { position: absolute; top: 15px; right: 15px; background: var(--color-core); color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; box-shadow: 0 0 15px var(--color-core); }
.btn-sys-outline { border: 1px solid #475569; color: #cbd5e1; padding: 0.8rem; border-radius: 10px; text-align: center; font-weight: 600; transition: 0.3s; cursor: pointer; }
.btn-sys-outline:hover { border-color: white; color: white; background: rgba(255, 255, 255, 0.05); }
.btn-sys-fill { background: var(--color-core); color: white; padding: 0.8rem; border-radius: 10px; text-align: center; font-weight: 600; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 5px; }
.btn-sys-fill:hover { background: #2563eb; box-shadow: 0 0 25px rgba(59, 130, 246, 0.5); }

/* Pricing */
.pricing-box { background: var(--bg-panel); border-radius: 24px; padding: 3rem; border: 1px solid var(--glass-border); text-align: center; transition: 0.4s; position: relative; backdrop-filter: blur(10px); }
.pricing-box:hover { border-color: var(--color-core); transform: scale(1.02); box-shadow: 0 0 40px rgba(59, 130, 246, 0.15); }
.pricing-box.featured { border: 2px solid var(--color-core); background: linear-gradient(180deg, rgba(59, 130, 246, 0.15) 0%, rgba(0, 0, 0, 0) 100%); box-shadow: 0 0 60px rgba(59, 130, 246, 0.2); }
.feat-badge { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); background: var(--color-core); color: white; padding: 5px 20px; border-radius: 20px; font-weight: 700; font-size: 0.9rem; box-shadow: 0 0 25px var(--color-core); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(15px); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: 0.3s; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content { background: #1e293b; width: 900px; max-width: 95%; border-radius: 20px; padding: 2rem; transform: translateY(20px); transition: 0.3s; border: 1px solid #475569; box-shadow: 0 0 60px rgba(0, 0, 0, 0.6); }
.modal-overlay.active .modal-content { transform: translateY(0); }

/* Lightbox/Zoom */
.lightbox-overlay {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none; /* مخفي بشكل افتراضي */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}
.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.4s;
    object-fit: contain; /* مهم للحفاظ على نسبة العرض/الارتفاع */
}
@keyframes zoomIn {
    from {transform: scale(0.8);}
    to {transform: scale(1);}
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}
.lightbox-close:hover {
    color: #bbb;
}
.animated-badge {
    /* أساسيات التصميم */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px; /* زيادة البادينغ */
    border-radius: 9999px; /* شكل دائري بالكامل */
    font-size: 1.25rem; /* تكبير النص: text-xl */
    font-weight: 700;
    color: #93c5fd; /* Light Blue 300 */
    background: rgba(30, 64, 175, 0.3); /* Dark Blue with opacity */
    border: 2px solid #60a5fa; /* Medium Blue */
    position: relative;
    overflow: hidden;
    
    /* تأثير الظل والإبراز */
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4), 0 0 0 3px rgba(37, 99, 235, 0.1);
    
    /* حركة خفيفة */
    animation: pulse-glow 2.5s infinite;
}

/* إضافة لمعان متحرك */
.animated-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: all 0.5s;
    animation: shine 3s infinite 1s; /* حركة اللمعان بعد تأخير */
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4), 0 0 0 3px rgba(37, 99, 235, 0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6), 0 0 0 5px rgba(37, 99, 235, 0.2);
    }
}

@keyframes shine {
    0% { left: -75%; }
    10% { left: 100%; }
    100% { left: 100%; }
}
/* ------------------------------------ */
/* RESPONSIVE DESIGN (الكود المتجاوب) */
/* ------------------------------------ */
@media (max-width: 1024px) {
    .hero { text-align: center; padding-top: 6rem; }
    .device-wrapper { height: 550px; margin-top: 3rem; }
    .laptop-frame { width: 80%; height: auto; aspect-ratio: 16/10; transform: rotateX(0deg) !important; position: relative; margin: 0 auto; }
    .phone-frame { transform: scale(0.85) rotateZ(-8deg); left: 2%; bottom: -20px; }
}
.hidden-on-desktop {
    display: none; /* إخفاءها افتراضياً على شاشات الديسكتوب */
}
@media (max-width: 767px) {
    /* تفعيل زري التبديل على الجوال */
    .hidden-on-desktop {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-bottom: 1.5rem;
    }

    .toggle-btn {
        padding: 10px 18px;
        border-radius: 50px;
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-dim);
        font-weight: 600;
        border: 1px solid var(--glass-border);
        transition: 0.3s;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.9rem;
    }

    .toggle-btn.active-toggle {
        background: var(--color-core);
        color: white;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
        border-color: var(--color-core);
    }
    
    /* تغيير طريقة عرض الـ device-wrapper لتناسب التبديل */
    .device-wrapper {
        height: 500px; /* تحديد ارتفاع واضح */
        margin-top: 1rem;
    }
    
    /* تعديل عرض اللابتوب والهاتف على الجوال */
    .laptop-frame { 
        width: 100%; 
        height: auto; 
        aspect-ratio: 16/10; 
        transform: scale(1) !important; /* إلغاء التكبير */
        opacity: 1; 
        filter: none; /* إلغاء الطمس */
        position: absolute; /* وضعهم فوق بعض */
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) !important;
        transition: 0.3s;
    }
    
    .phone-frame {
        width: 260px; height: 540px;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) !important;
        transition: 0.3s;
    }

    /* كلاسات الإخفاء/الإظهار */
    .frame-hidden { 
        opacity: 0 !important; 
        pointer-events: none;
        visibility: hidden;
        transform: translate(-50%, -50%) scale(0.8) !important;
    }
}