/* ============================================================
   EKRAN KENARI REKLAMLARI + POPUP
   ============================================================ */

/* ============ EKRAN KENAR REKLAMLARI (fixed sticky) ============ */
.screen-side-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 160px;
    max-height: 600px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: #fff;
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0;
    pointer-events: none;
}
.screen-side-ad.visible {
    opacity: 1;
    pointer-events: auto;
}

.screen-side-ad.position-left {
    left: 12px;
}
.screen-side-ad.position-right {
    right: 12px;
}

.screen-side-ad img {
    width: 100%;
    height: auto;
    display: block;
}

.screen-side-ad .ad-html iframe,
.screen-side-ad .ad-html ins {
    width: 100% !important;
    max-width: 100%;
    display: block;
}

.screen-side-ad .ad-label {
    position: absolute;
    bottom: 2px;
    left: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.screen-side-ad .ad-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.screen-side-ad .ad-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Küçük ekranlarda gizle (içerik genişliği için yer kalmaz) */
@media (max-width: 1280px) {
    .screen-side-ad {
        display: none;
    }
}

/* Çok geniş ekranlarda biraz büyük */
@media (min-width: 1680px) {
    .screen-side-ad {
        width: 200px;
        max-height: 700px;
    }
}

/* ============ POPUP REKLAM (MODAL) ============ */
.popup-ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: popupFadeIn 0.3s ease-out;
}

.popup-ad-overlay.show {
    display: flex;
}

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

.popup-ad-container {
    position: relative;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: popupSlideIn 0.4s ease-out;
}

@keyframes popupSlideIn {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.popup-ad-container img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 90vh;
    object-fit: contain;
}

.popup-ad-container .ad-html {
    padding: 0;
    min-width: 320px;
    min-height: 200px;
}

.popup-ad-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.2s;
}
.popup-ad-close:hover {
    background: rgba(220, 53, 69, 0.9);
    transform: scale(1.1);
}
.popup-ad-close:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.popup-ad-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

.popup-ad-countdown {
    position: absolute;
    top: 14px;
    right: 56px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 2;
    font-weight: 600;
}

@media (max-width: 600px) {
    .popup-ad-container {
        max-width: 100%;
        max-height: 95vh;
    }
}

/* ============ ANA İÇERİĞİN EKRAN KENARINA UYUM ============ */
/* Geniş ekranda body content'ine sol/sağ padding ekle ki reklam altında kalmasın */
@media (min-width: 1280px) {
    body.has-screen-ads .main-container,
    body.has-screen-ads .container,
    body.has-screen-ads .news-detail-container {
        max-width: calc(100% - 384px); /* 160px × 2 + 64px margin */
    }
}
