/* ========================================
   NEXUS Careers Page
   ملف الأنماط الرئيسي
   تطوير: NEXUS Team
   الإصدار: 1.0.0
   ======================================== */

/* ========================================
   1. المتغيرات الأساسية (CSS Variables)
   ======================================== */
:root {
    /* ---------- ألوان NEXUS الأساسية ---------- */
    --nexus-900: #0a0e1a;
    --nexus-800: #0f172a;
    --nexus-700: #1e293b;
    --nexus-600: #334155;
    --nexus-500: #475569;
    
    /* ---------- ألوان التمييز ---------- */
    --cyan-400: #22d3ee;
    --cyan-500: #06b6d4;
    --cyan-600: #0891b2;
    
    --violet-400: #a78bfa;
    --violet-500: #8b5cf6;
    --violet-600: #7c3aed;
    
    /* ---------- ألوان النصوص ---------- */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* ---------- التدرجات ---------- */
    --gradient-primary: linear-gradient(135deg, #8b5cf6, #06b6d4);
    --gradient-reverse: linear-gradient(135deg, #06b6d4, #8b5cf6);
    --gradient-text: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 50%, #a78bfa 100%);
    
    /* ---------- الزجاج (Glassmorphism) ---------- */
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(139, 92, 246, 0.15);
    --glass-hover-bg: rgba(30, 41, 59, 0.6);
    --glass-hover-border: rgba(34, 211, 238, 0.4);
    
    /* ---------- الحركات ---------- */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* ---------- الظلال ---------- */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 30px rgba(139, 92, 246, 0.15);
    --shadow-lg: 0 20px 60px rgba(139, 92, 246, 0.2);
    --shadow-glow: 0 0 40px rgba(34, 211, 238, 0.15);
    
    /* ---------- الأبعاد ---------- */
    --navbar-height: 80px;
    --container-max: 1280px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-2xl: 32px;
}

/* ========================================
   2. إعادة التعيين والأساسيات
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--navbar-height);
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--nexus-900);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   3. الخلفية المتحركة (Hero Background)
   ======================================== */
.hero-bg {
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 70%),
        var(--nexus-900);
    position: relative;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(139, 92, 246, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    pointer-events: none;
}

/* ========================================
   4. النصوص المتدرجة (Gradient Text)
   ======================================== */
.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradient 8s ease infinite;
}

@keyframes gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========================================
   5. تأثير الزجاج (Glassmorphism)
   ======================================== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.glass-hover {
    transition: var(--transition-slow);
}

.glass-hover:hover {
    background: var(--glass-hover-bg);
    border-color: var(--glass-hover-border);
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   6. الأشكال العائمة (Floating Shapes)
   ======================================== */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
    will-change: transform;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ========================================
   7. بطاقات الوظائف (Job Cards)
   ======================================== */
.job-card {
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.job-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.1), transparent);
    transition: right 0.6s ease;
    pointer-events: none;
}

.job-card:hover::before {
    right: 100%;
}

.job-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 
        0 25px 50px rgba(139, 92, 246, 0.25),
        var(--shadow-glow);
}

.job-card:hover .job-icon {
    transform: rotate(-10deg) scale(1.15);
    color: var(--cyan-400);
}

.job-icon {
    transition: var(--transition-slow);
}

/* ========================================
   8. الأزرار (Buttons)
   ======================================== */
.btn-primary {
    position: relative;
    overflow: hidden;
    background: var(--gradient-primary);
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-reverse);
    transition: right 0.4s ease;
}

.btn-primary:hover::before {
    right: 0;
}

.btn-primary span,
.btn-primary i {
    position: relative;
    z-index: 1;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-outline {
    border: 2px solid rgba(139, 92, 246, 0.5);
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.btn-outline:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--violet-400);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   9. حقول النموذج (Form Inputs)
   ======================================== */
.form-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: var(--transition-normal);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--cyan-400);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:hover:not(:focus) {
    border-color: rgba(139, 92, 246, 0.4);
}

/* تأثير الأخطاء */
.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-input.success {
    border-color: #10b981;
}

/* ========================================
   10. الشارات (Badges)
   ======================================== */
.badge {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.remote-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: pulse-green 2s infinite;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* ========================================
   11. شريط التمرير المخصص (Custom Scrollbar)
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--nexus-900);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--violet-500), var(--cyan-500));
    border-radius: 5px;
    transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--violet-400), var(--cyan-400));
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--violet-500) var(--nexus-900);
}

