/* Account image lightbox gallery */
.account-gallery__thumb {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: zoom-in;
    background: #0f1218;
    box-shadow: 0 8px 24px rgba(15, 18, 24, 0.12);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.account-gallery__thumb img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
}

.account-gallery__zoom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(15, 18, 24, 0.05) 0%, rgba(15, 18, 24, 0.55) 100%);
    color: #fff;
    font-size: 22px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.account-gallery__zoom i {
    transform: scale(0.7);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.account-gallery__thumb:hover,
.account-gallery__thumb:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(24, 101, 247, 0.22);
    outline: none;
}

.account-gallery__thumb:hover img,
.account-gallery__thumb:focus-visible img {
    transform: scale(1.06);
    filter: brightness(0.88);
}

.account-gallery__thumb:hover .account-gallery__zoom,
.account-gallery__thumb:focus-visible .account-gallery__zoom {
    opacity: 1;
}

.account-gallery__thumb:hover .account-gallery__zoom i,
.account-gallery__thumb:focus-visible .account-gallery__zoom i {
    transform: scale(1);
    animation: bb-zoom-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.bb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.32s ease, visibility 0.32s ease;
}

.bb-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bb-lightbox.is-closing {
    opacity: 0;
    visibility: hidden;
}

.bb-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 14, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.32s ease;
}

.bb-lightbox.is-open .bb-lightbox__backdrop {
    opacity: 1;
}

.bb-lightbox__stage {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100vw - 48px));
    height: min(78vh, calc(100vh - 160px));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bb-lightbox__figure {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    transform: scale(0.9) translateY(18px);
    opacity: 0;
    transition:
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.32s ease;
    will-change: transform, opacity;
}

.bb-lightbox.is-open .bb-lightbox__figure {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.bb-lightbox__figure.is-exit-next {
    opacity: 0;
    transform: translateX(-48px) scale(0.96);
    transition-duration: 0.18s;
}

.bb-lightbox__figure.is-exit-prev {
    opacity: 0;
    transform: translateX(48px) scale(0.96);
    transition-duration: 0.18s;
}

.bb-lightbox__figure.is-enter-next {
    opacity: 0;
    transform: translateX(48px) scale(0.96);
    transition: none;
}

.bb-lightbox__figure.is-enter-prev {
    opacity: 0;
    transform: translateX(-48px) scale(0.96);
    transition: none;
}

.bb-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: min(78vh, calc(100vh - 160px));
    width: auto;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    user-select: none;
    -webkit-user-drag: none;
}

.bb-lightbox__nav,
.bb-lightbox__close {
    position: absolute;
    z-index: 2;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.3s ease;
}

.bb-lightbox.is-open .bb-lightbox__nav,
.bb-lightbox.is-open .bb-lightbox__close {
    opacity: 1;
}

.bb-lightbox.is-open .bb-lightbox__close {
    animation: bb-fade-in-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bb-lightbox.is-open .bb-lightbox__nav--prev {
    animation: bb-slide-in-right 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bb-lightbox.is-open .bb-lightbox__nav--next {
    animation: bb-slide-in-left 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bb-lightbox__nav:hover,
.bb-lightbox__close:hover,
.bb-lightbox__nav:focus-visible,
.bb-lightbox__close:focus-visible {
    background: rgba(24, 101, 247, 0.92);
    box-shadow: 0 0 0 4px rgba(24, 101, 247, 0.28);
    outline: none;
}

.bb-lightbox__nav:active,
.bb-lightbox__close:active {
    transform: scale(0.94);
}

.bb-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
}

.bb-lightbox__nav--prev {
    right: max(16px, calc((100vw - min(1120px, calc(100vw - 48px))) / 2 - 72px));
}

.bb-lightbox__nav--next {
    left: max(16px, calc((100vw - min(1120px, calc(100vw - 48px))) / 2 - 72px));
}

.bb-lightbox__nav.is-hidden {
    opacity: 0 !important;
    pointer-events: none;
}

.bb-lightbox__close {
    top: 20px;
    left: 20px;
    font-size: 18px;
}

.bb-lightbox__meta {
    position: absolute;
    z-index: 2;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(720px, calc(100vw - 32px));
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.bb-lightbox.is-open .bb-lightbox__meta {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.bb-lightbox__counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 13px;
    letter-spacing: 0.02em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.bb-lightbox__counter.is-pulse {
    animation: bb-counter-pulse 0.35s ease;
}

.bb-lightbox__thumbs {
    display: flex;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: none;
}

.bb-lightbox__thumbs::-webkit-scrollbar {
    display: none;
}

.bb-lightbox__thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 44px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #1a1f28;
    opacity: 0.55;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.bb-lightbox__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bb-lightbox__thumb.is-active,
.bb-lightbox__thumb:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.bb-lightbox__thumb.is-active {
    border-color: #1865F7;
    box-shadow: 0 0 0 2px rgba(24, 101, 247, 0.35);
    animation: bb-thumb-active 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

body.bb-lightbox-open {
    overflow: hidden;
}

@keyframes bb-zoom-pop {
    0% { transform: scale(0.6); }
    60% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes bb-fade-in-up {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bb-slide-in-right {
    from { opacity: 0; transform: translateY(-50%) translateX(16px); }
    to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

@keyframes bb-slide-in-left {
    from { opacity: 0; transform: translateY(-50%) translateX(-16px); }
    to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

@keyframes bb-counter-pulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes bb-thumb-active {
    0% { transform: translateY(0) scale(0.94); }
    100% { transform: translateY(-2px) scale(1); }
}

@media (max-width: 830px) {
    .bb-lightbox__stage {
        width: calc(100vw - 24px);
        height: calc(100vh - 180px);
    }

    .bb-lightbox__img {
        max-height: calc(100vh - 180px);
        border-radius: 10px;
    }

    .bb-lightbox__nav {
        width: 42px;
        height: 42px;
    }

    .bb-lightbox__nav--prev {
        right: 10px;
    }

    .bb-lightbox__nav--next {
        left: 10px;
    }

    .bb-lightbox__close {
        top: 12px;
        left: 12px;
    }

    .bb-lightbox__meta {
        bottom: 16px;
    }

    .bb-lightbox__thumb {
        width: 56px;
        height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .account-gallery__thumb,
    .account-gallery__thumb img,
    .account-gallery__zoom,
    .account-gallery__zoom i,
    .bb-lightbox,
    .bb-lightbox__backdrop,
    .bb-lightbox__figure,
    .bb-lightbox__nav,
    .bb-lightbox__close,
    .bb-lightbox__meta,
    .bb-lightbox__thumb {
        transition: none !important;
        animation: none !important;
    }
}
