/* AF Link Inserter Frontend Styles - Modern 3D Professional Design */

/* CSS Variables for consistent theming */
:root {
    --af-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --af-secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --af-success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --af-warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --af-dark-gradient: linear-gradient(135deg, #434343 0%, #000000 100%);
    --af-light-gradient: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);

    --af-shadow-light: 0 4px 15px rgba(0, 0, 0, 0.1);
    --af-shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --af-shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.2);
    --af-shadow-3d: 0 20px 40px rgba(0, 0, 0, 0.25);

    --af-border-radius: 12px;
    --af-border-radius-large: 20px;
    --af-transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --af-transition-fast: all 0.2s ease-out;
    --af-transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Base ad container - Modern 3D Banner */
.af-ad {
    display: block;
    margin: 30px auto;
    clear: both;
    position: relative;
    max-width: 100%;
    border-radius: 20px; /* Fallback */
    border-radius: var(--af-border-radius-large);
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Fallback */
    box-shadow: var(--af-shadow-medium);
    transition: all 0.4s ease; /* Fallback */
    transition: var(--af-transition);
    transform: translateY(0);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Fallback */
    background: var(--af-primary-gradient);
    cursor: pointer;
    animation: af-fadeInUp 0.8s ease-out;
    color: white;
    padding: 25px;
    min-height: 120px;
}

.af-ad:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--af-shadow-3d);
}

.af-ad::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    transition: var(--af-transition);
}

.af-ad:hover::before {
    background: linear-gradient(45deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.05) 100%);
}

/* Modern Text Ad Styling */
.af-ad.af-ad-text {
    background: var(--af-primary-gradient);
    padding: 25px 30px;
    border: none;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.af-ad.af-ad-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #fff, rgba(255,255,255,0.5));
    animation: af-shimmer 2s infinite;
}

.af-ad.af-ad-text p {
    margin: 0 0 15px 0;
    font-size: 16px;
    line-height: 1.6;
    animation: af-slideInLeft 0.8s ease-out 0.2s both;
}

.af-ad.af-ad-text p:last-child {
    margin-bottom: 0;
}

.af-ad.af-ad-text .af-affiliate-link {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: var(--af-border-radius);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid rgba(255,255,255,0.3);
    transition: var(--af-transition-bounce);
    margin-top: 15px;
    position: relative;
    overflow: hidden;
    animation: af-slideInRight 0.8s ease-out 0.4s both;
}

.af-ad.af-ad-text .af-affiliate-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: var(--af-transition);
}

.af-ad.af-ad-text .af-affiliate-link:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.af-ad.af-ad-text .af-affiliate-link:hover::before {
    left: 100%;
}

/* Modern Banner Ad Styling - Fully Responsive */
.af-ad.af-ad-banner {
    background: var(--af-secondary-gradient);
    border: none;
    padding: 0;
    text-align: left;
    position: relative;
    width: 100%; /* Responsive width */
    height: 100px; /* Fixed height for desktop */
    max-width: 792px; /* Maximum width for desktop */
    min-width: 280px; /* Minimum usable width */
    max-height: 100px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    margin: 20px auto;
    box-sizing: border-box;
}

/* Banner size variations - all responsive */
.af-ad.af-ad-banner.af-banner-leaderboard {
    width: 100%;
    height: 90px;
    max-width: 728px;
    min-width: 280px;
    max-height: 90px;
    min-height: 90px;
}

.af-ad.af-ad-banner.af-banner-custom {
    width: 100%;
    height: 100px;
    max-width: 792px;
    min-width: 280px;
    max-height: 100px;
    min-height: 100px;
}

.af-ad.af-ad-banner.af-banner-wide {
    width: 100%;
    height: 90px;
    max-width: 970px;
    min-width: 280px;
    max-height: 90px;
    min-height: 90px;
}

