/* ads.css - تنسيقات نظام الإعلانات */

/* ===== إعلانات السلايدر ===== */
.ad-slider-container {
    margin: 30px 0;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.ad-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.ad-slider-title {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ad-slider {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.ad-slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.ad-slide {
    min-width: 100%;
    position: relative;
}

.ad-slide .ad-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.ad-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ad-slide:hover .ad-image {
    transform: scale(1.05);
}

.ad-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 20px;
    color: white;
}

.ad-badge {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.ad-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.ad-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.ad-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.ad-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.ad-dot:hover {
    background: var(--secondary-color);
}

/* ===== إعلان بين الفقرات ===== */
.paragraph-ad-container {
    position: relative;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    border-right: 4px solid var(--primary-color);
    transition: all 0.3s;
}

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

.paragraph-ad {
    text-align: center;
}

.paragraph-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.paragraph-ad .ad-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    padding: 0 10px;
}

/* ===== إعلان نهاية المقال ===== */
.article-end-ad {
    margin: 40px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    text-align: center;
    border: 2px dashed var(--primary-color);
    position: relative;
    overflow: hidden;
}

.article-end-ad::before {
    content: 'إعلان';
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.article-end-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* ===== إعلانات الشريط الجانبي ===== */
.sidebar-ad {
    position: relative;
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.sidebar-ad:hover {
    border-color: var(--primary-color);
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.sidebar-ad img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.sidebar-ad .ad-description {
    padding: 12px;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    background: white;
}

/* ===== إعلان عائم ===== */
.floating-ad {
    position: fixed;
    bottom: 100px;
    left: 20px;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    z-index: 999;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    animation: slideInLeft 0.5s ease;
}

.floating-ad .ad-content {
    padding: 15px;
    position: relative;
}

.floating-ad .ad-close {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.floating-ad .ad-close:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.1);
}

.floating-ad img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.floating-ad .ad-description {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

/* ===== شريط الإعلانات العالق ===== */
.ad-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    padding: 12px 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideUp 0.3s ease;
    color: white;
}

.ad-sticky-bar .ad-close {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.ad-sticky-bar .ad-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.sticky-ad-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    margin: 0 15px;
}

.sticky-ad-content a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.sticky-ad-content a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* ===== الأنيميشن ===== */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 73, 153, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(56, 73, 153, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(56, 73, 153, 0);
    }
}

/* ===== تحسينات للهواتف ===== */
@media (max-width: 768px) {
    .ad-slider-container {
        padding: 15px;
        margin: 20px 0;
    }
    
    .ad-image {
        height: 200px;
    }
    
    .ad-title {
        font-size: 1rem;
    }
    
    .floating-ad {
        display: none !important;
    }
    
    .ad-sticky-bar {
        padding: 10px;
    }
    
    .sticky-ad-content a {
        font-size: 0.85rem;
    }
    
    .paragraph-ad-container {
        margin: 20px 0;
        padding: 15px;
    }
    
    .article-end-ad {
        margin: 30px 0;
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .ad-image {
        height: 180px;
    }
    
    .ad-slider-container {
        padding: 12px;
    }
    
    .ad-slider-title {
        font-size: 1rem;
    }
    
    .ad-sticky-bar {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
    }
    
    .sticky-ad-content {
        margin: 0;
        text-align: center;
    }
}