/* ==========================================================================
   PDFToolKit - AdSense Container Styles
   Styles for Google AdSense ad placements
   Version: 1.0.0
   ========================================================================== */

/* ==========================================================================
   1. Base Ad Slot Styles
   ========================================================================== */

.ad-slot {
    text-align: center;
    margin: 20px auto;
    overflow: hidden;
    clear: both;
    line-height: 0;
}

/* Ad label above the ad unit */
.ad-slot__label {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    line-height: 1;
    text-align: center;
}

/* Hide entire ad slot when it has no ad content */
.ad-slot:empty {
    display: none;
    margin: 0;
    padding: 0;
}

/* Hide empty ins elements (AdSense containers) */
.ad-slot ins:empty {
    display: none;
}

/* ==========================================================================
   2. Header Ad (.ad-slot--header)
   ========================================================================== */

.ad-slot--header {
    max-width: 728px;
    margin: 10px auto;
    padding: 10px 0;
}

/* ==========================================================================
   3. Sidebar Ad (.ad-slot--sidebar)
   ========================================================================== */

.ad-slot--sidebar {
    margin-bottom: 20px;
}

.ad-slot--sidebar ins {
    display: block;
}

/* Sticky sidebar ad */
.ad-slot--sidebar-sticky {
    position: sticky;
    top: 80px;
    margin-bottom: 20px;
}

/* ==========================================================================
   4. In-Content Ad (.ad-slot--in-content)
   ========================================================================== */

.ad-slot--in-content {
    margin: 30px auto;
    padding: 20px 0;
    border-top: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
}

/* ==========================================================================
   5. After Tool Ad (.ad-slot--after-tool)
   ========================================================================== */

.ad-slot--after-tool {
    margin: 30px auto;
    max-width: 600px;
    padding: 20px 0;
}

/* ==========================================================================
   6. Footer Ad (.ad-slot--footer)
   ========================================================================== */

.ad-slot--footer {
    padding: 20px 0;
    max-width: 728px;
    margin: 0 auto;
}

/* ==========================================================================
   7. In-Feed Ad (.ad-slot--in-feed)
   ========================================================================== */

.ad-slot--in-feed {
    grid-column: span 2;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FAFAFA;
    border-radius: 16px;
    border: 1px dashed #E5E7EB;
    min-height: 120px;
}

/* ==========================================================================
   8. Between Sections Ad (.ad-slot--between-sections)
   ========================================================================== */

.ad-slot--between-sections {
    margin: 40px auto;
    padding: 20px 0;
    max-width: 728px;
}

/* ==========================================================================
   9. Before FAQ Ad (.ad-slot--before-faq)
   ========================================================================== */

.ad-slot--before-faq {
    margin: 30px auto 0;
    padding: 20px 0;
    max-width: 728px;
}

/* ==========================================================================
   10. After Download Ad (.ad-slot--after-download)
   ========================================================================== */

.ad-slot--after-download {
    margin: 30px auto;
    max-width: 500px;
    padding: 16px 0;
    border-top: 1px solid #E5E7EB;
}

/* ==========================================================================
   11. Blog In-Article Ad (.ad-slot--in-article)
   ========================================================================== */

.ad-slot--in-article {
    margin: 24px -20px;
    padding: 20px;
    background: #F9FAFB;
    text-align: center;
}

/* ==========================================================================
   12. Mobile Anchor Ad (.ad-slot--mobile-anchor)
   ========================================================================== */

.ad-slot--mobile-anchor {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 5px;
    text-align: center;
}

.ad-slot--mobile-anchor .ad-slot__close {
    position: absolute;
    top: -28px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border: none;
    line-height: 1;
    z-index: 1;
    transition: background 0.2s ease;
}

.ad-slot--mobile-anchor .ad-slot__close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Add bottom padding to body when anchor ad is visible */
body.has-anchor-ad {
    padding-bottom: 60px;
}

/* ==========================================================================
   13. Interstitial / Overlay Ad Placeholder
   ========================================================================== */

.ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ad-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ad-overlay__content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.ad-overlay__close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2D3748;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease;
    z-index: 1;
}

.ad-overlay__close:hover {
    background: #1A202C;
}

.ad-overlay__timer {
    text-align: center;
    font-size: 0.75rem;
    color: #9CA3AF;
    margin-top: 8px;
}

/* ==========================================================================
   14. Responsive Ad Sizes
   ========================================================================== */

/* Mobile (default) */
@media (max-width: 639px) {
    .ad-slot--header {
        max-width: 320px;
        padding: 8px 0;
    }

    .ad-slot--in-feed {
        grid-column: span 1;
        padding: 16px;
        min-height: 100px;
    }

    .ad-slot--footer {
        max-width: 320px;
    }

    .ad-slot--in-content {
        margin: 20px auto;
        padding: 16px 0;
    }

    .ad-slot--between-sections {
        margin: 24px auto;
        padding: 16px 0;
    }

    .ad-slot--in-article {
        margin: 20px -16px;
        padding: 16px;
    }

    /* Show mobile anchor */
    .ad-slot--mobile-anchor {
        display: block;
    }
}

/* Tablet (640px+) */
@media (min-width: 640px) {
    .ad-slot--header {
        max-width: 468px;
    }

    .ad-slot--footer {
        max-width: 468px;
    }

    /* Hide mobile anchor on tablet+ */
    .ad-slot--mobile-anchor {
        display: none;
    }

    body.has-anchor-ad {
        padding-bottom: 0;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .ad-slot--header {
        max-width: 728px;
    }

    .ad-slot--footer {
        max-width: 728px;
    }

    .ad-slot--in-feed {
        grid-column: span 2;
    }

    .ad-slot--in-article {
        margin: 24px 0;
        border-radius: 8px;
    }
}

/* Large (1280px+) */
@media (min-width: 1280px) {
    .ad-slot--header {
        max-width: 970px;
    }

    .ad-slot--in-feed {
        grid-column: span 2;
    }
}

/* ==========================================================================
   15. Ad Placeholder / Loading State
   ========================================================================== */

.ad-slot--loading {
    position: relative;
    min-height: 90px;
    background: #F9FAFB;
    border-radius: 8px;
}

.ad-slot--loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: adShimmer 1.5s infinite;
}

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

/* ==========================================================================
   16. Ad Blocker Detected Message
   ========================================================================== */

.ad-blocker-notice {
    max-width: 600px;
    margin: 20px auto;
    padding: 16px 20px;
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.ad-blocker-notice.visible {
    display: block;
}

.ad-blocker-notice__icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.ad-blocker-notice__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #92400E;
    margin-bottom: 4px;
}

.ad-blocker-notice__text {
    font-size: 0.8125rem;
    color: #A16207;
    line-height: 1.5;
    margin-bottom: 0;
}

/* ==========================================================================
   17. GDPR / Consent Placeholder
   ========================================================================== */

.ad-consent-placeholder {
    max-width: 600px;
    margin: 20px auto;
    padding: 24px 20px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    text-align: center;
}

.ad-consent-placeholder__text {
    font-size: 0.8125rem;
    color: #6B7280;
    margin-bottom: 12px;
    line-height: 1.5;
}

.ad-consent-placeholder__btn {
    display: inline-block;
    padding: 8px 20px;
    background: #2D3748;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ad-consent-placeholder__btn:hover {
    background: #1A202C;
}

/* ==========================================================================
   18. Print & Accessibility
   ========================================================================== */

/* Hide all ads when printing */
@media print {
    .ad-slot,
    .ad-overlay,
    .ad-blocker-notice,
    .ad-consent-placeholder {
        display: none !important;
    }

    body.has-anchor-ad {
        padding-bottom: 0 !important;
    }
}

/* Ensure ads don't interfere with reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .ad-slot--loading::after {
        animation: none;
    }

    .ad-overlay {
        transition: none;
    }
}

/* ==========================================================================
   End of ads.css
   ========================================================================== */
