/* Futuristic Gallery Collage Styles - Flexible for any number of images */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 100px;
    gap: 15px;
    margin-top: 25px;
    padding: 10px;
    grid-auto-flow: dense;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(0, 245, 212, 0.15);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.85) contrast(1.1);
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-secondary);
    box-shadow: 
        0 20px 40px rgba(0, 245, 212, 0.3),
        0 0 60px rgba(157, 78, 221, 0.2),
        inset 0 0 20px rgba(0, 245, 212, 0.1);
    z-index: 10;
}

.gallery-item:hover img {
    transform: scale(1.15);
    filter: brightness(1) contrast(1.2);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0, 245, 212, 0.1) 0%, 
        rgba(157, 78, 221, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

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

/* Dynamic sizing pattern - repeats every 5 items for flexibility */
.gallery-item:nth-child(5n+1) {
    grid-column: span 3;
    grid-row: span 2;
}

.gallery-item:nth-child(5n+2) {
    grid-column: span 3;
    grid-row: span 3;
}

.gallery-item:nth-child(5n+3) {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item:nth-child(5n+4) {
    grid-column: span 4;
    grid-row: span 3;
}

.gallery-item:nth-child(5n+5) {
    grid-column: span 2;
    grid-row: span 2;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    animation: zoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid rgba(0, 245, 212, 0.3);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(0, 245, 212, 0.2);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(0, 245, 212, 0.2);
    border: 2px solid var(--accent-secondary);
    color: var(--accent-secondary);
    font-size: 32px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover {
    background: var(--accent-secondary);
    color: #000;
    transform: rotate(90deg);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { 
        transform: scale(0.8);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 80px;
        gap: 10px;
        padding: 5px;
    }

    .gallery-item:nth-child(5n+1),
    .gallery-item:nth-child(5n+2),
    .gallery-item:nth-child(5n+3),
    .gallery-item:nth-child(5n+4) {
        grid-column: span 2;
        grid-row: span 2;
    }

    .gallery-item:nth-child(5n+5) {
        grid-column: span 4;
        grid-row: span 2;
    }

    .gallery-item:hover {
        transform: translateY(-4px) scale(1.01);
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-auto-rows: 70px;
        gap: 8px;
    }
}

/* Placeholder styles */
.gallery-item.placeholder {
    background: radial-gradient(circle at top, rgba(157,78,221,0.25), transparent 60%);
    min-height: 140px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
}
