/* ============================================
   مَزون - نظام الإعلانات المتكامل
   Mazoon Ads System v1.0
   ============================================ */

/* ===== AD CONTAINER BASE ===== */
.ad-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ad-container:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

body.dark-mode .ad-container {
    background: #2C2C2E;
}

/* ===== AD LABEL ===== */
.ad-label {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.6);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.ad-label::before {
    content: '📢 ';
}

/* ===== HEADER TOP BAR AD ===== */
.header-ad-bar {
    background: linear-gradient(90deg, #0F4444, #1A6B6B);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 999;
}

.header-ad-bar .ad-label {
    position: static;
    background: rgba(255,255,255,0.2);
}

.header-ad-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #FFFFFF;
    font-size: 0.9rem;
}

.header-ad-content a {
    color: #E8D5A3;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.header-ad-content a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

.header-ad-close {
    position: absolute;
    left: 1rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.header-ad-close:hover {
    color: #FFFFFF;
    transform: scale(1.2);
}

/* ===== NATIVE CARD AD ===== */
.ad-card {
    background: linear-gradient(135deg, rgba(201,165,77,0.1), rgba(26,107,107,0.1));
    border: 2px dashed #C9A54D;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
}

.ad-card-image {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #C9A54D, #E8D5A3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.ad-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.ad-card-subtitle {
    font-size: 0.75rem;
    color: #6B7280;
}

.ad-card-cta {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, #1A6B6B, #2A8F8F);
    color: #FFFFFF;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ad-card:hover .ad-card-cta {
    transform: scale(1.05);
}

/* ===== BANNER AD ===== */
.ad-banner {
    width: 100%;
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #F5E6C8, #FBF6EC);
    border: 1px solid rgba(201,165,77,0.3);
}

body.dark-mode .ad-banner {
    background: linear-gradient(135deg, #2C2C2E, #3C3C3E);
}

.ad-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.ad-banner-image {
    width: 200px;
    height: 100px;
    background: linear-gradient(135deg, #C9A54D, #E8D5A3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-banner-text {
    text-align: right;
}

.ad-banner-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ad-banner-desc {
    font-size: 0.85rem;
    color: #6B7280;
    margin-bottom: 0.75rem;
}

.ad-banner-btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #1A6B6B, #2A8F8F);
    color: #FFFFFF;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ad-banner-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(26,107,107,0.3);
}

/* ===== SIDEBAR AD ===== */
.sidebar-ad {
    background: linear-gradient(180deg, rgba(26,107,107,0.05), rgba(201,165,77,0.05));
    border: 1px solid rgba(201,165,77,0.2);
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.sidebar-ad-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #1C1C1E, #1A6B6B, #C9A54D);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.sidebar-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-ad-image .ad-icon {
    font-size: 3rem;
    color: #FFFFFF;
}

.sidebar-ad-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.sidebar-ad-desc {
    font-size: 0.8rem;
    color: #6B7280;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.sidebar-ad-cta {
    display: inline-block;
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #C9A54D, #E8D5A3);
    color: #1C1C1E;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-ad-cta:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(201,165,77,0.4);
}

/* ===== IN-STREAM AD ===== */
.inline-ad {
    background: linear-gradient(135deg, rgba(201,165,77,0.08), rgba(26,107,107,0.08));
    border: 1px dashed #C9A54D;
    border-radius: 16px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    gap: 1rem;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.inline-ad:hover {
    background: linear-gradient(135deg, rgba(201,165,77,0.15), rgba(26,107,107,0.15));
    transform: translateX(-5px);
}

.inline-ad-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #C9A54D, #E8D5A3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.inline-ad-content {
    flex: 1;
}

.inline-ad-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.inline-ad-desc {
    font-size: 0.75rem;
    color: #6B7280;
}

.inline-ad-badge {
    padding: 0.25rem 0.5rem;
    background: #C9A54D;
    color: #1C1C1E;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
}

/* ===== SPONSORED CARD ===== */
.sponsored-card {
    border: 2px solid #C9A54D !important;
    position: relative;
}

.sponsored-card::after {
    content: '✨ إعلان ممول';
    position: absolute;
    top: 0;
    right: 0;
    background: #C9A54D;
    color: #1C1C1E;
    padding: 0.3rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 0 12px 0 12px;
    z-index: 5;
}

/* ===== FOOTER AD ===== */
.footer-ad {
    background: linear-gradient(135deg, #1C1C1E, #0F4444);
    padding: 2rem;
    margin-bottom: 0;
    border-radius: 24px 24px 0 0;
}

.footer-ad-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    flex-direction: row-reverse;
}

.footer-ad-image {
    width: 320px;
    min-width: 280px;
    height: 180px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    display: block !important;
    overflow: hidden;
    flex-shrink: 0;
}

.footer-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block !important;
    border-radius: 12px;
    opacity: 1 !important;
    visibility: visible !important;
}

.footer-ad-image .ad-placeholder {
    font-size: 3rem;
}

.footer-ad-text {
    text-align: center;
    color: #FFFFFF;
}

.footer-ad-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #E8D5A3;
}

.footer-ad-desc {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.footer-ad-cta {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #C9A54D, #E8D5A3);
    color: #1C1C1E;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-ad-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(201,165,77,0.5);
}

.footer-ad .ad-label {
    position: static;
    display: inline-block;
    margin-bottom: 1rem;
    background: rgba(255,255,255,0.2);
}

/* ===== FLOATING AD ===== */
.floating-ad {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 320px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1000;
    overflow: hidden;
    animation: slideInUp 0.5s ease-out;
    display: none;
}

.floating-ad.show {
    display: block;
}

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

.floating-ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #1A6B6B, #2A8F8F);
    color: #FFFFFF;
}

.floating-ad-header span {
    font-size: 0.8rem;
    font-weight: 600;
}

.floating-ad-close {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.floating-ad-close:hover {
    opacity: 1;
    transform: scale(1.2);
}

.floating-ad-body {
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.floating-ad-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: linear-gradient(135deg, #C9A54D, #E8D5A3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    overflow: hidden;
    flex-shrink: 0;
}

.floating-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floating-ad-content h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.floating-ad-content p {
    font-size: 0.75rem;
    color: #6B7280;
    margin-bottom: 0.5rem;
}

.floating-ad-content a {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #1A6B6B, #2A8F8F);
    color: #FFFFFF;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.floating-ad-content a:hover {
    transform: scale(1.05);
}

body.dark-mode .floating-ad {
    background: #2C2C2E;
}

body.dark-mode .floating-ad-content h4 {
    color: #F5F5F5;
}

/* ===== STICKY AD (For Long Pages) ===== */
.sticky-ad {
    position: sticky;
    top: 100px;
}

/* ===== RESPONSIVE ADS ===== */
@media (max-width: 992px) {
    .sidebar-ad {
        display: none;
    }
    
    .floating-ad {
        width: 280px;
        left: 10px;
        bottom: 10px;
    }
}

@media (max-width: 768px) {
    .header-ad-bar {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .header-ad-content {
        gap: 0.5rem;
        font-size: 0.75rem;
    }

    .ad-banner-content {
        flex-direction: column;
        gap: 1rem;
    }

    .ad-banner-image {
        width: 100%;
        height: 120px;
    }

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

    .footer-ad-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .footer-ad-image {
        width: 100%;
        max-width: 300px;
        height: 120px;
    }

    .floating-ad {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .header-ad-bar {
        padding: 0.4rem 0.75rem;
    }
    
    .header-ad-content span:first-child {
        display: none;
    }
    
    .inline-ad {
        flex-direction: column;
        text-align: center;
    }
    
    .inline-ad-icon {
        margin: 0 auto;
    }
}

/* ===== AD VISIBILITY ANIMATION ===== */
.ad-container.ad-visible,
.inline-ad.ad-visible,
.sidebar-ad.ad-visible {
    animation: adFadeIn 0.5s ease-out;
}

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

/* ===== PRINT STYLES ===== */
@media print {
    .ad-container,
    .header-ad-bar,
    .footer-ad,
    .floating-ad,
    .sidebar-ad,
    .inline-ad {
        display: none !important;
    }
}
