/*
 * Modern Gallery Showcase Pro — Lightbox Styles
 * ================================================
 * Premium fullscreen lightbox overlay.
 * Controlled by lightbox.js — classes drive all state.
 *
 * @package GalleryShowcasePro
 */

/* ── Overlay ──────────────────────────────────────────────────────────────── */

.gsp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gsp-lightbox[hidden] {
    display: none;
}

.gsp-lightbox.gsp-lightbox--open {
    display: flex;
    animation: gspLbFadeIn .25s ease;
}

.gsp-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

/* ── Inner container ─────────────────────────────────────────────────────── */

.gsp-lightbox__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Image Wrap ──────────────────────────────────────────────────────────── */

.gsp-lightbox__image-wrap {
    position: relative;
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gspLbScaleIn .3s cubic-bezier(.34, 1.56, .64, 1) both;
}

.gsp-lightbox__image {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    display: block;
    border-radius: 4px;
    box-shadow: 0 32px 80px rgba(0,0,0,.6);
    transition: opacity .25s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.gsp-lightbox__image.gsp-loading {
    opacity: 0;
}

/* ── Loader / Spinner ────────────────────────────────────────────────────── */

.gsp-lightbox__loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.gsp-lightbox__loader[hidden] {
    display: none;
}

.gsp-lightbox__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: rgba(255,255,255,.8);
    border-radius: 50%;
    animation: gspSpin .8s linear infinite;
}

/* ── Watermark ───────────────────────────────────────────────────────────── */

.gsp-lightbox__watermark {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 5px 12px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    border-radius: 100px;
    font-size: 11px;
    color: rgba(255,255,255,.75);
    font-weight: 600;
    letter-spacing: .3px;
    pointer-events: none;
    user-select: none;
}

/* ── Close Button ────────────────────────────────────────────────────────── */

.gsp-lightbox__close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}

.gsp-lightbox__close:hover {
    background: rgba(255,255,255,.2);
    transform: scale(1.08) rotate(90deg);
}

.gsp-lightbox__close svg {
    width: 20px;
    height: 20px;
}

/* ── Prev / Next Buttons ─────────────────────────────────────────────────── */

.gsp-lightbox__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}

.gsp-lightbox__nav:hover {
    background: rgba(255,255,255,.2);
    transform: translateY(-50%) scale(1.08);
}

.gsp-lightbox__nav--prev { left: 20px; }
.gsp-lightbox__nav--next { right: 20px; }

.gsp-lightbox__nav[disabled] {
    opacity: .2;
    cursor: not-allowed;
    pointer-events: none;
}

.gsp-lightbox__nav svg {
    width: 22px;
    height: 22px;
}

/* ── Caption Bar ─────────────────────────────────────────────────────────── */

.gsp-lightbox__bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 16px 80px;
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
}

.gsp-lightbox__bar-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: auto;
}

.gsp-lightbox__bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.gsp-lightbox__title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.gsp-lightbox__caption {
    font-size: 13px;
    color: rgba(255,255,255,.7);
}

.gsp-lightbox__counter {
    font-size: 13px;
    color: rgba(255,255,255,.6);
    font-variant-numeric: tabular-nums;
}

.gsp-lightbox__action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.8);
    border: 1px solid rgba(255,255,255,.2);
    transition: all .2s ease;
}

.gsp-lightbox__action:hover {
    background: rgba(255,255,255,.25);
    color: #fff;
}

.gsp-lightbox__action svg {
    width: 18px;
    height: 18px;
}

/* ── Animations ──────────────────────────────────────────────────────────── */

@keyframes gspLbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes gspLbScaleIn {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes gspSpin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .gsp-lightbox__image-wrap {
        max-width: 100vw;
        max-height: calc(100vh - 100px);
    }

    .gsp-lightbox__image {
        max-height: calc(100vh - 120px);
        border-radius: 0;
    }

    .gsp-lightbox__nav--prev { left: 8px; }
    .gsp-lightbox__nav--next { right: 8px; }
    .gsp-lightbox__nav { width: 40px; height: 40px; }
    .gsp-lightbox__close { top: 12px; right: 12px; width: 40px; height: 40px; }
    .gsp-lightbox__bar { padding: 12px 56px; }
}

/* ── Reduced Motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .gsp-lightbox.gsp-lightbox--open,
    .gsp-lightbox__image-wrap {
        animation: none;
    }
}
