/* ==========================================================================
   PeerPaw Modern Fullscreen Image Lightbox & Zoom Viewer Styles
   ========================================================================== */

/* Zoomable trigger hints */
.peerpaw-zoomable {
    cursor: zoom-in !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease !important;
    position: relative;
}

.peerpaw-zoomable:hover {
    transform: scale(1.025);
    box-shadow: 0 8px 24px rgba(0, 102, 254, 0.18) !important;
}

/* Lightbox overlay container */
.peerpaw-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 29, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    box-sizing: border-box;
}

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

/* Header toolbar */
.peerpaw-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(14px, env(safe-area-inset-top)) 20px 14px 20px;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
}

.peerpaw-lightbox-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    max-width: 50%;
}

.peerpaw-lightbox-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
    margin: 0;
    font-family: 'Prompt', 'Kanit', sans-serif;
}

.peerpaw-lightbox-badge {
    background: rgba(0, 102, 254, 0.4);
    border: 1px solid rgba(0, 102, 254, 0.6);
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}

/* Toolbar controls */
.peerpaw-lightbox-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.peerpaw-lightbox-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.peerpaw-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px) scale(1.05);
    color: #ffffff;
}

.peerpaw-lightbox-btn:active {
    transform: translateY(0) scale(0.95);
}

.peerpaw-lightbox-btn.btn-close-viewer {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    margin-left: 6px;
}

.peerpaw-lightbox-btn.btn-close-viewer:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: #ef4444;
    color: #ffffff;
}

.peerpaw-lightbox-zoom-level {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-family: 'Outfit', sans-serif;
}

/* Stage & image viewport */
.peerpaw-lightbox-stage {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.peerpaw-lightbox-stage.dragging {
    cursor: grabbing;
}

.peerpaw-lightbox-image-wrapper {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    will-change: transform;
    transition: transform 0.12s ease-out;
}

.peerpaw-lightbox-img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Loading spinner */
.peerpaw-lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    border: 3.5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #0066fe;
    border-radius: 50%;
    animation: peerpawSpin 0.8s linear infinite;
    display: none;
}

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

/* Bottom hint toolbar */
.peerpaw-lightbox-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px max(14px, env(safe-area-inset-bottom)) 20px;
    z-index: 10;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
}

.peerpaw-lightbox-hint {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Prompt', sans-serif;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .peerpaw-lightbox-title-wrap {
        max-width: 40%;
    }
    .peerpaw-lightbox-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    .peerpaw-lightbox-zoom-level {
        display: none;
    }
    .peerpaw-lightbox-hint {
        font-size: 0.75rem;
    }
    .peerpaw-lightbox-img {
        max-width: 95vw;
        max-height: 78vh;
    }
}