/* ========================================
   12. تأثيرات الظهور (Reveal Animations)
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* أنواع مختلفة من الظهور */
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active,
.reveal-right.active,
.reveal-scale.active {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* ========================================
   13. رسالة النجاح (Success Message)
   ======================================== */
.success-message {
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   14. خط زخرفي للعناوين (Section Title Line)
   ======================================== */
.section-title-line {
    background: linear-gradient(90deg, transparent, var(--violet-500), var(--cyan-500), transparent);
    height: 2px;
    border-radius: 2px;
}

/* ========================================
   15. شريط التنقل (Navbar)
   ======================================== */
#navbar {
    transition: var(--transition-normal);
}

.nav-scrolled {
    background: rgba(10, 14, 26, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: var(--shadow-sm);
}

/* روابط التنقل */
.nav-link {
    position: relative;
    transition: var(--transition-normal);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--cyan-400);
}

/* ========================================
   16. الإشعارات (Notifications/Toasts)
   ======================================== */
.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 16px 24px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    min-width: 300px;
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-info {
    background: linear-gradient(135deg, var(--cyan-500), var(--violet-600));
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* ========================================
   17. تأثيرات إضافية (Extra Effects)
   ======================================== */
/* تأثير الـ glow */
.glow-effect {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* تأثير الـ shimmer */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { right: -100%; }
    100% { right: 100%; }
}

/* تأثير النبض */
.pulse-effect {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* تأثير الدوران */
.spin-slow {
    animation: spin 8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   18. تحسينات الأداء (Performance)
   ======================================== */
.will-change-transform {
    will-change: transform;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* تقليل الحركة للمستخدمين الذين يفضلون ذلك */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .floating-shape {
        animation: none;
    }
    
    .gradient-text {
        animation: none;
        background-position: 0% 50%;
    }
}

/* ========================================
   19. استجابة الشاشات (Responsive Design)
   ======================================== */
@media (max-width: 1024px) {
    .floating-shape {
        opacity: 0.2;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 70px;
    }
    
    .gradient-text {
        font-size: 2.5rem !important;
    }
    
    .hero-bg::before {
        background-size: 30px 30px;
    }
    
    .floating-shape {
        display: none;
    }
    
    .job-card:hover {
        transform: translateY(-5px) scale(1);
    }
    
    .glass-hover:hover {
        transform: translateY(-4px);
    }
    
    .btn-primary:hover,
    .btn-outline:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 480px) {
    .gradient-text {
        font-size: 2rem !important;
    }
    
    .toast {
        min-width: 250px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .glass {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* ========================================
   20. الوضع الفاتح (Light Mode - Optional)
   ======================================== */
body.light-mode {
    --nexus-900: #f8fafc;
    --nexus-800: #f1f5f9;
    --nexus-700: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(139, 92, 246, 0.2);
    background: #f8fafc;
}

body.light-mode .hero-bg {
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        #f8fafc;
}

body.light-mode .form-input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ========================================
   21. طباعة (Print Styles)
   ======================================== */
@media print {
    .hero-bg,
    .floating-shape,
    #navbar,
    .btn-primary,
    .btn-outline {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .glass {
        background: white;
        border: 1px solid #ddd;
    }
}

/* ========================================
   22. أدوات مساعدة (Utility Classes)
   ======================================== */
.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-gradient-reverse {
    background: var(--gradient-reverse);
}

.border-gradient {
    border: 2px solid transparent;
    background: 
        linear-gradient(var(--nexus-800), var(--nexus-800)) padding-box,
        var(--gradient-primary) border-box;
}

/* إخفاء العناصر بصرياً مع الحفاظ عليها للقارئات */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* منع التحديد */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* مؤشر مخصص */
.cursor-pointer {
    cursor: pointer;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

/* ========================================
   23. تأثيرات النموذج المتقدمة
   ======================================== */
/* Label animation */
.form-label-animated {
    position: relative;
    transition: var(--transition-normal);
}

.form-input:focus ~ .form-label-animated,
.form-input:not(:placeholder-shown) ~ .form-label-animated {
    color: var(--cyan-400);
    transform: translateY(-2px);
}

/* Character counter */
.char-counter {
    transition: var(--transition-fast);
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.error {
    color: #ef4444;
    font-weight: 600;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   24. تأثيرات البطاقات المتقدمة
   ======================================== */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-3d:hover {
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
}

/* تأثير الـ tilt */
.tilt-effect {
    transition: transform 0.3s ease;
}

/* ========================================
   25. شارة "جديد" (New Badge)
   ======================================== */
.new-badge {
    position: absolute;
    top: -10px;
    left: -10px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    animation: pulse 2s infinite;
}