/*!
 * bs5-lightbox v1.8.2
 * https://github.com/trvswgnr/bs5-lightbox
 * 
 * Copyright (c) 2023 Travis Aaron Wagner
 * Licensed under MIT
 */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1060;
    display: none;
    justify-content: center;
    align-items: center;
}

    .lightbox.open {
        display: flex;
    }

    .lightbox .lightbox-content {
        position: relative;
        max-width: 90vw;
        max-height: 90vh;
        margin: auto;
    }

        .lightbox .lightbox-content img,
        .lightbox .lightbox-content video,
        .lightbox .lightbox-content iframe {
            max-width: 100%;
            max-height: 90vh;
            display: block;
            margin: 0 auto;
            border-radius: 4px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
        }

    .lightbox .lightbox-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        background-color: rgba(0, 0, 0, 0.5);
        border: none;
        border-radius: 50%;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        z-index: 1061;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

        .lightbox .lightbox-close:hover {
            background-color: rgba(0, 0, 0, 0.8);
            transform: scale(1.1);
        }

    .lightbox .lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 50px;
        height: 50px;
        background-color: rgba(0, 0, 0, 0.5);
        border: none;
        border-radius: 50%;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        z-index: 1061;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

        .lightbox .lightbox-nav:hover {
            background-color: rgba(0, 0, 0, 0.8);
            transform: translateY(-50%) scale(1.1);
        }

    .lightbox .lightbox-prev {
        left: 20px;
    }

    .lightbox .lightbox-next {
        right: 20px;
    }

    .lightbox .lightbox-caption {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 15px;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
        color: #fff;
        text-align: center;
        font-size: 14px;
        line-height: 1.4;
    }

    .lightbox .lightbox-loader {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 50px;
        height: 50px;
        border: 4px solid rgba(255, 255, 255, 0.3);
        border-top: 4px solid #fff;
        border-radius: 50%;
        animation: lightbox-spin 1s linear infinite;
    }

@keyframes lightbox-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .lightbox .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .lightbox .lightbox-prev {
        left: 10px;
    }

    .lightbox .lightbox-next {
        right: 10px;
    }

    .lightbox .lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

/* 淡入淡出动画 */
.lightbox.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

    .lightbox.fade.show {
        opacity: 1;
    }

/* 缩放动画 */
.lightbox-content.zoom-in {
    animation: lightboxZoomIn 0.3s ease;
}

.lightbox-content.zoom-out {
    animation: lightboxZoomOut 0.3s ease;
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes lightboxZoomOut {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.7);
        opacity: 0;
    }
}
