/* Custom Lightbox Styles v2.0 */

/* Lightbox 容器 */
.custom-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0);
    z-index: 9998;
    overflow: hidden;
    transition: background-color 0.25s ease-out;
}

.custom-lightbox.opening {
    display: flex !important;
    background-color: rgba(255, 255, 255, 1);
}

/* 防止页面滚动 */
body.custom-lightbox-open {
    overflow: hidden;
    /* padding-right 由 JavaScript 动态设置，避免硬编码 */
}

/* 主要内容容器 */
.custom-lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    max-width: 90%;
    max-height: 90vh;
    transition: opacity 0.25s ease-out;
}

/* 图片样式 */
#custom-lightbox-img {
    max-height: 85vh;
    max-width: 100%;
    display: block;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-out;
}

/* 图片说明 */
.custom-lightbox-caption {
    background-color: transparent;
    color: #000;
    padding: 15px 20px;
    text-align: left;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    margin-right: 20px;
    min-width: 200px;
    max-width: 500px;
    min-height: 40px;
    height: auto;
    white-space: normal;
    overflow-y: auto;
    max-height: 80vh;
    opacity: 0;
    visibility: hidden;
    box-sizing: border-box;
    transition: opacity 0.25s ease-out;
}

.custom-lightbox-caption strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
    color: #333;
}

/* 关闭按钮 */
.custom-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: #333;
    background: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    padding: 10px;
    z-index: 10;
    transition: color 0.2s ease;
}

.custom-lightbox-close:hover {
    color: #000;
}

/* 加载动画 - 底部进度条overlay */
.custom-lightbox-loader {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: rgba(200, 200, 200, 0.3);
    z-index: 10001;
    display: none;
    overflow: hidden;
    pointer-events: none; /* 不影响点击事件 */
}

.custom-lightbox-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        rgba(150, 150, 150, 0.4) 0%, 
        rgba(100, 100, 100, 0.6) 50%, 
        rgba(150, 150, 150, 0.4) 100%
    );
    border-radius: 0;
    animation: lightbox-progress 1.5s ease-in-out infinite;
    transition: width 0.3s ease;
}

.custom-lightbox-progress-indeterminate {
    width: 30%;
    background: linear-gradient(
        90deg, 
        transparent 0%, 
        rgba(120, 120, 120, 0.5) 50%, 
        transparent 100%
    );
    animation: lightbox-slide 1.8s linear infinite;
}

@keyframes lightbox-progress {
    0% { width: 0%; }
    50% { width: 60%; }
    100% { width: 100%; }
}

@keyframes lightbox-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* 动画相关 */
.animate-lightbox {
    transition: all 0.3s ease;
}

.lightbox-image-initial {
    position: fixed;
    z-index: 9999;
    transition: all 0.3s ease-out;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .custom-lightbox-content {
        flex-direction: column;
    }
    
    .custom-lightbox-caption {
        margin-right: 0;
        margin-top: 15px;
        min-width: auto;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        white-space: normal;
        max-height: 30vh;
    }
    
    #custom-lightbox-img {
        max-height: 65vh;
    }
}

/* 可点击关闭区域 */
.custom-lightbox * {
    cursor: pointer;
}

/* 备用加载动画 */
.custom-lightbox-pulse {
    width: 60px;
    height: 60px;
    background-color: rgba(51, 51, 51, 0.6);
    border-radius: 50%;
    animation: lightbox-pulse 1.5s ease-in-out infinite;
}

@keyframes lightbox-pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(0.8);
        opacity: 1;
    }
}

/* 骨架屏效果 */
.custom-lightbox-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: lightbox-loading 1.5s infinite;
}

@keyframes lightbox-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
} 