/*--------------------------------------------------------------
  Exit Intent Popup - نافذة منبثقة عند محاولة المغادرة
--------------------------------------------------------------*/

/* الحاوية الرئيسية */
.mps-exit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mps-exit-popup.active {
    opacity: 1;
    visibility: visible;
}

/* الخلفية الشفافة */
.mps-exit-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

/* النافذة المنبثقة */
.mps-exit-popup-container {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000000;
    animation: slideInUp 0.5s ease-out;
}

.mps-exit-popup.active .mps-exit-popup-container {
    transform: scale(1) translateY(0);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* زر الإغلاق */
.mps-exit-popup-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
}

.mps-exit-popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.mps-exit-popup-close .material-icons {
    font-size: 24px;
    color: #333;
}

/* محتوى النافذة */
.mps-exit-popup-content {
    padding: 50px 30px 40px;
    text-align: center;
}

/* أيقونة الجرس */
.mps-exit-popup-icon {
    margin: 0 auto 20px;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

.mps-exit-popup-icon .material-icons {
    font-size: 40px;
    color: #ffffff;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(102, 126, 234, 0);
    }
}

/* العنوان */
.mps-exit-popup-title {
    margin: 0 0 15px;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
}

/* الرسالة */
.mps-exit-popup-message {
    margin: 0 0 30px;
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}

/* حاوية أزرار التواصل */
.mps-exit-popup-social {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 25px;
}

/* الأزرار الأساسية */
.mps-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.mps-social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.mps-social-btn:active {
    transform: translateY(-1px);
}

.mps-social-btn svg {
    flex-shrink: 0;
}

/* تأثير الموجة عند الضغط */
.mps-social-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mps-social-btn:active::before {
    width: 300px;
    height: 300px;
}

/* تيليجرام - أزرق فاتح */
.mps-telegram {
    background: linear-gradient(135deg, #0088cc 0%, #005f8c 100%);
}

.mps-telegram:hover {
    background: linear-gradient(135deg, #009ee3 0%, #0088cc 100%);
}

/* واتساب - أخضر */
.mps-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.mps-whatsapp:hover {
    background: linear-gradient(135deg, #2fe375 0%, #25D366 100%);
}

/* يوتيوب - أحمر */
.mps-youtube {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
}

.mps-youtube:hover {
    background: linear-gradient(135deg, #ff1a1a 0%, #FF0000 100%);
}

/* فيسبوك - أزرق */
.mps-facebook {
    background: linear-gradient(135deg, #1877F2 0%, #0d5dbf 100%);
}

.mps-facebook:hover {
    background: linear-gradient(135deg, #3b8df5 0%, #1877F2 100%);
}

/* التصميم المتجاوب - الأجهزة اللوحية */
@media (max-width: 768px) {
    .mps-exit-popup-container {
        width: 95%;
        max-width: 450px;
    }

    .mps-exit-popup-content {
        padding: 45px 25px 35px;
    }

    .mps-exit-popup-icon {
        width: 70px;
        height: 70px;
    }

    .mps-exit-popup-icon .material-icons {
        font-size: 35px;
    }

    .mps-exit-popup-title {
        font-size: 22px;
    }

    .mps-exit-popup-message {
        font-size: 15px;
    }

    .mps-social-btn {
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* التصميم المتجاوب - الهواتف */
@media (max-width: 480px) {
    .mps-exit-popup-container {
        width: 95%;
        border-radius: 16px;
    }

    .mps-exit-popup-content {
        padding: 40px 20px 30px;
    }

    .mps-exit-popup-close {
        top: 12px;
        left: 12px;
        width: 32px;
        height: 32px;
    }

    .mps-exit-popup-close .material-icons {
        font-size: 20px;
    }

    .mps-exit-popup-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }

    .mps-exit-popup-icon .material-icons {
        font-size: 30px;
    }

    .mps-exit-popup-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .mps-exit-popup-message {
        font-size: 14px;
        margin-bottom: 25px;
    }

    .mps-exit-popup-social {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mps-social-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* الوضع الداكن (اختياري) */
@media (prefers-color-scheme: dark) {
    .mps-exit-popup-container {
        background: #1e293b;
    }

    .mps-exit-popup-title {
        color: #f1f5f9;
    }

    .mps-exit-popup-message {
        color: #cbd5e1;
    }

    .mps-exit-popup-close .material-icons {
        color: #f1f5f9;
    }

    .mps-exit-popup-close {
        background: rgba(255, 255, 255, 0.1);
    }

    .mps-exit-popup-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* تحسينات الوصولية */
.mps-exit-popup-close:focus,
.mps-social-btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* منع التمرير عند فتح النافذة */
body.mps-exit-popup-open {
    overflow: hidden;
}