/* Professional Ad System for ClaimFastPepe */
/* Responsive, Safe, and Admin-Controlled */

/* ==== AD SLOT BASE STYLES ==== */
.ad-slot {
    position: relative;
    margin: 15px 0;
    transition: all 0.3s ease;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
}

.ad-slot[data-active="false"] {
    display: none !important;
}

.ad-slot[data-active="true"] {
    display: block;
}

/* ==== AD PLACEHOLDER & SKELETON ==== */
.ad-placeholder {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.05), rgba(0, 0, 0, 0.1));
    border: 1px dashed rgba(0, 255, 65, 0.2);
    border-radius: var(--radius-md);
    min-height: 90px;
    transition: all 0.3s ease;
}

.ad-fallback {
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    opacity: 0.7;
}

.ad-fallback span {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    filter: grayscale(0.5);
}

.ad-fallback small {
    font-size: 0.8rem;
    color: rgba(0, 255, 65, 0.6);
}

/* ==== LOADING SKELETONS ==== */
.ad-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 255, 65, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 2s infinite;
    border-radius: var(--radius-md);
}

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

.ad-skeleton.vertical {
    background-size: 100% 200%;
    animation: skeletonLoadingVertical 2s infinite;
}

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

/* ==== AD CONTENT CONTAINERS ==== */
.ad-content {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
}

.ad-content:empty + .ad-placeholder {
    display: flex;
}

.ad-content:not(:empty) + .ad-placeholder {
    display: none;
}

/* ==== HEADER BANNER AD ==== */
.header-banner-ad {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 255, 65, 0.3);
    backdrop-filter: blur(5px);
}

.header-banner-ad .ad-placeholder {
    height: 88px;
    border-radius: var(--radius-md);
}

/* ==== SIDEBAR BANNER AD ==== */
.sidebar-banner-ad {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 160px;
    height: 600px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 65, 0.3);
    backdrop-filter: blur(5px);
    z-index: 50;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
}

.sidebar-banner-ad .ad-placeholder {
    height: 598px;
    flex-direction: column;
    padding: 20px;
}

.sidebar-banner-ad .ad-fallback {
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

/* ==== FOOTER BANNER AD ==== */
.footer-banner-ad {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 65, 0.3);
    backdrop-filter: blur(5px);
}

.footer-banner-ad .ad-placeholder {
    height: 88px;
}

/* ==== NATIVE VIDEO AD ==== */
.native-video-ad {
    width: 100%;
    max-width: 640px;
    height: 360px;
    margin: 30px auto;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 255, 65, 0.3);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.native-video-ad .ad-placeholder {
    height: 356px;
    flex-direction: column;
    padding: 20px;
}

.video-placeholder {
    margin-top: 15px;
    padding: 10px 15px;
    background: rgba(0, 255, 65, 0.1);
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(0, 255, 65, 0.3);
    font-size: 0.9rem;
    color: var(--neon-green);
}

.ad-skeleton.video {
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(0, 255, 65, 0.2) 25%,
        rgba(255, 215, 0, 0.2) 50%,
        rgba(0, 255, 65, 0.2) 75%,
        transparent 100%
    );
    background-size: 200% 200%;
    animation: videoSkeletonGlow 3s infinite;
}

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

/* ==== CENTER POPUP AD ==== */
.center-popup-ad {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.center-popup-ad[data-active="true"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.ad-popup {
    position: relative;
    width: 90%;
    max-width: 500px;
    height: auto;
    min-height: 300px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(10, 10, 10, 0.95));
    border: 2px solid var(--neon-green);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.5);
    animation: popupFadeIn 0.5s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ad-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 68, 68, 0.2);
    border: 2px solid var(--danger);
    color: var(--danger);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 10;
}

.ad-close:hover {
    background: var(--danger);
    color: var(--white);
    transform: scale(1.1);
}

.ad-skeleton.popup {
    border-radius: var(--radius-lg);
}

/* ==== SILENT NOTIFICATION AD ==== */
.notification-silent-ad {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 280px;
    height: 100px;
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: var(--radius-md);
    z-index: 200;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
    transform: translateX(300px);
    transition: transform 0.5s ease;
}

.notification-silent-ad.show {
    transform: translateX(0);
}

