/* ========================================
   AdSense Ad Styles
   Professional ad placement styling
   ======================================== */

.ad-container {
    width: 100%;
    max-width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}

.ad-placeholder {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 2px dashed rgba(102, 126, 234, 0.5);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.ad-placeholder::before {
    content: "📢 Advertisement Slot";
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2rem 1rem;
    width: 100%;
    height: 100%;
}

.ad-placeholder::after {
    content: "AdSense code will appear here";
    display: block;
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    white-space: nowrap;
}

.ad-placeholder:hover {
    border-color: rgba(102, 126, 234, 0.8);
    background: rgba(15, 23, 42, 0.5);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

/* When ad is loaded, hide placeholder styling */
.ad-placeholder:has(ins.adsbygoogle)::before,
.ad-placeholder:has(ins.adsbygoogle)::after {
    display: none;
}

.ad-placeholder:has(ins.adsbygoogle) {
    background: transparent;
    border: none;
    backdrop-filter: none;
}

/* Banner Ads (Horizontal) */
.ad-banner-top {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.ad-banner-top .ad-placeholder {
    min-height: 120px;
    max-height: 280px;
}

.ad-banner-top .ad-placeholder::before {
    content: "📢 Top Banner Ad (728x90 / Responsive)";
}

/* Sidebar Ads (Vertical) */
.ad-sidebar {
    position: sticky;
    top: 100px;
    margin: 1rem 0;
}

.ad-sidebar .ad-placeholder {
    min-height: 300px;
    max-height: 600px;
}

/* In-Game Ads */
.ad-game-top {
    margin: 1rem 0;
}

.ad-game-top .ad-placeholder {
    min-height: 100px;
    max-height: 250px;
}

.ad-game-top .ad-placeholder::before {
    content: "📢 Game Top Banner (Responsive)";
}

.ad-game-below {
    margin: 2rem 0;
}

.ad-game-below .ad-placeholder {
    min-height: 280px;
    max-height: 280px;
}

/* Multiplex Ads (Related Content) */
.ad-multiplex {
    margin: 3rem auto;
    max-width: 100%;
}

.ad-multiplex .ad-placeholder {
    min-height: 250px;
}

.ad-multiplex .ad-placeholder::before {
    content: "📢 Multiplex Ad (Related Games)";
}

/* In-Article Ads */
.ad-in-article {
    margin: 2rem auto;
}

.ad-in-article .ad-placeholder {
    min-height: 180px;
}

.ad-in-article .ad-placeholder::before {
    content: "📢 In-Article Ad (Fluid Responsive)";
}

/* In-Article Ads */
.ad-in-article {
    margin: 2rem auto;
}

.ad-in-article .ad-placeholder {
    min-height: 150px;
}

/* Responsive Ad Adjustments */
@media (max-width: 768px) {
    .ad-container {
        margin: 1.5rem auto;
        padding: 0 0.5rem;
    }

    .ad-banner-top {
        margin-top: 1rem;
        margin-bottom: 1.5rem;
    }

    .ad-banner-top .ad-placeholder {
        min-height: 80px;
    }

    .ad-sidebar {
        position: static;
        margin: 1.5rem 0;
    }

    .ad-game-top .ad-placeholder,
    .ad-game-below .ad-placeholder {
        min-height: 100px;
    }

    .ad-placeholder::before {
        font-size: 0.8rem;
        padding: 1.5rem 1rem;
    }

    .ad-placeholder::after {
        font-size: 0.7rem;
    }
}

/* AdSense Specific Styles */
ins.adsbygoogle {
    display: block;
    background: transparent;
    border: none;
}

/* Hide placeholder content when ad is loaded */
.ad-placeholder:has(ins) {
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
}

.ad-placeholder:has(ins)::before,
.ad-placeholder:has(ins)::after {
    display: none !important;
}

/* Loading State - Removed to always show placeholder */
/* .ad-placeholder:empty::before removed */
ns.adsbygoogle {
    display: block;
    background: transparent;
    border: none;
}

/* Loading State */
/* Ad Label (Required by AdSense Policy) */
.ad-container::before {
    content: "Advertisement";
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

* Ad Label (Required by AdSense Policy) */ .ad-container::before {
    content: "";
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

/* Game Page Layout with Sidebar Ad */
.game-layout-with-ads {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.game-main-content {
    min-width: 0;
}

.game-sidebar-ads {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (max-width: 1200px) {
    .game-layout-with-ads {
        grid-template-columns: 1fr;
    }

    .game-sidebar-ads {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .game-sidebar-ads {
        grid-template-columns: 1fr;
    }
}