/* --- LOADING STATES (BUG FIX) --- */
.media-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #27272a; 
    z-index: 50 !important; /* Force it above the image */
    transition: opacity 0.5s ease;
}

/* Spinner */
.loader-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Fade Logic */
.media-fade-in { opacity: 0; transition: opacity 0.5s ease-in-out; z-index: 10; }
.media-loaded { opacity: 1; }

@keyframes spin { to { transform: rotate(360deg); } }

/* --- MOCK GOOGLE ADS STYLES --- */

/* Ad Container Generic */
.mock-ad-container {
    background-color: #f1f5f9; /* Light gray standard for ads */
    color: #334155;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: center;
    font-family: sans-serif;
}

/* The "Ad" Badge */
.ad-badge {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #fbbf24;
    color: black;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-bottom-right-radius: 4px;
}

/* In-Feed Grid Ad */
.grid-ad-card {
    aspect-ratio: 9/16;
    border-radius: 12px;
}

/* Modal Banner Ad */
.modal-banner-ad {
    width: 100%;
    height: 60px; /* Standard Banner Height */
    margin-top: 16px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

/* Rewarded Video Ad Overlay */
.rewarded-ad-overlay {
    position: fixed;
    inset: 0;
    background: black;
    z-index: 110; /* Highest Z-Index */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* --- PREVIOUS STYLES (Keep these) --- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
#close-modal { z-index: 100 !important; cursor: pointer; }
#modal { backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.lock-overlay { position: absolute; bottom: 30px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; z-index: 50; }
.protected-media { user-select: none; pointer-events: none; filter: brightness(0.6) grayscale(20%); transition: all 0.5s ease; }
.unlocked-media { filter: brightness(1) grayscale(0%); pointer-events: auto; }
.click-catcher { position: absolute; inset: 0; z-index: 40; cursor: pointer; background: transparent; }
/* Mobile Safety */
img, video, .click-catcher, .protected-media, .wallpaper-card { -webkit-touch-callout: none !important; -webkit-user-select: none !important; user-select: none !important; -webkit-tap-highlight-color: transparent !important; }