/* ================================
   ظ†ط§ظپط°ط© ظ…ظ†ط¨ط«ظ‚ط© ظ„ظ„طھط±ظˆظٹط¬ ظ„ظ„طھط·ط¨ظٹظ‚
   ================================ */

.ewdifh-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: ewdifh-fadeIn 0.4s ease-out;
    touch-action: none;
}

.ewdifh-popup-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: 20px;
}

.ewdifh-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: ewdifh-popupSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.ewdifh-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;
}

.ewdifh-popup-link {
    display: block;
    text-decoration: none;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
}

.ewdifh-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;
}

.ewdifh-popup-link:hover::before {
    opacity: 1;
}

.ewdifh-popup-link:hover .ewdifh-popup-image {
    transform: scale(1.03);
}

.ewdifh-popup-link:active .ewdifh-popup-image {
    transform: scale(0.98);
}

.ewdifh-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;
}

.ewdifh-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);
}

.ewdifh-close-btn:active {
    transform: scale(1.05) rotate(90deg);
}

.ewdifh-close-btn svg {
    width: 22px;
    height: 22px;
    color: #495057;
    transition: color 0.3s ease;
}

.ewdifh-close-btn:hover svg {
    color: #212529;
}

/* ط§ظ„ط±ط³ظˆظ… ط§ظ„ظ…طھط­ط±ظƒط© */
@keyframes ewdifh-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes ewdifh-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 ewdifh-popupSlideOut {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(0.6) translateY(60px) rotate(-5deg);
        opacity: 0;
    }
}

@keyframes ewdifh-fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* طھط­ط³ظٹظ†ط§طھ ظ„ظ„ط£ط¬ظ‡ط²ط© ط§ظ„ظ„ظˆط­ظٹط© */
@media (max-width: 768px) and (orientation: landscape) {
    .ewdifh-popup-container {
        max-width: 70vh;
        max-height: 85vw;
    }

    .ewdifh-popup-content {
        padding: 15px;
    }

    .ewdifh-popup-image {
        max-width: 350px;
    }
}

/* ط§ط³طھط¬ط§ط¨ط© ظ„ظ„ط´ط§ط´ط§طھ ط§ظ„طµط؛ظٹط±ط© */
@media (max-width: 480px) {
    .ewdifh-popup-overlay {
        padding: 15px;
    }

    .ewdifh-popup-container {
        max-width: 95vw;
        margin: 0;
    }

    .ewdifh-popup-content {
        padding: 15px;
        border-radius: 20px;
        border-width: 2px;
    }

    .ewdifh-popup-image {
        max-width: 320px;
        border-radius: 15px;
    }

    .ewdifh-popup-link {
        border-radius: 15px;
    }

    .ewdifh-close-btn {
        width: 40px;
        height: 40px;
        top: -12px;
        right: -12px;
        border-width: 2px;
    }

    .ewdifh-close-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ط§ط³طھط¬ط§ط¨ط© ظ„ظ„ط´ط§ط´ط§طھ ط§ظ„طµط؛ظٹط±ط© ط¬ط¯ط§ظ‹ */
@media (max-width: 360px) {
    .ewdifh-popup-content {
        padding: 12px;
        border-radius: 18px;
    }

    .ewdifh-popup-image {
        max-width: 280px;
        border-radius: 12px;
    }

    .ewdifh-popup-link {
        border-radius: 12px;
    }

    .ewdifh-close-btn {
        width: 35px;
        height: 35px;
        top: -10px;
        right: -10px;
    }

    .ewdifh-close-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* طھط­ط³ظٹظ†ط§طھ ظ„ظ„ط£ط¯ط§ط، ظˆط§ظ„ظˆط¶ظˆط­ */
.ewdifh-popup-overlay * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ط¥ط®ظپط§ط، ط´ط±ظٹط· ط§ظ„طھظ…ط±ظٹط± ط£ط«ظ†ط§ط، ط¹ط±ط¶ ط§ظ„ظ†ط§ظپط°ط© - ط¢ظ…ظ† ظ„ظ„ط¥ط¹ظ„ط§ظ†ط§طھ */
body.ewdifh-popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ط­ظ…ط§ظٹط© ط§ظ„ط¥ط¹ظ„ط§ظ†ط§طھ ظ…ظ† ط§ظ„طھط¯ط§ط®ظ„ */
.ewdifh-popup-overlay {
    pointer-events: auto;
}

.ewdifh-popup-overlay * {
    pointer-events: auto;
}

/* ط§ط³طھط«ظ†ط§ط، ط¹ظ†ط§طµط± ط§ظ„ط¥ط¹ظ„ط§ظ†ط§طھ */
.ewdifh-popup-open .adsbygoogle,
.ewdifh-popup-open [id*="google_ads"],
.ewdifh-popup-open [class*="adsense"],
.ewdifh-popup-open [data-ad-client],
.ewdifh-popup-open iframe[src*="googlesyndication"] {
    pointer-events: auto !important;
    visibility: visible !important;
    display: block !important;
}

/* ظ…ظ†ط¹ طھط¯ط§ط®ظ„ ط§ظ„ظ†ط§ظپط°ط© ظ…ط¹ ط¥ط¹ظ„ط§ظ†ط§طھ ط§ظ„ظ‡ظٹط¯ط± */
.ewdifh-popup-container {
    margin-top: 60px;
    /* ظ…ط³ط§ط­ط© ظ„ظ„ط¥ط¹ظ„ط§ظ†ط§طھ ط§ظ„ط¹ظ„ظˆظٹط© */
    margin-bottom: 60px;
    /* ظ…ط³ط§ط­ط© ظ„ظ„ط¥ط¹ظ„ط§ظ†ط§طھ ط§ظ„ط³ظپظ„ظٹط© */
}

/* طھط­ط³ظٹظ†ط§طھ ط§ظ„ط­ط±ظƒط© ظ„ظ„ط£ط¬ظ‡ط²ط© ط§ظ„طھظٹ طھظپط¶ظ„ طھظ‚ظ„ظٹظ„ ط§ظ„ط­ط±ظƒط© */
@media (prefers-reduced-motion: reduce) {
    .ewdifh-popup-overlay {
        animation: none;
    }

    .ewdifh-popup-content {
        animation: none;
        transform: scale(1);
    }

    .ewdifh-popup-image,
    .ewdifh-close-btn {
        transition: none;
    }

    .ewdifh-close-btn:hover {
        transform: scale(1.1);
    }
}