/**
 * Gallery 公共样式
 * 用于图片展示、模态框等
 */

/* Masonry Grid Styles */
.masonry-grid {
    column-count: 4;
    column-gap: 1rem;
}

@media (max-width: 1280px) {
    .masonry-grid { column-count: 3; }
}

@media (max-width: 1024px) {
    .masonry-grid { column-count: 2; }
}

@media (max-width: 640px) {
    .masonry-grid { column-count: 1; }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(148, 163, 184, 0.1);
    background: rgba(30, 41, 59, 0.5);
    break-inside: avoid;
    margin-bottom: 1rem;
    display: inline-block;
    width: 100%;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(129, 140, 248, 0.2);
    border: 2px solid transparent;
    background-image: linear-gradient(rgba(30, 41, 59, 0.5), rgba(30, 41, 59, 0.5)), 
                      linear-gradient(45deg, #818cf8, #c084fc, #f472b6, #fb923c);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    animation: borderRotate 3s linear infinite;
}

/* 动态渐变边框旋转动画 */
@keyframes borderRotate {
    0% {
        background-image: linear-gradient(rgba(30, 41, 59, 0.5), rgba(30, 41, 59, 0.5)), 
                          linear-gradient(45deg, #818cf8, #c084fc, #f472b6, #fb923c);
    }
    25% {
        background-image: linear-gradient(rgba(30, 41, 59, 0.5), rgba(30, 41, 59, 0.5)), 
                          linear-gradient(135deg, #c084fc, #f472b6, #fb923c, #818cf8);
    }
    50% {
        background-image: linear-gradient(rgba(30, 41, 59, 0.5), rgba(30, 41, 59, 0.5)), 
                          linear-gradient(225deg, #f472b6, #fb923c, #818cf8, #c084fc);
    }
    75% {
        background-image: linear-gradient(rgba(30, 41, 59, 0.5), rgba(30, 41, 59, 0.5)), 
                          linear-gradient(315deg, #fb923c, #818cf8, #c084fc, #f472b6);
    }
    100% {
        background-image: linear-gradient(rgba(30, 41, 59, 0.5), rgba(30, 41, 59, 0.5)), 
                          linear-gradient(45deg, #818cf8, #c084fc, #f472b6, #fb923c);
    }
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 1.5rem 1rem 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.gallery-item:hover .gallery-actions {
    opacity: 1;
}

.action-btn {
    background: rgba(129, 140, 248, 0.95);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(129, 140, 248, 1);
    transform: scale(1.1);
}

.action-btn i {
    margin: 0;
}

/* Lightbox Styles */
#lightbox {
    backdrop-filter: blur(10px);
}

#lightbox.active {
    display: flex !important;
}

#lightbox-image {
    max-height: 85vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border: 3px solid transparent;
    border-image: linear-gradient(45deg, #818cf8, #c084fc, #f472b6) 1;
    animation: borderGradient 3s linear infinite;
}

/* 动画效果 */
.animate-fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
