/* ==============================================
   SYSTÈME D'EMPLACEMENTS PUBLICITAIRES
   Ina1000 - Compatible Google AdSense / Display Ads
   ============================================== */

/* ========== Conteneurs Publicitaires ========== */
.ad-container {
    /* INVISIBLE par défaut - visible seulement avec .ad-active */
    display: none;
    border-radius: 12px;
    padding: 1rem;
    margin: 2rem auto;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Conteneur visible quand une pub est active */
.ad-container.ad-active {
    display: block;
    background: rgba(139, 92, 246, 0.02);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

/* Style debug/preview pour voir les emplacements (dev only) */
.ad-container.ad-preview {
    display: block !important;
    background: rgba(139, 92, 246, 0.05);
    border: 2px dashed rgba(139, 92, 246, 0.3);
}

.ad-container.ad-active:hover {
    background: rgba(139, 92, 246, 0.03);
}

/* Label "Publicité" */
.ad-container::before {
    content: attr(data-ad-label);
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 0.75rem;
    color: rgba(139, 92, 246, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== Formats Publicitaires ========== */

/* Banner Header (728x90) - Desktop */
.ad-header {
    max-width: 728px;
    min-height: 90px;
    margin: 1rem auto 2rem;
    display: none;
}

@media (min-width: 768px) {
    .ad-header {
        display: block;
    }
}

/* Banner Mobile (320x50) */
.ad-mobile-banner {
    max-width: 320px;
    min-height: 50px;
    display: block;
    margin: 1rem auto;
}

@media (min-width: 768px) {
    .ad-mobile-banner {
        display: none;
    }
}

/* Rectangle Medium (300x250) */
.ad-rectangle {
    max-width: 300px;
    min-height: 250px;
    margin: 2rem auto;
}

/* Leaderboard (728x90) */
.ad-leaderboard {
    max-width: 728px;
    min-height: 90px;
    margin: 2rem auto;
    display: none;
}

@media (min-width: 768px) {
    .ad-leaderboard {
        display: block;
    }
}

/* Sidebar Ads (300x600) - Skyscraper */
.ad-sidebar {
    max-width: 300px;
    min-height: 600px;
    position: sticky;
    top: 100px;
    display: none;
}

@media (min-width: 1200px) {
    .ad-sidebar {
        display: block;
    }
}

/* In-Content Native Ad */
.ad-native {
    max-width: 100%;
    min-height: 100px;
    background: rgba(139, 92, 246, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

/* Footer Ad (728x90) */
.ad-footer {
    max-width: 728px;
    min-height: 90px;
    margin: 2rem auto 1rem;
}

/* ========== Dark Mode Styles ========== */
.dark-mode .ad-container {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
}

.dark-mode .ad-container:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.6);
}

.dark-mode .ad-container::before {
    color: rgba(139, 92, 246, 0.8);
}

.dark-mode .ad-native {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 767px) {
    .ad-container {
        margin: 1rem 0;
        max-width: 100%;
    }
    
    .ad-rectangle {
        max-width: 100%;
        min-height: 200px;
    }
}

/* ========== Loading State ========== */
.ad-container.ad-loading {
    background: linear-gradient(
        90deg,
        rgba(139, 92, 246, 0.05) 0%,
        rgba(139, 92, 246, 0.1) 50%,
        rgba(139, 92, 246, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: adShimmer 1.5s ease-in-out infinite;
}

@keyframes adShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ========== Ad Placement Classes ========== */
.ads-wrapper {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.content-with-ads {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1200px) {
    .content-with-ads {
        grid-template-columns: 300px 1fr 300px;
    }
    
    .content-main {
        grid-column: 2;
    }
    
    .ads-left {
        grid-column: 1;
    }
    
    .ads-right {
        grid-column: 3;
    }
}

/* ========== Placeholder Content ========== */
.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: inherit;
    color: rgba(139, 92, 246, 0.5);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========== Integration with Existing Layout ========== */
main .ad-container {
    margin-left: auto;
    margin-right: auto;
}

.hero-section + .ad-container {
    margin-top: -1rem;
}

.features + .ad-container {
    margin-top: 3rem;
    margin-bottom: 3rem;
}