/* 
 * تنسيقات إعلانات الصفحة الرئيسية - نسخة محدثة
 * تم تحديثها في: 27 سبتمبر 2025
 */

/* تنسيقات قسم الإعلانات */

/* تغيير لون العنوان إلى اللون الأبيض */
.ads-section .section-header h2 {
    color: #ffffff !important; /* لون أبيض مع الأولوية القصوى */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* ظل خفيف لتحسين الوضوح */
}

/* تغيير لون الفقرة التوضيحية أيضاً إلى اللون الأبيض */
.ads-section .section-header p {
    color: #ffffff !important;
    opacity: 0.9; /* شفافية خفيفة لتمييزها عن العنوان */
}

/* تنسيقات قسم الإعلانات */
.ads-section {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    padding: 3rem 0;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.ads-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern.png');
    opacity: 0.1;
    pointer-events: none;
}

.ads-slider {
    margin-top: 1.5rem;
    overflow: hidden;
    position: relative;
    padding: 0 30px;
}

/* تنسيقات بطاقة الإعلان */
.ad-card {
    position: relative;
    width: 100%;
    max-width: 700px; /* عرض محدد متناسب مع الارتفاع بنسبة 16:9 تقريبًا */
    height: 400px; /* إعادة الارتفاع إلى 400 كما كان */
    margin: 20px auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.ad-card:hover .ad-image-container img {
    transform: scale(1.05); /* تقليل تأثير التكبير وإزالة الدوران لمظهر أكثر احترافية */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15); /* زيادة الظلال عند التحويم */
}

/* صورة الإعلان */
.ad-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.02); /* خلفية خفيفة للمساحات الفارغة */
}

.ad-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
                transparent 0%, 
                transparent 50%, 
                rgba(0, 0, 0, 0.6) 75%, 
                rgba(0, 0, 0, 0.85) 100%);
    z-index: 2;
}

.ad-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto; /* تغيير من height: 100% لمنع التمدد العمودي للصور الصغيرة */
    object-fit: contain;
    object-position: center; /* توسيط الصورة */
    border-radius: 5px; /* إضافة شكل مستدير خفيف للصورة */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05); /* ظلال خفيفة للصورة */
    transition: all 0.3s ease; /* انتقال سلس للتأثيرات */
}

/* محتوى الإعلان */
.ad-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px 20px;
    z-index: 3;
    color: white;
    text-align: center;
}

.ad-content h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.ad-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.ad-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: block;
}

/* شريط الإعلان */
.ad-ribbon {
    position: absolute;
    top: 20px;
    right: -25px;
    padding: 5px 20px;
    background: #ffd700;
    color: #000;
    font-weight: bold;
    transform: rotate(45deg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 4;
    font-size: 0.8rem;
    width: 120px;
    text-align: center;
}

.ribbon-new { 
    background: #4caf50; 
    color: #fff; 
}

.ribbon-discount { 
    background: #f44336; 
    color: #fff; 
}

.ribbon-special { 
    background: #ffd700; 
    color: #000; 
}

/* زر "اقرأ المزيد" */
.ad-content .btn {
    display: inline-block;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.9);
    color: #0d47a1;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: none;
    margin-top: 10px;
}

.ad-content .btn:hover {
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* أزرار التنقل */
.ads-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.ads-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ads-prev {
    left: 10px;
}

.ads-next {
    right: 10px;
}

.ads-nav i {
    color: #fff;
    font-size: 1.1rem;
}

/* التحريكات */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تجاوب مع الشاشات المتوسطة */
@media (max-width: 768px) {
    .ad-card {
        height: 320px; /* تقليل الارتفاع ليتناسب مع الهواتف */
        max-width: 600px;
    }
    
    .ad-image-container img {
        height: 100%; /* ملئ الارتفاع في الهواتف */
        object-fit: cover; /* تغيير للهواتف لملء المساحة */
    }
    
    .ad-content {
        padding: 20px;
    }
    
    .ad-content h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .ad-content p {
        margin-bottom: 15px;
    }
    
    .ad-content .btn {
        padding: 8px 20px;
    }
}

/* تجاوب مع الشاشات الصغيرة */
@media (max-width: 576px) {
    .ad-card {
        height: 225px; /* تقليل الارتفاع للهواتف الصغيرة */
        margin: 15px auto;
        max-width: 100%;
    }
    
    .ad-image-container::after {
        background: linear-gradient(to bottom, 
                    transparent 0%, 
                    transparent 30%, 
                    rgba(0, 0, 0, 0.7) 70%, 
                    rgba(0, 0, 0, 0.9) 100%);
    }
    
    /* أهم شيء: عدم قص الصور المهمة */
    .ad-image-container img {
        object-position: center 20%; /* تحسين موضع الصورة للتركيز على الجزء العلوي */
    }
    
    .ad-content {
        padding: 15px;
    }
    
    .ad-content h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .ad-content p {
        font-size: 0.9rem;
        margin-bottom: 10px;
        line-height: 1.4;
    }
    
    .ad-content .btn {
        padding: 6px 15px;
        font-size: 0.85rem;
    }
    
    .ad-ribbon {
        padding: 4px 15px;
        font-size: 0.75rem;
        right: -20px;
        width: 110px;
    }
}
