/**
 * KM Lightbox Styles
 */
.km-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.km-lightbox-overlay.km-lightbox-active {
    opacity: 1;
}

.km-lightbox {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.km-lightbox-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    min-width: 200px;
}

.km-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.km-lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1rem;
    display: none;
}

.km-lightbox-loader::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: km-lightbox-spin 1s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes km-lightbox-spin {
    to {
        transform: rotate(360deg);
    }
}

.km-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.km-lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.km-lightbox-nav:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.km-lightbox-prev {
    left: -70px;
}

.km-lightbox-next {
    right: -70px;
}

.km-lightbox-close {
    position: absolute;
    top: -60px;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.km-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.km-lightbox-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.km-lightbox-counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .km-lightbox {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .km-lightbox-image {
        max-height: 85vh;
    }
    
    .km-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .km-lightbox-prev {
        left: -50px;
    }
    
    .km-lightbox-next {
        right: -50px;
    }
    
    .km-lightbox-close {
        top: -50px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .km-lightbox-counter {
        bottom: -40px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .km-lightbox-prev {
        left: 10px;
        top: 10px;
        transform: none;
    }
    
    .km-lightbox-next {
        right: 10px;
        top: 10px;
        transform: none;
    }
    
    .km-lightbox-close {
        top: 10px;
        right: 50%;
        transform: translateX(50%);
    }
    
    .km-lightbox-counter {
        bottom: 10px;
    }
}

/* Prevent body scroll when lightbox is open */
body.km-lightbox-open {
    overflow: hidden;
}

/* Add cursor pointer to clickable images */
.ce-image img,
.ce-gallery img,
.ce-textpic img {
    transition: opacity 0.3s ease;
}

.ce-image img:hover,
.ce-gallery img:hover,
.ce-textpic img:hover {
    opacity: 0.8;
}

/* Style for image links */
a[data-lightbox] {
    display: inline-block;
    transition: opacity 0.3s ease;
}

a[data-lightbox]:hover {
    opacity: 0.8;
}