/* Popup Promo Styles - متطابق مع تصميم الموقع */

/* استخدام متغيرات الألوان من الموقع */
.popup-overlay {
    --popup-primary: var(--primary-color, #103a67);
    --popup-accent: var(--accent-color, #ff7800);
    --popup-overlay-bg: rgba(16, 58, 103, 0.85);
    --popup-border-radius: 20px;
    --popup-shadow: 0 25px 50px rgba(16, 58, 103, 0.3);
    --popup-font: 'Tajawal', Arial, sans-serif;
}

/* Overlay الرئيسي */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--popup-overlay-bg);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--popup-font);
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Container الرئيسي */
.popup-container {
    background: #ffffff;
    border-radius: var(--popup-border-radius);
    box-shadow: var(--popup-shadow);
    max-width: 950px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.85) translateY(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.popup-overlay.show .popup-container {
    transform: scale(1) translateY(0);
}

.popup-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--popup-primary) 0%, var(--popup-accent) 100%);
    border-radius: var(--popup-border-radius);
    z-index: -1;
    margin: -3px;
}

/* زر الإغلاق */
.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--popup-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 58, 103, 0.2);
}

.popup-close:hover {
    background: var(--popup-primary);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 25px rgba(16, 58, 103, 0.4);
}

.popup-close::before,
.popup-close::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 3px;
    background: var(--popup-primary);
    border-radius: 2px;
    transform: rotate(45deg);
    transition: all 0.3s ease;
}

.popup-close:hover::before,
.popup-close:hover::after {
    background: #ffffff;
}

.popup-close::after {
    transform: rotate(-45deg);
}

.popup-close:hover {
    background: white;
    transform: scale(1.1);
}

.popup-close::before,
.popup-close::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: #333;
    transform: rotate(45deg);
}

.popup-close::after {
    transform: rotate(-45deg);
}

/* Video Section */
.popup-video-section {
    position: relative;
    background: #000;
    padding: 0;
}

.popup-video-iframe {
    width: 100%;
    height: 300px;
    border: none;
    display: block;
}

.popup-video-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

/* Promo Section */
.popup-promo-section {
    padding: 30px;
    text-align: center;
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.popup-title {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    font-family: 'Tajawal', sans-serif;
}

.popup-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.popup-promo-image {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.popup-promo-text {
    font-size: 1.2rem;
    color: #444;
    margin: 20px 0;
    line-height: 1.6;
    font-weight: 500;
}

.popup-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
}

.popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: white;
    text-decoration: none;
}

/* Layout Variations */
.popup-layout-video-only .popup-promo-section {
    display: none;
}

.popup-layout-promo-only .popup-video-section {
    display: none;
}

.popup-layout-both {
    width: 800px;
    max-width: 90vw;
}

.popup-layout-both .popup-video-section {
    flex: 1;
}

.popup-layout-both .popup-promo-section {
    flex: 1;
}

/* RTL Support */
[dir="rtl"] .popup-close {
    right: auto;
    left: 15px;
}

[dir="rtl"] .popup-title,
[dir="rtl"] .popup-description,
[dir="rtl"] .popup-promo-text {
    text-align: right;
    font-family: 'Tajawal', sans-serif;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .popup-container {
        width: 95vw;
        max-height: 85vh;
        margin: 20px;
    }
    
    .popup-layout-both {
        flex-direction: column;
        width: 95vw;
    }
    
    .popup-video-iframe {
        height: 250px;
    }
    
    .popup-promo-section {
        padding: 20px;
    }
    
    .popup-title {
        font-size: 1.5rem;
    }
    
    .popup-description,
    .popup-promo-text {
        font-size: 1rem;
    }
    
    .popup-button {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .popup-container {
        width: 98vw;
        margin: 10px;
    }
    
    .popup-video-iframe {
        height: 200px;
    }
    
    .popup-promo-section {
        padding: 15px;
    }
    
    .popup-title {
        font-size: 1.3rem;
    }
    
    .popup-close {
        width: 35px;
        height: 35px;
        top: 10px;
        right: 10px;
    }
    
    [dir="rtl"] .popup-close {
        right: auto;
        left: 10px;
    }
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
}

/* Custom Scrollbar for popup content */
.popup-promo-section::-webkit-scrollbar {
    width: 6px;
}

.popup-promo-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.popup-promo-section::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.popup-promo-section::-webkit-scrollbar-thumb:hover {
    background: #555;
}
