/**
 * Image Lightbox Styles
 * Version: 1.0.0
 */

/* Lightbox trigger images - add cursor pointer */
img.lightbox,
.lightbox img,
.wp-block-image.lightbox img,
.wp-block-gallery.lightbox img {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

img.lightbox:hover,
.lightbox img:hover,
.wp-block-image.lightbox img:hover,
.wp-block-gallery.lightbox img:hover {
    opacity: 0.9;
}

/* Lightbox overlay */
.il-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    cursor: pointer;
    animation: ilFadeIn 0.3s ease;
}

.il-lightbox-overlay.active {
    display: block;
}

/* Lightbox container */
.il-lightbox-container {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000000;
    max-width: 90vw;
    max-height: 90vh;
    animation: ilZoomIn 0.3s ease;
}

.il-lightbox-container.active {
    display: block;
}

/* Lightbox image */
.il-lightbox-image {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    cursor: default;
}

.il-lightbox-image.zoomed {
    max-width: none;
    max-height: none;
    cursor: move;
}

/* Loading spinner */
.il-lightbox-loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000001;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ilSpin 1s linear infinite;
}

.il-lightbox-loading.active {
    display: block;
}

/* Close button */
.il-lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1000002;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: all 0.3s ease;
    display: none;
}

.il-lightbox-close.active {
    display: block;
}

.il-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.il-lightbox-close:before,
.il-lightbox-close:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #fff;
}

.il-lightbox-close:before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.il-lightbox-close:after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Navigation arrows */
.il-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: 1000001;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: none;
}

.il-lightbox-nav.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.il-lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.il-lightbox-prev {
    left: 20px;
}

.il-lightbox-next {
    right: 20px;
}

.il-lightbox-nav:before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
}

.il-lightbox-prev:before {
    transform: rotate(-135deg);
    margin-left: 4px;
}

.il-lightbox-next:before {
    transform: rotate(45deg);
    margin-right: 4px;
}

/* Caption */
.il-lightbox-caption {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    max-width: 80%;
    text-align: center;
    z-index: 1000001;
    font-size: 14px;
    line-height: 1.4;
    display: none;
}

.il-lightbox-caption.active {
    display: block;
}

/* Counter */
.il-lightbox-counter {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    z-index: 1000001;
    font-size: 14px;
    display: none;
}

.il-lightbox-counter.active {
    display: block;
}

/* Download button */
.il-lightbox-download {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000001;
    transition: all 0.3s ease;
    display: none;
}

.il-lightbox-download.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.il-lightbox-download:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.1);
}

.il-lightbox-download svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Animations */
@keyframes ilFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ilZoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes ilSpin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .il-lightbox-image {
        max-width: 95vw;
        max-height: 80vh;
    }
    
    .il-lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }
    
    .il-lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .il-lightbox-prev {
        left: 10px;
    }
    
    .il-lightbox-next {
        right: 10px;
    }
    
    .il-lightbox-caption {
        bottom: 10px;
        font-size: 12px;
        padding: 8px 15px;
    }
}

/* Prevent body scroll when lightbox is open */
body.il-lightbox-open {
    overflow: hidden;
}

/* Zoom cursor */
.il-zoom-cursor {
    cursor: zoom-in;
}

.il-zoom-out-cursor {
    cursor: zoom-out;
}