/**
 * Review Images for WooCommerce - Lightbox Styles
 *
 * @package ReviewImagesWC
 */

/* Prevent body scroll when lightbox is open */
body.riwc-lightbox-open {
    overflow: hidden;
}

/* Lightbox Overlay */
.riwc-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.riwc-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Lightbox Content */
.riwc-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.riwc-lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: riwc-lightbox-fadeIn 0.3s ease;
}

@keyframes riwc-lightbox-fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Close Button */
.riwc-lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.riwc-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.riwc-lightbox-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Navigation Buttons */
.riwc-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.riwc-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.riwc-lightbox-nav:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.riwc-lightbox-prev {
    left: 1.5rem;
}

.riwc-lightbox-next {
    right: 1.5rem;
}

/* Counter */
.riwc-lightbox-counter {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    z-index: 10;
}

/* Loading State */
.riwc-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.riwc-lightbox-loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: riwc-lightbox-spin 0.8s linear infinite;
}

@keyframes riwc-lightbox-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Caption (optional) */
.riwc-lightbox-caption {
    position: fixed;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1rem;
    text-align: center;
    max-width: 80%;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .riwc-lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .riwc-lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }

    .riwc-lightbox-prev {
        left: 0.5rem;
    }

    .riwc-lightbox-next {
        right: 0.5rem;
    }

    .riwc-lightbox-content {
        max-width: 95vw;
        max-height: 80vh;
    }

    .riwc-lightbox-content img {
        max-height: 80vh;
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) {
    .riwc-lightbox-nav {
        background: rgba(255, 255, 255, 0.15);
    }

    .riwc-lightbox-close {
        background: rgba(255, 255, 255, 0.15);
    }
}
