/**
 * تنسيقات الإعلانات
 * Advertisement Styles
 */

/* حاوية الإعلان العامة */
.advertisement-container {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.advertisement-container:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* رابط الإعلان */
.ad-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* إعلان نصي */
.ad-text {
    font-family: 'Cairo', sans-serif;
    color: #333;
    line-height: 1.6;
    text-align: center;
}

.ad-text h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.ad-text p {
    margin: 10px 0;
}

/* إعلان صورة */
.ad-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* إعلان فيديو */
.ad-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.ad-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* إعلانات في مواقع محددة */

/* أعلى الصفحة */
.ad-position-top {
    max-width: 100%;
    margin: 20px auto;
}

.ad-position-top .advertisement-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 20px;
}

.ad-position-top .ad-text {
    color: white;
}

/* الشريط الجانبي */
.ad-position-sidebar {
    max-width: 300px;
}

/* وسط الصفحة */
.ad-position-middle {
    max-width: 800px;
    margin: 30px auto;
}

/* الشريط السفلي المتحرك */
.bottom-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #7ed0f0 0%, #0b6b93 100%);
    color: white;
    padding: 15px 50px 15px 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    z-index: 9999;
    direction: rtl;
    overflow: hidden;
}

.banner-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: scroll-banner 30s linear infinite;
}

@keyframes scroll-banner {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.banner-item {
    display: inline-flex;
    align-items: center;
    margin-left: 50px;
    font-size: 16px;
    font-weight: 600;
}

.banner-item img {
    max-height: 40px;
    margin-left: 15px;
    border-radius: 5px;
}

.banner-item a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.banner-item a:hover {
    opacity: 0.8;
}

/* زر إغلاق الشريط السفلي */
.close-banner {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.close-banner:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}

/* إخفاء الشريط عند الإغلاق */
.bottom-banner.hidden {
    display: none;
}

/* تنسيقات responsive */
@media (max-width: 768px) {
    .advertisement-container {
        padding: 10px;
        margin: 10px 0;
    }
    
    .ad-position-sidebar {
        max-width: 100%;
    }
    
    .bottom-banner {
        padding: 10px 40px 10px 10px;
    }
    
    .banner-item {
        font-size: 14px;
        margin-left: 30px;
    }
    
    .banner-item img {
        max-height: 30px;
        margin-left: 10px;
    }
    
    @keyframes scroll-banner {
        0% {
            transform: translateX(100%);
        }
        100% {
            transform: translateX(-100%);
        }
    }
}

/* تأثيرات إضافية للإعلانات الجذابة */
.ad-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.ad-shine {
    position: relative;
    overflow: hidden;
}

.ad-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    bottom: -50%;
    left: -50%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: rotate(45deg) translateX(-100%);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0% {
        transform: rotate(45deg) translateX(-100%);
    }
    100% {
        transform: rotate(45deg) translateX(100%);
    }
}
