/* ============================================
   JZ Lightbox System - Glassmorphism Edition
   Central Plugin for Content Images
   ============================================ */

/* Lightbox Overlay - Glass Effect */
.jz-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85); /* --color-secondary with opacity */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

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

/* Image Container */
.jz-lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 16px; /* --radius-md */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: transparent;
    cursor: default;
}

.jz-lightbox-overlay.active .jz-lightbox-container {
    transform: scale(1);
}

.jz-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px; /* --radius-md */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Caption / Title */
.jz-lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9); /* --bg-glass stronger */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 24px;
    border-radius: 100px;
    color: #0F172A; /* --color-secondary */
    font-family: 'Manrope', sans-serif; /* --font-primary */
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease 0.2s;
    pointer-events: none;
}

.jz-lightbox-overlay.active .jz-lightbox-caption {
    opacity: 1;
}

/* Close Button */
.jz-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10000;
}

.jz-lightbox-close:hover {
    background: #A1131A; /* --color-primary */
    border-color: #A1131A;
    transform: rotate(90deg);
}

.jz-lightbox-close::before,
.jz-lightbox-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: white;
    border-radius: 2px;
}

.jz-lightbox-close::before {
    transform: rotate(45deg);
}

.jz-lightbox-close::after {
    transform: rotate(-45deg);
}

/* Spinner */
.jz-lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #A1131A; /* --color-primary */
    animation: jz-spin 1s ease-in-out infinite;
    transform: translate(-50%, -50%);
    z-index: -1;
}

@keyframes jz-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Indication that image is zoomable */
img.jz-lightbox-trigger {
    cursor: zoom-in;
    transition: transform 0.3s ease, filter 0.3s ease;
}

img.jz-lightbox-trigger:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}
