/* ============================================
   Anatomy Blaster - Medical Edition
   Advertisement Styles 
   ============================================ */

.ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-ads);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.ad-overlay.hidden {
    display: none;
}

.ad-container {
    position: relative;
    background: linear-gradient(135deg, var(--stone-medium), var(--stone-dark));
    border: 2px solid var(--border-carved);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    padding-top: 48px;
    max-width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 
        inset 2px 2px 6px rgba(0, 0, 0, 0.5),
        inset -2px -2px 6px rgba(255, 255, 255, 0.08),
        0 10px 40px rgba(0, 0, 0, 0.8);
    animation: scaleIn 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   AD CLOSE BUTTON - Stone Button
   ============================================ */
.ad-close-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-stone);
    background: linear-gradient(135deg, var(--stone-light), var(--stone-medium));
    border: 2px solid var(--border-carved);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 5;
    padding: 0;
    outline: none;
    box-shadow: 
        inset 2px 2px 4px rgba(0, 0, 0, 0.4),
        inset -2px -2px 4px rgba(255, 255, 255, 0.08),
        0 3px 10px rgba(0, 0, 0, 0.5);
}

.ad-close-btn:hover {
    background: linear-gradient(135deg, #a84432, #8a3828);
    border-color: #d4855a;
    transform: scale(1.05);
    box-shadow: 
        inset 2px 2px 4px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(212, 133, 90, 0.4);
}

.ad-close-btn:active {
    transform: scale(0.95);
    box-shadow: 
        inset 3px 3px 6px rgba(0, 0, 0, 0.6),
        0 2px 6px rgba(0, 0, 0, 0.4);
}

/* X icon inside close button */
.ad-close-btn .icon-close::before,
.ad-close-btn .icon-close::after {
    background: #d4855a !important;
    height: 2.5px;
}

.ad-close-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.ad-content {
    width: 100%;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.ad-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.ad-content iframe {
    max-width: 100%;
    border: none;
    border-radius: var(--radius-md);
}

.ad-placeholder {
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font-body);
    letter-spacing: 1px;
    padding: 40px 30px;
    border: 1px dashed var(--border-stone);
    border-radius: var(--radius-md);
    width: 100%;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.ad-placeholder p {
    margin: 0;
}

.ad-timer {
    margin-top: var(--space-md);
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-align: center;
    min-height: 18px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.ad-timer .timer-count {
    color: var(--gold);
    font-weight: 700;
}

.ad-size-300x250 .ad-container {
    width: 340px;
    min-height: 290px;
}

.ad-size-300x250 .ad-content {
    width: 300px;
    height: 250px;
}

.ad-size-320x50 .ad-container {
    width: 360px;
    min-height: 90px;
    padding: var(--space-md);
    padding-top: 40px;
}

.ad-size-320x50 .ad-content {
    width: 320px;
    height: 50px;
}

.ad-size-728x90 .ad-container {
    width: min(90vw, 768px);
    min-height: 130px;
}

.ad-size-728x90 .ad-content {
    width: 728px;
    max-width: 100%;
    height: 90px;
}

@media (max-width: 480px) {
    .ad-container {
        padding: var(--space-lg);
        padding-top: 44px;
        max-width: 95vw;
        border-radius: var(--radius-md);
    }
    
    .ad-size-300x250 .ad-container {
        width: 95vw;
    }
    
    .ad-size-300x250 .ad-content {
        width: 100%;
        height: auto;
        min-height: 200px;
    }
    
    .ad-placeholder {
        padding: 24px 16px;
        min-height: 150px;
    }
}

@media (max-width: 360px) {
    .ad-container {
        padding: var(--space-md);
        padding-top: 40px;
    }
    
    .ad-close-btn {
        width: 36px;
        height: 36px;
    }
    
    .ad-placeholder {
        padding: 20px 12px;
        min-height: 120px;
    }
}