/* 
 * Reusable Ads Configuration for All Image Tools
 * Copy this file to any tool's CSS folder and import it
 * Usage: @import url('ads-config.css');
 */

:root {
    --ad-primary-color: #7953db;
    --ad-border-radius: 12px;
    --ad-shadow-light: 0 2px 8px rgba(0, 0, 0, 0.04);
    --ad-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
    --ad-transition: all 0.3s ease;
    --ad-label-bg: rgba(121, 83, 219, 0.1);
}

/* Universal Ad Container Base */
.ad-base {
    position: relative;
    border-radius: var(--ad-border-radius);
    transition: var(--ad-transition);
    overflow: hidden;
    background: linear-gradient(135deg, var(--background-color) 0%, rgba(121, 83, 219, 0.02) 100%);
    border: 1px solid var(--card-border);
    box-shadow: var(--ad-shadow-light);
}

.ad-base:hover {
    box-shadow: var(--ad-shadow-hover);
    transform: translateY(-1px);
    border-color: rgba(121, 83, 219, 0.3);
}

/* Banner Ad Template */
.ad-banner-template {
    @extend .ad-base;
    min-height: 90px;
    margin: 0 auto 25px;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Sidebar Ad Template */
.ad-sidebar-template {
    @extend .ad-base;
    width: 300px;
    min-height: 600px;
    padding: 15px;
    position: sticky;
    top: 100px;
    margin-bottom: 20px;
    max-height: calc(100vh - 120px);
}

/* Ad Label Template */
.ad-label-template::before {
    content: "Advertisement";
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: var(--submenu-text);
    opacity: 0.7;
    padding: 3px 8px;
    background-color: var(--ad-label-bg);
    border-radius: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.ad-label-template:hover::before {
    opacity: 0.9;
}

/* Responsive Breakpoints */
@media (min-width: 1200px) {
    .ad-sidebar-show-both .ad-sidebar-template {
        display: block;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .ad-sidebar-show-left .ad-sidebar-template.ad-sidebar-left {
        display: block;
        width: 250px;
    }
    .ad-sidebar-show-left .ad-sidebar-template.ad-sidebar-right {
        display: none;
    }
}

@media (max-width: 991px) {
    .ad-sidebar-template {
        display: none !important;
    }
}

/* Performance Optimizations */
.ad-performance-optimized {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Loading States */
.ad-loading-state {
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: adLoadingAnimation 1.5s infinite;
}

@keyframes adLoadingAnimation {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .ad-base, .ad-banner-template, .ad-sidebar-template {
        transition: none;
        animation: none;
    }
    
    .ad-base:hover, .ad-banner-template:hover, .ad-sidebar-template:hover {
        transform: none;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .ad-base {
    background: linear-gradient(135deg, var(--background-color) 0%, rgba(121, 83, 219, 0.05) 100%);
    border-color: var(--card-border);
}

[data-theme="dark"] .ad-label-template::before {
    background-color: rgba(121, 83, 219, 0.2);
    color: rgba(255, 255, 255, 0.8);
}