/**
 * EnoGeek Ads Manager - Frontend Styles
 */

/* Container for general ads */
.eg-ad-container,
.eg-ad-fallback {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.eg-ad-container img,
.eg-ad-fallback img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Sticky Side Rail / Gutter Banners (Left & Right)
   ========================================================================== */

.eg-sticky-side {
    position: fixed;
    top: 100px; /* Overridden dynamically by JS / Settings */
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 160px;
    width: max-content;
    pointer-events: auto;
    transition: opacity 0.25s ease;
}

/* Initial fallback positions before JS calculation */
.eg-sticky-side.eg-side-right {
    right: 12px;
}

.eg-sticky-side.eg-side-left {
    left: 12px;
}

/* Ad content inside side wrapper */
.eg-sticky-side .eg-side-content {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: #ffffff;
    line-height: 0;
}

.eg-sticky-side .eg-side-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: inherit;
}

/* Close Button (زر الإغلاق) */
.eg-side-close {
    position: absolute;
    top: -22px;
    width: 22px;
    height: 20px;
    line-height: 18px;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #ffffff;
    background: rgba(30, 30, 30, 0.75);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, transform 0.15s ease;
    z-index: 10;
}

.eg-side-right .eg-side-close {
    right: 0;
}

.eg-side-left .eg-side-close {
    left: 0;
}

.eg-side-close:hover {
    background: #e53e3e;
    transform: scale(1.05);
}

.eg-side-close:active {
    transform: scale(0.95);
}

/* ==========================================================================
   Responsive & Print Controls
   ========================================================================== */

/* Automatically hide on screens / zoom levels where side gutters cannot fit banners safely */
@media (max-width: 1500px) {
    .eg-sticky-side {
        display: none !important;
    }
}

/* Hide when printing */
@media print {
    .eg-sticky-side {
        display: none !important;
    }
}