.af-ad.af-ad-banner.af-banner-mobile {
    width: 100%;
    height: 50px;
    max-width: 320px;
    min-width: 280px;
    max-height: 50px;
    min-height: 50px;
}

.af-ad.af-ad-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: af-rotate 4s linear infinite;
    pointer-events: none;
}

.af-ad.af-ad-banner .af-banner-content {
    position: relative;
    z-index: 2;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    flex: 1;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
}

.af-ad.af-ad-banner .af-banner-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px 0;
    line-height: 1.1;
    animation: af-pulse 2s ease-in-out infinite alternate;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.af-ad.af-ad-banner .af-banner-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.af-ad.af-ad-banner .af-banner-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    padding: 15px 20px;
    height: 100%;
    box-sizing: border-box;
}

.af-ad.af-ad-banner img {
    max-width: 100%;
    height: auto;
    border-radius: var(--af-border-radius);
    box-shadow: var(--af-shadow-medium);
    transition: var(--af-transition);
    animation: af-zoomIn 0.8s ease-out;
}

.af-ad.af-ad-banner:hover img {
    transform: scale(1.05);
    box-shadow: var(--af-shadow-heavy);
}

.af-ad.af-ad-banner a {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: var(--af-transition);
}

.af-ad.af-ad-banner a:hover {
    transform: scale(1.02);
}

/* Modern Image Ad Styling */
.af-ad.af-ad-image {
    background: var(--af-success-gradient);
    padding: 15px;
    text-align: center;
    position: relative;
}

.af-ad.af-ad-image::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: var(--af-transition);
    pointer-events: none;
}

.af-ad.af-ad-image:hover::after {
    width: 100%;
    height: 100%;
}

.af-ad.af-ad-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--af-border-radius);
    box-shadow: var(--af-shadow-medium);
    transition: var(--af-transition);
    animation: af-bounceIn 1s ease-out;
}

.af-ad.af-ad-image:hover img {
    transform: rotateY(5deg) rotateX(5deg) scale(1.05);
    box-shadow: var(--af-shadow-3d);
}

.af-ad.af-ad-image a {
    display: inline-block;
    text-decoration: none;
}

/* Modern Custom Ad Styling */
.af-ad.af-ad-custom {
    background: var(--af-warning-gradient);
    padding: 25px;
    position: relative;
    color: #333;
    border: none;
}

.af-ad.af-ad-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300% 100%;
    animation: af-gradientMove 3s ease infinite;
}

.af-ad.af-ad-custom .af-custom-content {
    position: relative;
    z-index: 2;
    animation: af-fadeInUp 0.8s ease-out 0.3s both;
    font-size: 16px;
    line-height: 1.6;
}

.af-ad.af-ad-custom .af-custom-content p {
    margin: 0 0 15px 0;
    animation: af-slideInLeft 0.6s ease-out calc(var(--animation-delay, 0) * 0.1s) both;
}

.af-ad.af-ad-custom .af-custom-content p:last-child {
    margin-bottom: 0;
}

/* Advanced Positioning System */
.af-ad-container {
    position: relative;
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: center;
}

/* Text Positioning Classes */
.af-text-left-top { text-align: left; align-self: flex-start; }
.af-text-left-middle { text-align: left; align-self: center; }
.af-text-left-bottom { text-align: left; align-self: flex-end; }
.af-text-center-top { text-align: center; align-self: flex-start; }
.af-text-center-middle { text-align: center; align-self: center; }
.af-text-center-bottom { text-align: center; align-self: flex-end; }
.af-text-right-top { text-align: right; align-self: flex-start; }
.af-text-right-middle { text-align: right; align-self: center; }
.af-text-right-bottom { text-align: right; align-self: flex-end; }

/* Button Positioning Classes */
.af-btn-position {
    position: absolute;
    z-index: 5;
}

