/* Lightbox Overlay */
.ilg-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Lightbox Container */
.ilg-lightbox-container {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1600px;
    max-height: 1000px;
    display: flex;
    flex-direction: column;
}

/* Close Button */
.ilg-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 48px;
    line-height: 50px;
    cursor: pointer;
    color: #fff;
    z-index: 1000;
    transition: color 0.3s, transform 0.2s, background-color 0.3s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.ilg-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.15);
}

/* Content Wrapper - Split Layout */
.ilg-content-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 0;
    align-items: center;
}

/* Image Section - Left Side (70%) */
.ilg-image-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
    gap: 20px;
}

/* Ad Section - Right Side (300x250 ad) */
.ilg-ad-section {
    flex: 0 0 340px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    margin-left: 20px;
}

/* Image Container */
.ilg-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    position: relative;
    order: 2;
}

/* Lightbox Image */
#ilg-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

/* Image Caption */
.ilg-image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    padding: 20px 20px 10px;
    font-size: 16px;
    text-align: center;
}

/* Navigation Buttons */
.ilg-nav-btn {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 60px;
    height: 80px;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    border-radius: 8px;
    transition: background-color 0.3s, transform 0.2s;
    z-index: 10;
}

.ilg-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.ilg-prev-btn {
    order: 1;
}

.ilg-next-btn {
    order: 3;
}

/* Hide mobile nav buttons on desktop */
.ilg-nav-buttons-container {
    display: none;
}

/* AdSense Container - Fixed 300x250 */
#ilg-adsense-container {
    width: 300px;
    height: 250px;
}

#ilg-adsense-container img {
    max-width: 300px;
    max-height: 250px;
    width: auto;
    height: auto;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .ilg-ad-section {
        display: none !important;
    }
    
    .ilg-content-wrapper {
        gap: 0;
    }
}

@media screen and (max-width: 768px) {
    .ilg-lightbox-container {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
    }
    
    .ilg-image-section {
        flex-direction: column;
        gap: 0;
        height: 100%;
    }
    
    .ilg-image-container {
        order: 1;
        flex: 1;
        min-height: 0;
    }
    
    /* Hide desktop side nav buttons */
    .ilg-prev-btn,
    .ilg-next-btn {
        display: none;
    }
    
    /* Fixed position mobile navigation buttons at bottom */
    .ilg-nav-buttons-container {
        display: flex !important;
        gap: 10px;
        justify-content: center;
        order: 2;
        flex-shrink: 0;
        padding: 15px 0;
        width: 100%;
    }
    
    .ilg-nav-btn {
        width: 120px;
        height: 50px;
        font-size: 32px;
    }
    
    .ilg-close-btn {
        font-size: 42px;
        line-height: 42px;
    }
    
    .ilg-image-caption {
        font-size: 14px;
        padding: 15px 10px 8px;
    }
}

@media screen and (max-width: 480px) {
    .ilg-nav-buttons-container {
        gap: 8px;
        padding: 12px 0;
    }
    
    .ilg-nav-btn {
        width: 100px;
        height: 45px;
        font-size: 28px;
    }
    
    .ilg-close-btn {
        font-size: 36px;
        line-height: 36px;
    }
}

/* Loading State */
#ilg-lightbox-image[src=""] {
    min-width: 200px;
    min-height: 200px;
    background: #222;
}

/* Mobile Ad Slide */
.ilg-mobile-ad-slide {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.ilg-mobile-ad-slide.active {
    display: flex;
}

.ilg-mobile-ad-container {
    width: 300px;
    height: 250px;
    background: #1a1a1a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ilg-mobile-ad-container img,
.ilg-mobile-ad-container a {
    display: block;
}

.ilg-mobile-ad-container img {
    width: 300px;
    height: 250px;
    object-fit: contain;
}

.ilg-mobile-ad-container .adsbygoogle {
    width: 300px !important;
    height: 250px !important;
}

.ilg-mobile-ad-label {
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: -10px;
}

/* Smooth Transitions */
.ilg-lightbox-overlay * {
    box-sizing: border-box;
}
