/* Gallery Section */
.gallery-section {
    padding: 7rem 2rem;
    background: var(--bg-secondary);
    transition: background 0.3s ease;
}

.gallery-container {
    max-width: 1600px;
    margin: 0 auto;
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    scroll-margin-top: 100px; /* For smooth scrolling offset */
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--primary);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.filter-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 95, 191, 0.3);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 95, 191, 0.4);
}

/* Gallery Category Sections */
.gallery-category-section {
    margin-bottom: 4rem;
    position: relative;
}

.gallery-category-section:last-child {
    margin-bottom: 0;
}

.back-to-filters-btn {
    position: absolute;
    top: 1rem;
    right: 0;
    padding: 0.5rem 1.1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #9b6bc4 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(139, 95, 191, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.back-to-filters-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #9b6bc4 0%, var(--primary) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.back-to-filters-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 95, 191, 0.5);
}

.back-to-filters-btn:hover::before {
    opacity: 1;
}

.back-to-filters-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 95, 191, 0.4);
}

.back-to-filters-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.back-to-filters-btn:hover i {
    transform: translateY(-3px);
    animation: bounce-up 0.6s ease infinite;
}

@keyframes bounce-up {
    0%, 100% {
        transform: translateY(-3px);
    }
    50% {
        transform: translateY(-6px);
    }
}

.category-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary);
    margin-top: 1rem;
}

.category-header h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin: 0;
}

.category-header p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Gallery Grid - 6 images per row */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.gallery-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.gallery-thumbnail {
    position: relative;
    padding-top: 75%;
    background: var(--gradient);
    overflow: hidden;
}

.gallery-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
    filter: brightness(0.9);
}

.gallery-card:hover .gallery-thumbnail img {
    transform: scale(1.1);
    filter: brightness(1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.7));
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-category {
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
}

.gallery-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gallery-info h3 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.gallery-info p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.3;
    margin: 0;
}

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

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 95, 191, 0.8);
    border-radius: 50%;
}

.lightbox-close:hover {
    background: var(--primary);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 95, 191, 0.8);
    border-radius: 50%;
}

.lightbox-nav:hover {
    background: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1.1rem;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 1600px) {
    .gallery-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-header h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 2rem 1rem;
        margin-top: 60px;
    }
    
    .gallery-filters {
        gap: 0.5rem;
        margin-top: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .back-to-filters-btn {
        position: static;
        margin-bottom: 1rem;
        padding: 0.40rem 1rem;
        font-size: 0.85rem;
    }
    
    .back-to-filters-btn i {
        font-size: 0.7rem;
    }
    
    .gallery-category-section {
        margin-bottom: 3rem;
    }
    
    .category-header {
        margin-bottom: 1.5rem;
    }
    
    .category-header h3 {
        font-size: 1.3rem;
    }
    
    .category-header p {
        font-size: 0.9rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .gallery-info {
        padding: 0.8rem;
    }
    
    .gallery-info h3 {
        font-size: 0.85rem;
    }
    
    .gallery-info p {
        font-size: 0.7rem;
    }
    
    .gallery-card:hover {
        transform: translateY(-3px);
    }
    
    .gallery-card:hover .gallery-thumbnail img {
        transform: scale(1.05);
    }
    
    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 2rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: -35px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .lightbox-caption {
        bottom: -50px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 1.5rem 0.8rem;
        margin-top: 80px;
    }
    
    .gallery-filters {
        gap: 0.4rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .category-header h3 {
        font-size: 1.1rem;
    }
    
    .category-header p {
        font-size: 0.85rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .gallery-info {
        padding: 0.6rem;
    }
    
    .gallery-info h3 {
        font-size: 0.8rem;
    }
    
    .gallery-info p {
        font-size: 0.65rem;
    }
    
    .gallery-category {
        font-size: 0.6rem;
        padding: 0.2rem 0.6rem;
    }
}