/* Gallery 3D Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    perspective: 1200px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    height: 350px;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(-5deg) scale(1.05);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.3);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.gallery-overlay .btn {
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Lightbox Styles */
.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
}

/* Gallery Filter */
#portfolioSelect {
    border-radius: 10px;
    border: 2px solid #667eea;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

#portfolioSelect:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

#portfolioSelect:hover {
    border-color: #764ba2;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .gallery-item {
        height: 250px;
    }

    .gallery-item:hover {
        transform: translateY(-10px) scale(1.02);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-item {
        height: 200px;
    }
}
