/**
 * Lightbox新布局样式补充
 * 缩略图导航底部居中样式
 */

/* ========================================
   基础布局样式（PC端）
   ======================================== */

/* 主图区域 - 居中显示 */
.lightbox-main-center {
    position: fixed;
    top: 50%;
    left: 0;
    right: 380px; /* 为右侧详情面板留出空间 */
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100% - 400px);
    max-height: 90vh;
    z-index: 100;
    padding: 0 20px;
}

/* 右侧详情面板 */
.lightbox-sidebar-right {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 24px;
    overflow-y: auto;
    z-index: 100;
}

/* 主图包装器 */
.lightbox-image-wrapper {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.lightbox-image-wrapper img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

/* 缩略图导航 - 固定在页面底部，水平居中于主图 */
.thumbnail-navigation-bottom {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 400px; /* 为右侧详情面板留出空间 */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 100%);
    padding: 12px 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    max-width: calc(100% - 420px);
    margin: 0 auto;
    z-index: 101;
}

.thumbnail-navigation-bottom .thumbnail-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
}

/* 滚动条样式 */
.thumbnail-navigation-bottom .thumbnail-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-navigation-bottom .thumbnail-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.thumbnail-navigation-bottom .thumbnail-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary, #0d6efd);
    border-radius: 3px;
}

/* 右侧详情面板滚动条 */
.lightbox-sidebar-right::-webkit-scrollbar {
    width: 6px;
}

.lightbox-sidebar-right::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.lightbox-sidebar-right::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1400px) {
    .lightbox-main-center {
        right: 360px;
        max-width: calc(100% - 380px);
    }
    
    .lightbox-sidebar-right {
        width: 350px;
    }
    
    .thumbnail-navigation-bottom {
        right: 360px;
        max-width: calc(100% - 380px);
    }
}

@media (max-width: 1200px) {
    .lightbox-main-center {
        right: 330px;
        max-width: calc(100% - 340px);
    }
    
    .lightbox-sidebar-right {
        width: 320px;
        padding: 20px;
    }
    
    .thumbnail-navigation-bottom {
        right: 330px;
        max-width: calc(100% - 340px);
    }
}

/* 移动端布局 */
@media (max-width: 992px) {
    .lightbox-main-center {
        position: fixed;
        top: 20px;
        left: 0;
        right: 0;
        bottom: 320px; /* 为底部详情面板和缩略图留出空间 */
        transform: none;
        max-width: 100%;
        max-height: calc(100vh - 340px);
        padding: 0 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .lightbox-image-wrapper {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .lightbox-image-wrapper img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
    }
    
    .lightbox-sidebar-right {
        position: fixed;
        top: auto;
        bottom: 100px; /* 缩略图导航高度 + 间距 */
        right: 0;
        left: 0;
        width: 100%;
        height: 200px;
        padding: 15px;
        background: rgba(0, 0, 0, 0.9);
    }
    
    .thumbnail-navigation-bottom {
        position: fixed;
        bottom: 10px;
        left: 0;
        right: 0;
        transform: none;
        padding: 12px;
        max-width: 100%;
        margin: 0;
    }
    
    /* 移动端箭头尺寸调整 */
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}

@media (max-width: 768px) {
    .lightbox-main-center {
        bottom: 300px;
        max-height: calc(100vh - 320px);
        padding: 0 5px;
    }
    
    .lightbox-image-wrapper {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .lightbox-image-wrapper img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
    }
    
    .lightbox-sidebar-right {
        height: 180px;
        bottom: 90px;
        padding: 12px;
    }
    
    .thumbnail-navigation-bottom {
        padding: 10px;
        bottom: 5px;
    }
    
    .thumbnail-navigation-bottom .thumbnail-container {
        gap: 8px;
    }
    
    /* 小屏幕箭头进一步缩小 */
    .lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .lightbox-prev {
        left: 5px;
    }
    
    .lightbox-next {
        right: 5px;
    }
}

/* 横屏模式优化 */
@media (max-width: 992px) and (orientation: landscape) {
    .lightbox-main-center {
        bottom: 280px;
        max-height: calc(100vh - 300px);
    }
    
    .lightbox-sidebar-right {
        height: 160px;
        bottom: 80px;
    }
    
    .thumbnail-navigation-bottom {
        bottom: 5px;
        padding: 8px;
    }
}
