/**
 * Imagelet Product Types - Shared Lightbox Styles
 *
 * A simple, clean lightbox component that can be used across the plugin.
 * Features:
 * - Dark overlay background
 * - Centered image display
 * - Optional navigation arrows for galleries
 * - Keyboard navigation support (Escape to close, arrows to navigate)
 *
 * @package Imagelet_Product_Types
 */

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

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

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

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

.ipt-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    object-fit: contain;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* ========================================
   Close Button
   ======================================== */
.ipt-lightbox-overlay .ipt-lightbox-close,
#ipt-lightbox-overlay .ipt-lightbox-close,
button.ipt-lightbox-close {
    position: fixed !important;
    top: 30px !important;
    right: 30px !important;
    width: 60px !important;
    height: 60px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 50px !important;
    font-weight: 100 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: opacity 0.2s ease !important;
    z-index: 10000000 !important;
    line-height: 1 !important;
    opacity: 0.7 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    font-family: Arial, Helvetica, sans-serif !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    border-radius: 0 !important;
    text-shadow: none !important;
}

.ipt-lightbox-overlay .ipt-lightbox-close:hover,
.ipt-lightbox-overlay .ipt-lightbox-close:focus,
.ipt-lightbox-overlay .ipt-lightbox-close:active,
#ipt-lightbox-overlay .ipt-lightbox-close:hover,
#ipt-lightbox-overlay .ipt-lightbox-close:focus,
#ipt-lightbox-overlay .ipt-lightbox-close:active,
button.ipt-lightbox-close:hover,
button.ipt-lightbox-close:focus,
button.ipt-lightbox-close:active {
    opacity: 1 !important;
    background: transparent !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* ========================================
   Navigation Arrows
   ======================================== */
.ipt-lightbox-prev,
.ipt-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 80px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 50px;
    font-weight: 200;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    z-index: 10000000;
    opacity: 0.7;
    padding: 0;
    margin: 0;
    font-family: Arial, sans-serif;
}

.ipt-lightbox-prev {
    left: 20px;
}

.ipt-lightbox-next {
    right: 20px;
}

.ipt-lightbox-prev:hover,
.ipt-lightbox-prev:focus,
.ipt-lightbox-next:hover,
.ipt-lightbox-next:focus {
    opacity: 1;
    background: transparent;
    outline: none;
}

/* ========================================
   Counter (e.g., "1 / 5")
   ======================================== */
.ipt-lightbox-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    opacity: 0.7;
    z-index: 10000000;
    font-family: Arial, sans-serif;
}

/* ========================================
   Loading State
   ======================================== */
.ipt-lightbox-loading .ipt-lightbox-content::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ipt-lightbox-spin 0.8s linear infinite;
}

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

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .ipt-lightbox-close {
        top: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 45px;
    }

    .ipt-lightbox-prev,
    .ipt-lightbox-next {
        width: 50px;
        height: 60px;
        font-size: 40px;
    }

    .ipt-lightbox-prev {
        left: 10px;
    }

    .ipt-lightbox-next {
        right: 10px;
    }

    .ipt-lightbox-counter {
        bottom: 20px;
        font-size: 12px;
    }
}
