/* Responsive Ads CSS - Universal for all pages */

/* Base styles for ad containers */
.ad-slot {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0 auto;
}

/* Fix for ad container row */
.ad-container-row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    position: relative;
    display: flex;
    flex-wrap: wrap;
}

/* Banner ad - horizontal ad at top */
.banner-ad-container { 
    width: 100%; 
    height: 150px;
    max-width: 728px;
    margin: 0 auto;
}

/* Box ad - square ad */
.box-ad-container { 
    width: 100%;
    max-width: 290px; 
    height: 300px;
    margin: 0 auto;
}

/* Sidebar ad - vertical ad */
.sidebar-ad-container { 
    width: 100%;
    max-width: 290px;
    height: 600px;
    margin: 0 auto;
}

/* Ad item styles */
.ad-item {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
}

.ad-item video,
.ad-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Close button for ads */
.close-ad {
    position: absolute;
    top: 1px;
    right: 1px;
    z-index: 10;
    background: #f7f7f7;
    color: #212529;
    border: none;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
}

/* Column layout for ads */
.left-add, 
.right-add {
    padding: 0;
    position: relative;
    z-index: 1;
    overflow: visible;
}

/* Ensure ads don't overflow their containers */
.custom-ad-div {
    max-width: 100%;
    overflow: hidden;
}

/* Fix for container layout */
.container-fluid.position-relative {
    overflow: hidden;
}

/* Prevent content overlap */
.row.gx-0.align-items-start {
    margin-left: 0;
    margin-right: 0;
}

/* Desktop styles (992px and up) */
@media screen and (min-width: 992px) {
    .left-add .custom-ad-div,
    .right-add .custom-ad-div {
        max-width: 290px;
    }
    
    .box-ad-container {
        width: 100%;
        max-width: 300px;
    }
    
    .box-ad img, 
    .box-ad video {
        max-width: 100%;
        height: auto;
    }
    
    .col-lg-8.col-md-8,
    .col-md-8 {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Tablet styles (768px to 991px) */
@media screen and (max-width: 991px) {
    .left-add .custom-ad-div,
    .right-add .custom-ad-div {
        max-width: 250px;
    }
    
    .sidebar-ad-container {
        height: 400px;
        max-width: 200px;
    }
    
    .box-ad-container {
        height: 250px;
        max-width: 200px;
    }
}

/* Mobile styles (768px and below) */
@media screen and (max-width: 768px) {
    .left-add, 
    .right-add {
        width: 100%;
        max-width: 100%;
        padding: 0 15px;
        margin-bottom: 20px;
    }
    
    .left-add .custom-ad-div,
    .right-add .custom-ad-div {
        margin: 1rem auto !important;
        max-width: 300px;
    }
    
    .col-lg-8.col-md-8,
    .col-md-8 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .sidebar-ad-container {
        height: 300px;
        max-width: 100%;
    }
    
    .box-ad-container {
        height: 250px;
        max-width: 100%;
    }
}

/* Page-specific fixes */

/* Challenges page specific */
.challenge-details-tab .accordion-button {
    z-index: 1;
}

.challenge-details-tab .challenge_dances {
    overflow: hidden;
}

.accordion-item {
    overflow: hidden;
}

.challenge-details-tab .accordion-header .delete_dance {
    z-index: 2;
}

/* Events page specific */
.create_event {
    width: 100%;
}

.radio-venue-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 10px;
}

.radio-venue-list li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.radio-venue-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Groups page specific */
.create_group {
    width: 100%;
}

.radio-member-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 10px;
}

.radio-member-list li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.radio-member-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}