/* Banner Styles */

/* Page Wrapper for Tower Banners */
.page-wrapper {
    display: flex;
    gap: 20px;
   /* max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
   */ 
    align-items: stretch; /* Stretch sidebar to match main content height */
}

.main-content {
    flex: 1;
    min-width: 0; /* Prevents flex item from overflowing */
}

/* Header Banner */
.ad-header-banner {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
   /* background: #fff;*/
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-header-banner .ad-banner-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.ad-header-banner .ad-banner-html {
    min-height: 100px;
    border: none;
    display: block;
    margin: 0 auto;
    vertical-align: middle;
}

.ad-header-banner .ad-banner-html:not([width]) {
    width: 100%;
    max-width: 100%;
}

/* HTML Banner Wrapper for better centering */
.ad-banner-container iframe.ad-banner-html {
    margin-left: auto;
    margin-right: auto;
}

/* Tower Banners */
.ad-tower-banner {
    width: 100%;
    min-width: 120px;
    max-width: 320px;
    position: relative;
    height: fit-content;
    background: #fff;
    padding: 20px;
    margin-top: 20px;
    /*
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    */
}

.ad-tower-left {
    /* Left tower banner is now in left sidebar */
    max-height: 320px;
}

.ad-tower-banner .ad-banner-image {
    width: 100%;
    max-width: 300px;
    height: auto;
  /*  min-height: 600px; */
    object-fit: cover;
    display: block;
}

.ad-tower-banner .ad-banner-html {
    width: 100%;
    max-width: 100%;
    min-height: 600px;
    border: none;
    display: block;
    margin: 0 auto;
}

/* Grid Banner */
.ad-grid-banner {
    width: 100%;
    grid-column: 1 / -1; /* Span all columns */
    margin: 20px auto;
    text-align: center;
  /*  background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;*/
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-grid-banner .ad-banner-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.ad-grid-banner .ad-banner-html {
    width: 100%;
    max-width: 100%;
    min-height: 150px;
    border: none;
    display: block;
    margin: 0 auto;
}

/* Popup Banner */
.ad-popup-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in;
}

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

.ad-popup-content {
    position: relative;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

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

.ad-popup-close {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f44336;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: background 0.3s;
}

.ad-popup-close:hover {
    background: #d32f2f;
}

.ad-popup-content .ad-banner-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.ad-popup-content .ad-banner-html {
    width: 100%;
    max-width: 100%;
    min-height: 300px;
    border: none;
    display: block;
    margin: 0 auto;
}

/* Banner Link Styles */
.ad-banner-link {
    display: block;
    text-decoration: none;
    transition: opacity 0.3s;
    margin-top: 0;
}

.ad-banner-link:hover {
    opacity: 0.9;
}

/* HTML Banner Container - ensures proper centering */
.ad-banner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.ad-banner-container .ad-banner-html {
    width: 100%;
    max-width: 100%;
    border: none;
    display: block;
    margin: 0 auto;
    vertical-align: middle;
}

/* Ensure all banner containers center their HTML content */
.ad-header-banner,
.ad-grid-banner,
.ad-popup-content,
.ad-tower-banner {
    position: relative;
}

.ad-header-banner iframe.ad-banner-html,
.ad-grid-banner iframe.ad-banner-html,
.ad-popup-content iframe.ad-banner-html,
.ad-tower-banner iframe.ad-banner-html {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-wrapper {
        flex-direction: column;
    }
    
    .right-sidebar {
        width: 100%;
        min-width: auto;
    }
    
    .filter-widget-container {
        position: static;
    }
    
    .ad-tower-banner {
        width: 100%;
        min-width: auto;
        position: static;
        max-height: none;
        margin-bottom: 20px;
    }
    
    .ad-tower-banner .ad-banner-image {
        min-height: 300px;
    }
    
    .ad-tower-banner .ad-banner-html {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .ad-header-banner {
        padding: 5px 0;
    }
    
    .ad-grid-banner {
        margin: 10px 0;
        padding: 10px;
    }
    
    .ad-popup-content {
        padding: 15px;
        max-width: 95%;
    }
}

