/* ================================
   نافذة منبثقة للترويج للتطبيق
   ================================ */

.jobs2-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: jobs2-fadeIn 0.4s ease-out;
    touch-action: none;
}

.jobs2-popup-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: 20px;
}

.jobs2-popup-content {
    position: relative;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 25px;
    padding: 20px;
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.4),
        0 10px 25px rgba(0, 0, 0, 0.2);
    transform: scale(0.8);
    animation: jobs2-popupSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.jobs2-popup-image {
    width: 100%;
    height: auto;
    max-width: 420px;
    border-radius: 18px;
    display: block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.jobs2-popup-link {
    display: block;
    text-decoration: none;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
}

.jobs2-popup-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.jobs2-popup-link:hover::before {
    opacity: 1;
}

.jobs2-popup-link:hover .jobs2-popup-image {
    transform: scale(1.03);
}

.jobs2-popup-link:active .jobs2-popup-image {
    transform: scale(0.98);
}

.jobs2-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 45px;
    height: 45px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 4px 10px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.jobs2-close-btn:hover {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    transform: scale(1.15) rotate(90deg);
    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.2),
        0 6px 15px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.2);
}

.jobs2-close-btn:active {
    transform: scale(1.05) rotate(90deg);
}

.jobs2-close-btn svg {
    width: 22px;
    height: 22px;
    color: #495057;
    transition: color 0.3s ease;
}

.jobs2-close-btn:hover svg {
    color: #212529;
}

/* الرسوم المتحركة */
@keyframes jobs2-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes jobs2-popupSlideIn {
    0% {
        transform: scale(0.6) translateY(60px) rotate(5deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.05) translateY(-10px) rotate(0deg);
        opacity: 0.8;
    }

    100% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
    }
}

@keyframes jobs2-popupSlideOut {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(0.6) translateY(60px) rotate(-5deg);
        opacity: 0;
    }
}

@keyframes jobs2-fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* تحسينات للأجهزة اللوحية */
@media (max-width: 768px) and (orientation: landscape) {
    .jobs2-popup-container {
        max-width: 70vh;
        max-height: 85vw;
    }

    .jobs2-popup-content {
        padding: 15px;
    }

    .jobs2-popup-image {
        max-width: 350px;
    }
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 480px) {
    .jobs2-popup-overlay {
        padding: 15px;
    }

    .jobs2-popup-container {
        max-width: 95vw;
        margin: 0;
    }

    .jobs2-popup-content {
        padding: 15px;
        border-radius: 20px;
        border-width: 2px;
    }

    .jobs2-popup-image {
        max-width: 320px;
        border-radius: 15px;
    }

    .jobs2-popup-link {
        border-radius: 15px;
    }

    .jobs2-close-btn {
        width: 40px;
        height: 40px;
        top: -12px;
        right: -12px;
        border-width: 2px;
    }

    .jobs2-close-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* استجابة للشاشات الصغيرة جداً */
@media (max-width: 360px) {
    .jobs2-popup-content {
        padding: 12px;
        border-radius: 18px;
    }

    .jobs2-popup-image {
        max-width: 280px;
        border-radius: 12px;
    }

    .jobs2-popup-link {
        border-radius: 12px;
    }

    .jobs2-close-btn {
        width: 35px;
        height: 35px;
        top: -10px;
        right: -10px;
    }

    .jobs2-close-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* تحسينات للأداء والوضوح */
.jobs2-popup-overlay * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* إخفاء شريط التمرير أثناء عرض النافذة - آمن للإعلانات */
body.jobs2-popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* حماية الإعلانات من التداخل */
.jobs2-popup-overlay {
    pointer-events: auto;
}

.jobs2-popup-overlay * {
    pointer-events: auto;
}

/* استثناء عناصر الإعلانات */
.jobs2-popup-open .adsbygoogle,
.jobs2-popup-open [id*="google_ads"],
.jobs2-popup-open [class*="adsense"],
.jobs2-popup-open [data-ad-client],
.jobs2-popup-open iframe[src*="googlesyndication"] {
    pointer-events: auto !important;
    visibility: visible !important;
    display: block !important;
}

/* منع تداخل النافذة مع إعلانات الهيدر */
.jobs2-popup-container {
    margin-top: 60px;
    /* مساحة للإعلانات العلوية */
    margin-bottom: 60px;
    /* مساحة للإعلانات السفلية */
}

/* تحسينات الحركة للأجهزة التي تفضل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    .jobs2-popup-overlay {
        animation: none;
    }

    .jobs2-popup-content {
        animation: none;
        transform: scale(1);
    }

    .jobs2-popup-image,
    .jobs2-close-btn {
        transition: none;
    }

    .jobs2-close-btn:hover {
        transform: scale(1.1);
    }
}