/* ==========================================================================
   CarePDF - Ad Slots Styles
   Styles for advertisement placements across tool pages
   ========================================================================== */

/* ==========================================================================
   1. Base Ad Container
   ========================================================================== */

.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: var(--spacing-xl) 0;
}

.ad-slot {
    background: var(--gray-50);
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--gray-400);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    overflow: hidden;
    position: relative;
}

/* Ad Placeholder Text (Development) */
.ad-placeholder {
    padding: var(--spacing-md);
}

/* ==========================================================================
   2. Ad Size Variants
   ========================================================================== */

/* Leaderboard (728x90) */
.ad-leaderboard {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
}

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

/* Large Rectangle (336x280) */
.ad-rectangle-lg {
    width: 336px;
    min-height: 280px;
}

/* Wide Skyscraper (160x600) */
.ad-skyscraper {
    width: 160px;
    min-height: 600px;
}

/* Half Page (300x600) */
.ad-half-page {
    width: 300px;
    min-height: 600px;
}

/* Billboard (970x250) */
.ad-billboard {
    width: 100%;
    max-width: 970px;
    min-height: 250px;
}

/* Mobile Banner (320x50) */
.ad-mobile-banner {
    width: 320px;
    min-height: 50px;
}

/* Large Mobile Banner (320x100) */
.ad-mobile-banner-lg {
    width: 320px;
    min-height: 100px;
}

/* ==========================================================================
   3. Ad Positions on Tool Pages
   ========================================================================== */

/* Top Ad (Below Header) */
.ad-top {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* Bottom Ad (Before Footer) */
.ad-bottom {
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-lg);
}

/* Sidebar Ad */
.ad-sidebar {
    width: 100%;
    max-width: 300px;
    min-height: 250px;
    margin-bottom: var(--spacing-lg);
}

/* In-Content Ad */
.ad-in-content {
    margin: var(--spacing-xl) auto;
}

/* ==========================================================================
   4. Sidebar Ad Widget
   ========================================================================== */

.ad-widget {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--spacing-md);
    text-align: center;
}

.ad-widget-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ad-widget-content {
    min-height: 250px;
    background: var(--gray-50);
    border: 1px dashed var(--gray-200);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: var(--text-sm);
}

/* ==========================================================================
   5. Sticky Sidebar Ad
   ========================================================================== */

.ad-sticky {
    position: sticky;
    top: 88px;
    /* Navbar height + spacing */
}

/* ==========================================================================
   6. Between Files Ad (Merge Tool)
   ========================================================================== */

.ad-between-files {
    grid-column: 1 / -1;
    padding: var(--spacing-lg);
    background: var(--gray-50);
    border: 1px dashed var(--gray-200);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--gray-400);
    font-size: var(--text-xs);
}

/* ==========================================================================
   7. Success Page Ads
   ========================================================================== */

.ad-slot-top {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    margin-bottom: var(--spacing-xl);
}

.ad-slot-bottom {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    margin-top: var(--spacing-2xl);
}

.sidebar-ad {
    width: 100%;
    max-width: 300px;
    min-height: 250px;
}

/* ==========================================================================
   8. Native Ad Card Style
   ========================================================================== */

.ad-native-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
    text-decoration: none;
    transition: all var(--transition-base);
}

.ad-native-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.ad-native-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background: var(--gray-100);
    flex-shrink: 0;
    overflow: hidden;
}

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

.ad-native-content {
    flex: 1;
    min-width: 0;
}

.ad-native-label {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
}

.ad-native-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: 4px;
    line-height: var(--leading-snug);
}

.ad-native-description {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin: 0;
}

/* ==========================================================================
   9. Ad Label Badge
   ========================================================================== */

.ad-badge {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    padding: 2px 6px;
    font-size: 9px;
    font-weight: var(--font-bold);
    color: var(--gray-400);
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   10. Responsive Ad Adjustments
   ========================================================================== */

@media (max-width: 991px) {
    .ad-sidebar {
        display: none;
    }

    .ad-billboard {
        max-width: 728px;
        min-height: 90px;
    }
}

@media (max-width: 767px) {
    .ad-leaderboard {
        max-width: 100%;
        min-height: 50px;
    }

    .ad-billboard {
        max-width: 100%;
        min-height: 100px;
    }

    .ad-rectangle,
    .ad-rectangle-lg {
        width: 100%;
        max-width: 300px;
    }

    .ad-slot-top,
    .ad-slot-bottom {
        max-width: 100%;
        min-height: 50px;
    }

    .ad-native-card {
        flex-direction: column;
    }

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

@media (max-width: 480px) {
    .ad-container {
        margin: var(--spacing-md) 0;
    }

    .ad-mobile-banner,
    .ad-mobile-banner-lg {
        width: 100%;
        max-width: 320px;
    }
}

/* ==========================================================================
   11. Ad Loading States
   ========================================================================== */

.ad-loading {
    background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-50) 50%, var(--gray-100) 100%);
    background-size: 200% 100%;
    animation: adShimmer 1.5s infinite;
}

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

    100% {
        background-position: 200% 0;
    }
}

/* ==========================================================================
   12. Ad Close/Hide Button (if applicable)
   ========================================================================== */

.ad-close-btn {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.ad-slot:hover .ad-close-btn {
    opacity: 1;
}

.ad-close-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}