/* Ad Banner Styles */

/* Top Banner Ad */
.ad-banner.ad-top {
    width: 80%;
    height: 80px;
    margin: 20px auto;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Fixed Bottom Ad */
.ad-banner.ad-bottom-fixed {
    width: 80%;
    height: 80px;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    overflow: hidden;
}

/* Random Position Ad */
.ad-banner.ad-random {
    width: 80%;
    height: 80px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin: 20px auto;
}

/* Ad Placeholder */
.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(-45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f8f9fa 75%), 
                linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    padding: 10px;
}

/* Ad Close Button */
.ad-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.ad-close:hover {
    background: rgba(0,0,0,0.7);
}

/* Ad Loading Animation */
.ad-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1e3c72;
    border-radius: 50%;
    animation: adSpin 1s linear infinite;
}

@keyframes adSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ad Error State */
.ad-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Ad Success State */
.ad-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Responsive Ad Design */
@media (max-width: 768px) {
    .ad-banner.ad-top,
    .ad-banner.ad-bottom-fixed,
    .ad-banner.ad-random {
        width: 95%;
        height: 60px;
    }
    
    .ad-placeholder {
        font-size: 0.8rem;
        padding: 5px;
    }
}

@media (max-width: 480px) {
    .ad-banner.ad-top,
    .ad-banner.ad-bottom-fixed,
    .ad-banner.ad-random {
        width: 98%;
        height: 50px;
    }
    
    .ad-placeholder {
        font-size: 0.7rem;
    }
}

/* Ad Visibility Control */
.ad-hidden {
    display: none;
}

.ad-visible {
    display: flex;
}

/* Ad Position Classes for Random Placement */
.ad-random-middle {
    margin: 40px auto;
}

.ad-random-bottom {
    margin: 20px auto 40px auto;
}

/* Ad Content Styles */
.ad-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.ad-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ad-text {
    padding: 10px;
    text-align: center;
    font-size: 0.9rem;
    color: #333;
}

/* Ad Interaction States */
.ad-banner:hover {
    border-color: #adb5bd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ad-banner:active {
    transform: scale(0.98);
}

/* Ad Performance Metrics */
.ad-metrics {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 0.6rem;
    color: #6c757d;
    background: rgba(255,255,255,0.8);
    padding: 2px 4px;
    border-radius: 3px;
} 