/**
 * Winning Team - Ultra-Premium Lightbox CSS
 * Designed for full-screen zooming, dark glassmorphism, smooth animations & touch gestures.
 */

/* Prevent page scrolling when lightbox is active */
body.wt-lb-open {
    overflow: hidden !important;
    touch-action: none;
}

/* Lightbox Overlay Backdrop */
.wt-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 12, 22, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
    user-select: none;
    -webkit-user-select: none;
}

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

/* Top Toolbar */
.wt-lb-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(8, 12, 22, 0.88) 0%, rgba(8, 12, 22, 0) 100%);
    z-index: 50;
    pointer-events: auto;
}

.wt-lb-counter {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wt-lb-counter i {
    color: #38bdf8;
    font-size: 11px;
}

.wt-lb-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sleek Circular Glass Buttons */
.wt-lb-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.wt-lb-btn:hover {
    background: #0284c7;
    color: #ffffff !important;
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.wt-lb-btn:active {
    transform: scale(0.96);
}

.wt-lb-btn.wt-lb-close:hover {
    background: #ef4444;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.wt-lb-btn.is-active-btn {
    background: #0284c7;
    border-color: #38bdf8;
}

/* Stage Area (Center Viewport) */
.wt-lb-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 70px 80px 80px 80px;
    box-sizing: border-box;
    overflow: hidden;
    cursor: default;
}

/* Image Wrap & Frame */
.wt-lb-img-wrap {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.wt-lb-img {
    max-width: 88vw;
    max-height: calc(100vh - 165px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12);
    cursor: zoom-in;
    transform-origin: center center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

/* Zoomed-in State */
.wt-lightbox-overlay.is-zoomed .wt-lb-stage {
    overflow: auto;
    cursor: grab;
}

.wt-lightbox-overlay.is-zoomed .wt-lb-stage:active {
    cursor: grabbing;
}

.wt-lightbox-overlay.is-zoomed .wt-lb-img {
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    transform: scale(1.6);
    cursor: zoom-out;
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Smooth Spinner Loader */
.wt-lb-spinner {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 3.5px solid rgba(255, 255, 255, 0.15);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: wtLbSpin 0.75s linear infinite;
    pointer-events: none;
    z-index: 5;
    display: none;
}

.wt-lb-spinner.is-loading {
    display: block;
}

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

/* Floating Navigation Arrows */
.wt-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 60;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.wt-lb-nav.wt-lb-prev {
    left: 20px;
}

.wt-lb-nav.wt-lb-next {
    right: 20px;
}

.wt-lb-nav:hover {
    background: #0284c7;
    color: #ffffff !important;
    transform: translateY(-50%) scale(1.12);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 28px rgba(2, 132, 199, 0.5);
}

.wt-lb-nav:active {
    transform: translateY(-50%) scale(0.96);
}

.wt-lb-nav.is-disabled {
    opacity: 0.25;
    pointer-events: none;
}

/* Bottom Caption Bar */
.wt-lb-caption-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px 20px 24px;
    background: linear-gradient(0deg, rgba(8, 12, 22, 0.94) 0%, rgba(8, 12, 22, 0.6) 60%, rgba(8, 12, 22, 0) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 50;
    pointer-events: none;
}

.wt-lb-caption-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin: 0 0 6px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    max-width: 90vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wt-lb-caption-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(2, 132, 199, 0.28);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    backdrop-filter: blur(6px);
}

.wt-lb-caption-badge i {
    font-size: 11px;
}

/* Keyboard hint tooltip for desktop */
.wt-lb-keyboard-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    opacity: 0.75;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wt-lb-stage {
        padding: 60px 15px 75px 15px;
    }

    .wt-lb-img {
        max-width: 95vw;
        max-height: calc(100vh - 150px);
        border-radius: 6px;
    }

    .wt-lb-toolbar {
        height: 52px;
        padding: 0 12px;
    }

    .wt-lb-counter {
        font-size: 11px;
        padding: 4px 10px;
    }

    .wt-lb-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .wt-lb-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .wt-lb-nav.wt-lb-prev {
        left: 10px;
    }

    .wt-lb-nav.wt-lb-next {
        right: 10px;
    }

    .wt-lb-caption-title {
        font-size: 15px;
    }

    .wt-lb-caption-badge {
        font-size: 10px;
        padding: 2px 10px;
    }

    .wt-lb-keyboard-hint {
        display: none;
    }
}
