/* ============================================
   AGC Dracin - Ads / Iklan Stylesheet
   Mendukung: Google AdSense, Banner Custom, Demo
   ============================================ */

/* ── Global ad wrapper ── */
.ad-slot {
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.ad-slot * { line-height: 1.5; }

/* Label "Iklan" / "Advertisement" */
.ad-label {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1px 5px;
    border-radius: 3px;
    z-index: 5;
    pointer-events: none;
}

/* Tombol tutup iklan */
.ad-close {
    position: absolute;
    top: 4px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.25);
    color: white;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    outline: none;
    transition: background 0.2s;
    z-index: 10;
}
.ad-close:hover { background: var(--primary); }

/* ── Demo Ad Layouts (placeholder ketika AdSense belum aktif) ── */
.ad-demo {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.75) 0%, rgba(15, 15, 25, 0.9) 100%);
    border: 1px solid rgba(231, 76, 60, 0.25);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.ad-demo:hover {
    border-color: rgba(231, 76, 60, 0.45);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.12);
}

.ad-demo::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(231,76,60,0.06) 0%,
        transparent 50%,
        rgba(243,156,18,0.06) 100%);
    pointer-events: none;
}

.ad-demo-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
    padding: 0.75rem 1.2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Topbar Ad (selebaran paling atas, dapat ditutup) ── */
.ad-topbar {
    width: 100%;
    background: linear-gradient(90deg, #0a0a0f, #1a1a2e, #0a0a0f);
    position: relative;
    z-index: 1100;
    transition: height 0.3s ease, opacity 0.3s ease;
}

.ad-topbar.closed {
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.ad-slot--topbar {
    width: 100%;
}

.ad-demo--leaderboard {
    width: 100%;
    min-height: 52px;
    justify-content: center;
    border-radius: 8px;
}

/* ── Sub-nav Ad (tipis, under navbar) ── */
.ad-slot--subnav {
    width: 100%;
    margin: 0.6rem auto 0;
}

.ad-demo--subnav {
    min-height: 38px;
    justify-content: center;
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.08) 0%, rgba(243, 156, 18, 0.08) 50%, rgba(231, 76, 60, 0.08) 100%);
    border-radius: 20px;
    border: 1px solid rgba(231, 76, 60, 0.2);
    font-size: 0.82rem;
    gap: 0.6rem;
    padding: 0.4rem 1.2rem;
    display: flex;
    align-items: center;
}

/* ── After-hero (full width) ── */
.ad-slot--after-hero {
    margin: 1.5rem auto 0.5rem;
}

.ad-demo--billboard {
    min-height: 70px;
    justify-content: center;
    border-radius: 10px;
    padding: 0.6rem 1rem;
}

/* ── Mid-content layout (rectangle + text side by side) ── */
.ad-slot--mid-content {
    margin: 0.5rem auto 0.5rem;
}

.ad-mid-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.ad-mid-text {
    flex: 1;
}

.ad-mid-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.ad-demo--rectangle {
    width: 300px;
    min-width: 260px;
    min-height: 200px;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
}

/* ── Before-footer wide banner ── */
.ad-slot--before-footer {
    width: 100%;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
}

.ad-demo--banner-wide {
    min-height: 70px;
    border-radius: 8px;
    justify-content: center;
}

/* ── Footer top (full width) ── */
.ad-slot--footer-top {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
}

/* ── Footer widget (small box) ── */
.ad-slot--footer-widget {
    width: 100%;
}

.ad-demo--small-box {
    min-height: 80px;
    flex-direction: column;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.8rem;
}

/* ── Inline (generic inline ads) ── */
.ad-slot--inline {
    width: 100%;
    margin: 1rem 0;
}

/* ── Square (small, sidebar-like) ── */
.ad-demo--square {
    width: 200px;
    min-height: 200px;
    flex-direction: column;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.8rem;
    margin: 0 auto;
}

/* ── Player Midroll Ad Overlay ── */
.ad-midroll-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    animation: fadeInOverlay 0.4s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ad-midroll-overlay.hidden { display: none; }

.ad-midroll-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    position: relative;
}

.ad-midroll-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.ad-midroll-skip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.2rem;
    padding: 0.6rem 1.4rem;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.ad-midroll-skip:hover { background: var(--primary-dark); }
.ad-midroll-skip:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.ad-midroll-countdown {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ── Weekly Top List (beside mid ad) ── */
.weekly-top-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: opacity 0.2s;
}

.weekly-top-item:last-child { border-bottom: none; }
.weekly-top-item:hover { opacity: 0.8; }

.weekly-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.weekly-rank.r1 { background: var(--gold); color: #333; }
.weekly-rank.r2 { background: #C0C0C0; color: #333; }
.weekly-rank.r3 { background: #CD7F32; color: white; }
.weekly-rank.rn { background: var(--bg-secondary); color: var(--text-muted); }

.weekly-info { flex: 1; overflow: hidden; }
.weekly-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weekly-meta { font-size: 0.75rem; color: var(--text-muted); }

.weekly-poster {
    width: 36px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .ad-mid-wrapper {
        flex-direction: column;
    }

    .ad-demo--rectangle {
        width: 100%;
        min-height: 120px;
    }

    .ad-demo--leaderboard {
        font-size: 0.75rem;
    }

    .ad-slot--subnav {
        display: none; /* hide under-nav on mobile to save space */
    }

    .ad-topbar { display: none; } /* hide topbar on very small screens if needed */
}

@media (max-width: 480px) {
    .ad-slot--before-footer,
    .ad-slot--footer-top {
        padding: 0.3rem 0;
    }

    .ad-demo--banner-wide,
    .ad-demo--billboard {
        min-height: 48px;
        font-size: 0.75rem;
    }
}

/* ═══════════════════════════════════════════
   ADSTERRA ADS SLOTS (Header, Body, Footer)
   ═══════════════════════════════════════════ */

.adsterra-slot {
    width: 100%;
    margin: 0.8rem auto;
    text-align: center;
    position: relative;
    z-index: 10;
}

.adsterra-slot-header {
    margin: 0.4rem auto;
    max-width: 1200px;
}

.adsterra-slot-body {
    margin: 1.5rem auto;
    max-width: 1200px;
}

.adsterra-slot-footer {
    margin: 1.5rem auto 0.5rem;
    max-width: 1200px;
}

.adsterra-banner-wrapper {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
}

.adsterra-banner-frame {
    display: block;
    margin: 0 auto;
    border: none;
    max-width: 100%;
}

/* ═══════════════════════════════════════════
   MANUAL AD PLACEHOLDERS (Semua Halaman)
   ═══════════════════════════════════════════ */
.manual-ad-placeholder {
    width: 100%;
    margin: 1.2rem auto;
    text-align: center;
    position: relative;
    clear: both;
    line-height: normal;
}

.manual-ad-placeholder iframe,
.manual-ad-placeholder ins,
.manual-ad-placeholder img {
    max-width: 100% !important;
}

.manual-ad-placeholder:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Mid-content 300x250 Banner Slot (Samping Drama Populer Minggu Ini) ── */
.manual-ad-home-mid {
    width: 300px;
    min-width: 300px;
    min-height: 250px;
    margin: 0 !important;
    clear: none !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (max-width: 768px) {
    .manual-ad-home-mid {
        width: 100%;
        min-width: unset;
        margin: 0 auto 1.5rem auto !important;
    }
}

/* Sembunyikan semua iklan demo / build-up bawaan tanpa konfigurasi */
.ad-demo {
    display: none !important;
}