.notification-silent-ad .ad-placeholder {
    height: 98px;
    padding: 15px;
    flex-direction: row;
    gap: 10px;
}

.ad-skeleton.notification {
    background: linear-gradient(
        135deg,
        rgba(0, 255, 65, 0.1) 0%,
        rgba(0, 255, 65, 0.3) 50%,
        rgba(0, 255, 65, 0.1) 100%
    );
    background-size: 200% 200%;
    animation: notificationPulse 2s infinite;
}

@keyframes notificationPulse {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}

/* ==== ADBLOCK DETECTION & WARNING ==== */
.adblock-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.adblock-content {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(10, 10, 10, 0.95));
    border: 2px solid var(--warning);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 170, 0, 0.5);
}

.adblock-content h3 {
    color: var(--warning);
    font-family: var(--font-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.adblock-content p {
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.6;
}

.adblock-content button {
    background: linear-gradient(135deg, var(--warning), #ff8800);
    color: var(--black);
    border: none;
    padding: 12px 25px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.adblock-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.5);
}

/* ==== RESPONSIVE DESIGN ==== */

/* Tablet Adjustments */
@media (max-width: 1024px) {
    .sidebar-banner-ad {
        width: 120px;
        height: 400px;
        top: 100px;
        right: 10px;
    }
    
    .header-banner-ad,
    .footer-banner-ad {
        max-width: 90%;
        height: 70px;
    }
    
    .native-video-ad {
        height: 280px;
        max-width: 90%;
    }
    
    .notification-silent-ad {
        width: 250px;
        height: 80px;
        bottom: 10px;
        right: 10px;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    /* Move sidebar to bottom on mobile */
    .sidebar-banner-ad {
        position: static;
        width: 100%;
        height: 100px;
        margin: 20px 0;
        border-radius: var(--radius-md);
    }
    
    .sidebar-banner-ad .ad-placeholder {
        height: 98px;
        flex-direction: row;
        padding: 15px;
    }
    
    .sidebar-banner-ad .ad-fallback {
        writing-mode: initial;
        text-orientation: initial;
    }
    
    .header-banner-ad,
    .footer-banner-ad {
        height: 60px;
        margin: 15px auto;
    }
    
    .native-video-ad {
        height: 220px;
        margin: 20px auto;
    }
    
    .notification-silent-ad {
        width: 200px;
        height: 70px;
        font-size: 0.8rem;
    }
    
    .ad-popup {
        width: 95%;
        min-height: 250px;
        margin: 20px;
    }
    
    .center-popup-ad {
        padding: 10px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header-banner-ad,
    .footer-banner-ad,
    .sidebar-banner-ad {
        height: 50px;
        margin: 10px auto;
    }
    
    .native-video-ad {
        height: 180px;
    }
    
    .notification-silent-ad {
        width: 180px;
        height: 60px;
        bottom: 5px;
        right: 5px;
    }
    
    .ad-fallback span {
        font-size: 1.5rem;
    }
    
    .ad-fallback small {
        font-size: 0.7rem;
    }
}

/* ==== ADMIN PREVIEW INDICATORS ==== */
.ad-slot::before {
    content: attr(data-ad-slot);
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 255, 65, 0.8);
    color: var(--black);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-primary);
    font-weight: bold;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

body.admin-preview .ad-slot::before {
    opacity: 1;
}

body.admin-preview .ad-slot {
    border: 2px dashed var(--neon-green);
    background: rgba(0, 255, 65, 0.05);
}

/* ==== SAFE AD LOADING ==== */
.ad-loading {
    pointer-events: none;
    opacity: 0.7;
}

.ad-loaded {
    pointer-events: all;
    opacity: 1;
}

.ad-error {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.3);
}

.ad-error .ad-fallback {
    color: var(--danger);
}

/* ==== SMOOTH TRANSITIONS ==== */
.ad-slot,
.ad-content,
.ad-placeholder {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==== ACCESSIBILITY ==== */
.ad-slot[aria-hidden="true"] {
    visibility: hidden;
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
}

@media (prefers-reduced-motion: reduce) {
    .ad-skeleton,
    .ad-popup {
        animation: none;
    }
    
    .notification-silent-ad {
        transition: none;
        transform: translateX(0);
    }
}

/* ==== PRINT STYLES ==== */
@media print {
    .ad-slot {
        display: none !important;
    }
}
