/**
 * ShareHub 2.0 - Lightbox 样式
 */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox--active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: zoom-out;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 85vh;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-md);
}

.lightbox-caption {
    color: white;
    margin-top: var(--spacing-md);
    text-align: center;
    max-width: 600px;
    font-size: 0.875rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    z-index: 2;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.lightbox-close {
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    line-height: 1;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: bold;
}

.lightbox-prev {
    left: var(--spacing-lg);
}

.lightbox-next {
    right: var(--spacing-lg);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .lightbox-close {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: var(--spacing-sm);
    }

    .lightbox-next {
        right: var(--spacing-sm);
    }

    .lightbox-image {
        max-width: 95vw;
        max-height: 80vh;
    }
}

/* 动画 */
@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox--active .lightbox-overlay {
    animation: lightboxFadeIn var(--transition-base);
}

.lightbox--active .lightbox-image {
    animation: lightboxZoomIn var(--transition-base);
}
