/* Advertisement Container */
.ad-container {
    min-height: 60px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Ad Placeholder */
.ad-placeholder {
    color: #666666;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
}

/* Loading State */
.ad-container.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.ad-container.loading .ad-placeholder {
    color: transparent;
}

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

/* Error State */
.ad-container.error {
    min-height: 0;
    height: 0;
    margin: 0;
    border: none;
    overflow: hidden;
    opacity: 0;
}

.ad-container.error .ad-placeholder {
    display: none;
}

/* Loaded State */
.ad-container.loaded {
    background: transparent;
    border: none;
    padding: 0;
}

.ad-container.loaded .ad-placeholder {
    display: none;
}

/* Google AdSense Styles */
.ad-container .adsbygoogle {
    display: block !important;
    width: 100%;
    text-align: center;
}

/* Amazon Affiliate Styles */
.ad-container iframe[src*="amazon"] {
    border: none;
    width: 100%;
    max-width: 320px;
    height: 50px;
}

/* Generic Ad Styles */
.ad-container .ad-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-container .ad-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ad-container {
        min-height: 50px;
        margin: 16px 0;
    }
    
    .ad-placeholder {
        font-size: 0.8rem;
        padding: 15px;
    }
    
    /* Mobile banner ad size */
    .ad-container.mobile-banner {
        height: 50px;
        min-height: 50px;
    }
}

@media (min-width: 769px) {
    /* Desktop rectangle ad size */
    .ad-container.desktop-rectangle {
        height: 250px;
        min-height: 250px;
        max-width: 300px;
        margin: 20px auto;
    }
}

/* Privacy and Consent Styles */
.ad-consent-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 16px;
    font-size: 0.9rem;
    z-index: 2000;
    backdrop-filter: blur(10px);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.ad-consent-notice.show {
    transform: translateY(0);
}

.ad-consent-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ad-consent-text {
    flex: 1;
    line-height: 1.4;
}

.ad-consent-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ad-consent-btn {
    padding: 8px 16px;
    border: 1px solid #4ecdc4;
    background: transparent;
    color: #4ecdc4;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.ad-consent-btn:hover {
    background: #4ecdc4;
    color: #1a1a1a;
}

.ad-consent-btn.primary {
    background: #4ecdc4;
    color: #1a1a1a;
}

.ad-consent-btn.primary:hover {
    background: #45b7aa;
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
    .ad-container {
        background-color: #2a2a2a;
        border-color: #444444;
    }
    
    .ad-placeholder {
        color: #888888;
    }
    
    .ad-container.loading {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .ad-container {
        border-width: 2px;
        border-color: #000000;
    }
    
    .ad-placeholder {
        color: #000000;
        font-weight: bold;
    }
}

/* Animation for ad transitions */
.ad-fade-in {
    animation: adFadeIn 0.5s ease-in-out;
}

@keyframes adFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ad blocker detection message */
.ad-blocked-message {
    text-align: center;
    padding: 20px;
    color: #888888;
    font-size: 0.8rem;
    font-style: italic;
}

/* GDPR compliance styles */
.gdpr-notice {
    font-size: 0.8rem;
    color: #666666;
    text-align: center;
    margin-top: 8px;
}

.gdpr-notice a {
    color: #4ecdc4;
    text-decoration: none;
}

.gdpr-notice a:hover {
    text-decoration: underline;
}