.af-btn-left-top { top: 15px; left: 15px; }
.af-btn-left-middle { top: 50%; left: 15px; transform: translateY(-50%); }
.af-btn-left-bottom { bottom: 15px; left: 15px; }
.af-btn-center-top { top: 15px; left: 50%; transform: translateX(-50%); }
.af-btn-center-middle { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.af-btn-center-bottom { bottom: 15px; left: 50%; transform: translateX(-50%); }
.af-btn-right-top { top: 15px; right: 15px; }
.af-btn-right-middle { top: 50%; right: 15px; transform: translateY(-50%); }
.af-btn-right-bottom { bottom: 15px; right: 15px; }

/* 3D Text Effects */
.af-text-3d {
    text-shadow:
        0 1px 0 #ccc,
        0 2px 0 #c9c9c9,
        0 3px 0 #bbb,
        0 4px 0 #b9b9b9,
        0 5px 0 #aaa,
        0 6px 1px rgba(0,0,0,.1),
        0 0 5px rgba(0,0,0,.1),
        0 1px 3px rgba(0,0,0,.3),
        0 3px 5px rgba(0,0,0,.2),
        0 5px 10px rgba(0,0,0,.25);
    color: #fff;
    font-weight: 700;
}

.af-text-3d-dark {
    text-shadow:
        0 1px 0 #000,
        0 2px 0 #333,
        0 3px 0 #555,
        0 4px 0 #777,
        0 5px 0 #999,
        0 6px 1px rgba(255,255,255,.1),
        0 0 5px rgba(255,255,255,.1),
        0 1px 3px rgba(255,255,255,.3),
        0 3px 5px rgba(255,255,255,.2),
        0 5px 10px rgba(255,255,255,.25);
    color: #333;
    font-weight: 700;
}

/* Modern Button Styles */
.af-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--af-primary-gradient);
    color: white;
    text-decoration: none;
    border-radius: var(--af-border-radius);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: var(--af-transition-bounce);
    position: relative;
    overflow: hidden;
    box-shadow: var(--af-shadow-light);
    animation: af-slideInRight 0.8s ease-out 0.6s both;
}

/* Banner-specific button styling */
.af-ad.af-ad-banner .af-btn {
    padding: 10px 18px;
    font-size: 13px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    min-width: 90px;
    max-width: 120px;
    text-align: center;
    animation: none; /* Remove slide animation for banners */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Banner button positioning system */
.af-ad.af-ad-banner .af-btn-position {
    position: absolute;
    z-index: 5;
}

/* 9-Grid positioning for banner buttons */
.af-ad.af-ad-banner .af-btn-left-top {
    top: 15px;
    left: 15px;
}

.af-ad.af-ad-banner .af-btn-left-middle {
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
}

.af-ad.af-ad-banner .af-btn-left-bottom {
    bottom: 15px;
    left: 15px;
}

.af-ad.af-ad-banner .af-btn-center-top {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
}

.af-ad.af-ad-banner .af-btn-center-middle {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.af-ad.af-ad-banner .af-btn-center-bottom {
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
}

.af-ad.af-ad-banner .af-btn-right-top {
    top: 15px;
    right: 15px;
}

.af-ad.af-ad-banner .af-btn-right-middle {
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
}

.af-ad.af-ad-banner .af-btn-right-bottom {
    bottom: 15px;
    right: 15px;
}

.af-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: var(--af-transition);
}

.af-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--af-shadow-heavy);
    color: white;
}

.af-btn:hover::before {
    left: 100%;
}

.af-btn-secondary {
    background: var(--af-secondary-gradient);
}

.af-btn-success {
    background: var(--af-success-gradient);
}

.af-btn-warning {
    background: var(--af-warning-gradient);
    color: #333;
}

/* Button Style Variations */
.af-btn-flat {
    background: #007cba;
    border-radius: 4px;
    box-shadow: none;
    transition: background 0.3s ease;
}

.af-btn-flat:hover {
    background: #005a87;
    transform: none;
    box-shadow: none;
}

.af-btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
    box-shadow: none;
}

