/* 图片灯箱样式 */

/* 灯箱遮罩层 */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 灯箱容器 */
.lightbox-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 灯箱内容区域 */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: lightboxFadeIn 0.4s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 灯箱图片 */
.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
}

/* 图片标题 */
.lightbox-caption {
    margin-top: 15px;
    color: var(--text-color, #ffffff);
    font-size: 16px;
    text-align: center;
    max-width: 600px;
    line-height: 1.4;
}

/* 图片计数器 */
.lightbox-counter {
    margin-top: 10px;
    color: var(--text-secondary, #cccccc);
    font-size: 14px;
    font-weight: 500;
}

/* 关闭按钮 */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* 上一张/下一张按钮 */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #ffffff;
    font-size: 30px;
    cursor: pointer;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 212, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

/* 缩略图区域 */
.lightbox-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    max-width: 90%;
    overflow-x: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.lightbox-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.lightbox-thumbnail:hover {
    border-color: rgba(0, 212, 255, 0.5);
    transform: scale(1.05);
}

.lightbox-thumbnail.active {
    border-color: var(--primary-color, #00d4ff);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.lightbox-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 画廊项目放大镜指示器 */
.gallery-item {
    position: relative;
    overflow: hidden;
}

.zoom-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 5;
}

.gallery-item:hover .zoom-indicator {
    opacity: 1;
    transform: scale(1.1);
}

.gallery-item:hover {
    cursor: pointer;
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 212, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 85%;
    }

    .lightbox-image {
        max-height: 60vh;
    }

    .lightbox-thumbnails {
        bottom: 10px;
        max-width: 95%;
        gap: 8px;
    }

    .lightbox-thumbnail {
        width: 50px;
        height: 50px;
    }

    .lightbox-caption {
        font-size: 14px;
        margin-top: 10px;
    }

    .zoom-indicator {
        width: 30px;
        height: 30px;
        font-size: 12px;
        top: 8px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .lightbox-thumbnails {
        display: none; /* 在很小的屏幕上隐藏缩略图 */
    }

    .lightbox-content {
        max-height: 90%;
    }

    .lightbox-image {
        max-height: 70vh;
    }
}

/* 无障碍访问 */
.lightbox-overlay:focus-within {
    outline: none;
}

.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus,
.lightbox-thumbnail:focus {
    outline: 2px solid var(--primary-color, #00d4ff);
    outline-offset: 2px;
}

/* 加载动画 */
.lightbox-image[src=""] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
