/* Enhanced Category Button Styles with Better Visual Distinction */
.category-btn {
    padding: 8px 20px;
    background: rgba(255,255,255,0.1) !important;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    backdrop-filter: blur(10px);
    color: rgba(255,255,255,0.7);
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.category-btn:hover::before {
    left: 100%;
}

.category-btn:hover {
    background: rgba(255,255,255,0.2) !important;
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    color: rgba(255,255,255,0.9);
}

.category-btn.active {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.8)) !important;
    border-color: rgba(255,255,255,0.9);
    color: #333 !important;
    font-weight: 600;
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4), 0 0 0 3px rgba(255,255,255,0.3);
}

.category-btn.active::before {
    display: none;
}

#three-gallery {
    background: #ffffff;
}

#gallery-loader, 
#gallery-instruction {
    color: #333;
}

/* Enhanced Masonry Category Filter Buttons */
.masonry-category-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.masonry-category-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid transparent;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    color: #6c757d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.masonry-category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.masonry-category-btn:hover::before {
    left: 100%;
}

.masonry-category-btn:hover {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border-color: #495057;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.masonry-category-btn.active {
    background: linear-gradient(135deg, #333, #1a1a1a) !important;
    color: white !important;
    border-color: #333;
    font-weight: 600;
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 12px 35px rgba(0,0,0,0.3), 0 0 0 3px rgba(51,51,51,0.2);
}

.masonry-category-btn.active::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* True Masonry Grid Styles */
.fashion-gallery-section {
    padding: 80px 0;
    background: #ffffff;
}

.masonry-grid {
    column-count: 4;
    column-gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.masonry-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: scale(1);
    opacity: 1;
    background: white;
}

.masonry-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.masonry-item.category-focused {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.masonry-item.category-unfocused {
    opacity: 0.4;
    transform: scale(0.95);
}

.masonry-item.category-focused:hover {
    transform: translateY(-8px) scale(1.07);
}

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

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

.masonry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0,0,0,0.8) 0%,
        rgba(0,0,0,0.4) 50%,
        rgba(0,0,0,0.8) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

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

.masonry-title {
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.masonry-item:hover .masonry-title {
    transform: translateY(0);
}

.masonry-category {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-weight: 500;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.masonry-item:hover .masonry-category {
    transform: translateY(0);
}

.masonry-description {
    color: rgba(255,255,255,0.9);
    font-size: 0.8rem;
    line-height: 1.4;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s;
}

.masonry-item:hover .masonry-description {
    transform: translateY(0);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 3rem;
    font-weight: 300;
    color: #333;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Animation for category changes */
.masonry-item {
    animation-duration: 0.6s;
    animation-fill-mode: both;
}

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

.masonry-item.animate-in {
    animation-name: fadeInScale;
}

/* Loading shimmer effect for dynamic images */
.masonry-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Responsive Design for True Masonry */
@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
        column-gap: 15px;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
        column-gap: 12px;
        padding: 0 15px;
    }
    
    .masonry-item {
        margin-bottom: 12px;
        border-radius: 8px;
    }
    
    .masonry-title {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .fashion-gallery-section {
        padding: 60px 0;
    }
    
    .masonry-category-filter {
        gap: 8px;
    }
    
    .masonry-category-btn {
        padding: 10px 18px;
        font-size: 12px;
    }
    
    .category-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
        column-gap: 0;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}