.af-btn-outline:hover {
    background: white;
    color: #333;
    transform: translateY(-2px);
}

.af-btn-minimal {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    box-shadow: none;
}

.af-btn-minimal:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

/* Offer/Percentage Display */
.af-offer-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4757;
    color: white;
    padding: 8px 12px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--af-shadow-medium);
    animation: af-pulse 2s ease-in-out infinite alternate;
    z-index: 10;
}

.af-offer-badge::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.3;
    animation: af-pulse 2s ease-in-out infinite alternate;
}

/* Global responsive container */
.af-ad-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Force all banner ads to be responsive by default */
@media screen and (max-width: 800px) {
    .af-ad.af-ad-banner,
    .af-ad.af-ad-banner.af-banner-custom,
    .af-ad.af-ad-banner.af-banner-leaderboard,
    .af-ad.af-ad-banner.af-banner-wide,
    .af-ad.af-ad-banner.af-banner-mobile {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        height: auto !important;
        min-height: 120px !important;
        max-height: none !important;
        flex-direction: column !important;
        padding: 15px !important;
        margin: 15px auto !important;
        box-sizing: border-box !important;
    }

    .af-ad.af-ad-banner .af-banner-content {
        padding: 10px 0 !important;
        text-align: center !important;
        flex: none !important;
        width: 100% !important;
    }

    .af-ad.af-ad-banner .af-banner-buttons {
        padding: 10px 0 !important;
        justify-content: center !important;
        height: auto !important;
        flex: none !important;
        width: 100% !important;
    }

    .af-ad.af-ad-banner .af-banner-title {
        font-size: 18px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .af-ad.af-ad-banner .af-banner-subtitle {
        font-size: 12px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .af-ad.af-ad-banner .af-btn {
        margin: 5px !important;
        min-width: 120px !important;
        max-width: 150px !important;
    }
}

/* Extra small screens - ensure banner never overflows */
@media screen and (max-width: 480px) {
    .af-ad.af-ad-banner {
        width: calc(100vw - 30px) !important;
        max-width: calc(100vw - 30px) !important;
        margin: 15px auto !important;
        padding: 10px !important;
        min-height: 100px !important;
    }

    .af-ad.af-ad-banner .af-banner-title {
        font-size: 16px !important;
    }

    .af-ad.af-ad-banner .af-banner-subtitle {
        font-size: 11px !important;
    }

    .af-ad.af-ad-banner .af-btn {
        min-width: 100px !important;
        max-width: 120px !important;
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
}

/* Enhanced Responsive Design */
@media screen and (max-width: 768px) {
    .af-ad {
        margin: 20px 10px;
        border-radius: 15px;
        padding: 20px;
        min-height: 120px;
    }

    .af-ad.af-ad-text {
        padding: 18px;
        font-size: 14px;
        min-height: 100px;
    }

    .af-ad.af-ad-text .af-affiliate-link,
    .af-btn {
        padding: 10px 18px;
        font-size: 12px;
        letter-spacing: 0.5px;
        border-radius: 8px;
    }

    /* Banner responsive behavior - force mobile layout */
    .af-ad.af-ad-banner,
    .af-ad.af-ad-banner.af-banner-custom,
    .af-ad.af-ad-banner.af-banner-leaderboard,
    .af-ad.af-ad-banner.af-banner-wide,
    .af-ad.af-ad-banner.af-banner-mobile {
        width: 100% !important;
        max-width: calc(100vw - 20px) !important;
        min-width: auto !important;
        height: auto !important;
        min-height: 120px !important;
        max-height: none !important;
        flex-direction: column !important;
        padding: 15px !important;
        margin: 15px 10px !important;
        box-sizing: border-box !important;
    }

    .af-ad.af-ad-banner .af-banner-content {
        padding: 10px 0 !important;
        text-align: center !important;
        flex: none !important;
        width: 100% !important;
    }

    .af-ad.af-ad-banner .af-banner-buttons {
        padding: 10px 0 !important;
        justify-content: center !important;
        height: auto !important;
        flex: none !important;
        width: 100% !important;
    }

    .af-ad.af-ad-banner .af-banner-title {
        font-size: 18px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .af-ad.af-ad-banner .af-banner-subtitle {
        font-size: 12px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .af-ad.af-ad-banner .af-btn {
        margin: 5px !important;
        min-width: 120px !important;
        max-width: 150px !important;
    }

    .af-offer-badge {
        top: -8px;
        right: -8px;
        padding: 6px 10px;
        font-size: 10px;
    }

    /* Responsive button positioning */
    .af-btn-position {
        position: relative !important;
        display: inline-block;
        margin: 10px 5px 0 0;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }

    /* Stack buttons vertically on mobile */
    .af-ad-container {
        flex-direction: column;
        text-align: center;
    }
}

/* Tablet responsive behavior */
@media screen and (max-width: 1024px) and (min-width: 481px) {
    .af-ad.af-ad-banner,
    .af-ad.af-ad-banner.af-banner-custom,
    .af-ad.af-ad-banner.af-banner-leaderboard,
    .af-ad.af-ad-banner.af-banner-wide {
        width: 100% !important;
        max-width: calc(100vw - 40px) !important;
        min-width: auto !important;
        margin: 20px auto !important;
        box-sizing: border-box !important;
    }
}

@media screen and (max-width: 480px) {
    .af-ad {
        margin: 15px 5px;
        border-radius: 12px;
        padding: 15px;
        min-height: 100px;
    }

    .af-ad.af-ad-text {
        padding: 15px;
        font-size: 13px;
        min-height: 80px;
    }

    .af-ad.af-ad-text .af-affiliate-link,
    .af-btn {
        display: block;
        text-align: center;
        margin: 8px auto 0;
        padding: 10px 16px;
        font-size: 11px;
        width: auto;
        max-width: 200px;
    }

    .af-ad.af-ad-banner,
    .af-ad.af-ad-banner.af-banner-custom,
    .af-ad.af-ad-banner.af-banner-leaderboard,
    .af-ad.af-ad-banner.af-banner-wide {
        width: 100% !important;
        max-width: calc(100vw - 10px) !important;
        min-width: auto !important;
        height: auto !important;
        min-height: 100px !important;
        max-height: none !important;
        flex-direction: column !important;
        padding: 12px !important;
        margin: 10px 5px !important;
    }

    .af-ad.af-ad-banner .af-banner-content {
        padding: 8px 0 !important;
        text-align: center !important;
    }

    .af-ad.af-ad-banner .af-banner-buttons {
        padding: 8px 0 !important;
        justify-content: center !important;
        height: auto !important;
        gap: 8px !important;
    }

    .af-ad.af-ad-banner .af-banner-title {
        font-size: 16px !important;
        white-space: normal !important;
        margin-bottom: 4px !important;
    }

    .af-ad.af-ad-banner .af-banner-subtitle {
        font-size: 11px !important;
        white-space: normal !important;
    }

    .af-ad.af-ad-banner .af-btn {
        padding: 8px 12px !important;
        font-size: 11px !important;
        min-width: 100px !important;
        max-width: 130px !important;
        margin: 2px !important;
    }

    .af-offer-badge {
        top: -6px;
        right: -6px;
        padding: 4px 8px;
        font-size: 9px;
    }

    /* Mobile-specific button layout */
    .af-btn-position {
        position: static !important;
        display: block !important;
        margin: 8px auto !important;
        transform: none !important;
        width: fit-content;
    }

    /* Ensure text is readable on mobile */
    .af-text-3d {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Adjust container for mobile */
    .af-ad-container {
        min-height: auto;
        padding: 10px 0;
    }
}

/* Print styles */
@media print {
    .af-ad {
        display: none !important;
    }
}

/* Accessibility improvements */
.af-ad a:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.af-ad .af-affiliate-link:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Loading states */
.af-ad.af-loading {
    opacity: 0.6;
    pointer-events: none;
}

.af-ad.af-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: af-frontend-spin 1s linear infinite;
    z-index: 10;
}

@keyframes af-frontend-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modern Ad Disclosure */
.af-ad .af-ad-label {
    content: 'Advertisement';
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    animation: af-fadeIn 1s ease-out 0.5s both;
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 9px;
}

/* Theme compatibility */
.entry-content .af-ad,
.post-content .af-ad,
.content .af-ad {
    /* Ensure ads work well within content areas */
    box-sizing: border-box;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .af-ad.af-ad-text {
        background: #2a2a2a;
        color: #e0e0e0;
        border-left-color: #4a9eff;
    }
    
    .af-ad.af-ad-text .af-affiliate-link {
        background: #4a9eff;
        color: #000;
    }
    
    .af-ad.af-ad-text .af-affiliate-link:hover {
        background: #357abd;
        color: #fff;
    }
    
    .af-ad::before {
        color: #999;
    }
}

/* Modern CSS Animations and Keyframes */
@keyframes af-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes af-slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes af-slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes af-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes af-pulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.02);
    }
}

@keyframes af-shimmer {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes af-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes af-zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes af-bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes af-gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Additional Animation Keyframes for All Animation Types */
@keyframes af-fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes af-fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes af-fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes af-slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes af-zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes af-bounceInDown {
    0% {
        opacity: 0;
        transform: translateY(-100px);
    }
    60% {
        opacity: 1;
        transform: translateY(25px);
    }
    75% {
        transform: translateY(-10px);
    }
    90% {
        transform: translateY(5px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes af-bounceInUp {
    0% {
        opacity: 0;
        transform: translateY(100px);
    }
    60% {
        opacity: 1;
        transform: translateY(-25px);
    }
    75% {
        transform: translateY(10px);
    }
    90% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes af-bounceInLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    60% {
        opacity: 1;
        transform: translateX(25px);
    }
    75% {
        transform: translateX(-10px);
    }
    90% {
        transform: translateX(5px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes af-bounceInRight {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    60% {
        opacity: 1;
        transform: translateX(-25px);
    }
    75% {
        transform: translateX(10px);
    }
    90% {
        transform: translateX(-5px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes af-rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

@keyframes af-flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    40% {
        transform: perspective(400px) rotateX(-20deg);
    }
    60% {
        transform: perspective(400px) rotateX(10deg);
    }
    80% {
        transform: perspective(400px) rotateX(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

@keyframes af-flipInY {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

/* Hover Animation Keyframes */
@keyframes af-scale {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

@keyframes af-scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

@keyframes af-scaleDown {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(0.95);
    }
}

@keyframes af-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes af-wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25px) rotate(-5deg);
    }
    30% {
        transform: translateX(20px) rotate(3deg);
    }
    45% {
        transform: translateX(-15px) rotate(-3deg);
    }
    60% {
        transform: translateX(10px) rotate(2deg);
    }
    75% {
        transform: translateX(-5px) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

@keyframes af-swing {
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes af-tada {
    0% {
        transform: scale(1);
    }
    10%, 20% {
        transform: scale(0.9) rotate(-3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale(1.1) rotate(3deg);
    }
    40%, 60%, 80% {
        transform: scale(1.1) rotate(-3deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

/* Dynamic Font Size Support - Override hardcoded font sizes */
.af-ad[data-font-size] {
    font-size: var(--af-dynamic-font-size) !important;
}

.af-ad[data-font-size] * {
    font-size: inherit !important;
}

.af-ad[data-font-size] .af-banner-title {
    font-size: 1.4em !important;
}

.af-ad[data-font-size] .af-banner-subtitle {
    font-size: 0.9em !important;
}

.af-ad[data-font-size] .af-btn {
    font-size: 0.85em !important;
}

.af-ad[data-font-size] .af-ad-label {
    font-size: 0.7em !important;
}

/* Force font size inheritance for all text elements */
.af-ad[style*="font-size"] {
    font-size: inherit !important;
}

.af-ad[style*="font-size"] * {
    font-size: inherit !important;
}

.af-ad[style*="font-size"] p {
    font-size: inherit !important;
}

.af-ad[style*="font-size"] div {
    font-size: inherit !important;
}

.af-ad[style*="font-size"] span {
    font-size: inherit !important;
}

/* Animation classes for dynamic animations */
.af-ad[data-animation="fadeIn"] {
    animation: af-fadeIn 1s ease-in-out !important;
}

.af-ad[data-animation="fadeInUp"] {
    animation: af-fadeInUp 1s ease-in-out !important;
}

.af-ad[data-animation="fadeInDown"] {
    animation: af-fadeInDown 1s ease-in-out !important;
}

.af-ad[data-animation="fadeInLeft"] {
    animation: af-fadeInLeft 1s ease-in-out !important;
}

.af-ad[data-animation="fadeInRight"] {
    animation: af-fadeInRight 1s ease-in-out !important;
}

.af-ad[data-animation="slideInUp"] {
    animation: af-slideInUp 1s ease-in-out !important;
}

.af-ad[data-animation="slideInDown"] {
    animation: af-slideInDown 1s ease-in-out !important;
}

.af-ad[data-animation="slideInLeft"] {
    animation: af-slideInLeft 1s ease-in-out !important;
}

.af-ad[data-animation="slideInRight"] {
    animation: af-slideInRight 1s ease-in-out !important;
}

.af-ad[data-animation="bounceIn"] {
    animation: af-bounceIn 1s ease-in-out !important;
}

.af-ad[data-animation="bounceInUp"] {
    animation: af-bounceInUp 1s ease-in-out !important;
}

.af-ad[data-animation="bounceInDown"] {
    animation: af-bounceInDown 1s ease-in-out !important;
}

.af-ad[data-animation="bounceInLeft"] {
    animation: af-bounceInLeft 1s ease-in-out !important;
}

.af-ad[data-animation="bounceInRight"] {
    animation: af-bounceInRight 1s ease-in-out !important;
}

.af-ad[data-animation="zoomIn"] {
    animation: af-zoomIn 1s ease-in-out !important;
}

.af-ad[data-animation="rotateIn"] {
    animation: af-rotateIn 1s ease-in-out !important;
}

.af-ad[data-animation="flipInX"] {
    animation: af-flipInX 1s ease-in-out !important;
}

.af-ad[data-animation="flipInY"] {
    animation: af-flipInY 1s ease-in-out !important;
}

/* Hover animation classes */
.af-ad[data-hover="scale"]:hover {
    animation: af-scale 0.3s ease forwards !important;
}

.af-ad[data-hover="scaleUp"]:hover {
    animation: af-scaleUp 0.3s ease forwards !important;
}

.af-ad[data-hover="shake"]:hover {
    animation: af-shake 0.6s ease forwards !important;
}

.af-ad[data-hover="wobble"]:hover {
    animation: af-wobble 1s ease forwards !important;
}

.af-ad[data-hover="swing"]:hover {
    animation: af-swing 1s ease forwards !important;
}

.af-ad[data-hover="tada"]:hover {
    animation: af-tada 1s ease forwards !important;
}

/* Hover effects for interactive ads */
.af-ad a {
    transition: all 0.3s ease;
}

.af-ad.af-ad-text:hover {
    border-left-color: #005a87;
    background: #f0f0f0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .af-ad.af-ad-text {
        border-left-width: 6px;
        border-left-color: #000;
    }
    
    .af-ad.af-ad-text .af-affiliate-link {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .af-ad,
    .af-ad *,
    .af-ad::before,
    .af-ad::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
