/* Photo Gallery - Modern & Unique Design */

/* Gallery Container */
.photo-gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Gallery Header */
.gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.gallery-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #4ca1af, #2c3e50);
    border-radius: 2px;
}

.gallery-header p {
    font-size: 1.2rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Search Bar */
.gallery-search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.gallery-search-box {
    display: flex;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    overflow: hidden;
}

#gallery-search {
    flex: 1;
    border: none;
    padding: 15px 25px;
    font-size: 1rem;
    outline: none;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

#gallery-search:focus {
    background: #fff;
}

#search-btn {
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    color: white;
    border: none;
    padding: 0 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#search-btn:hover {
    background: linear-gradient(135deg, #4ca1af, #2c3e50);
}

/* Category Navigation */
.category-navigation {
    margin-bottom: 40px;
}

.category-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none;
    padding: 0;
}

.category-list a {
    display: inline-block;
    padding: 10px 25px;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.category-list a:hover,
.category-list a.active {
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Gallery Sections */
.gallery-section {
    display: none;
}

.gallery-section.active {
    display: block;
}

/* Masonry Layout */
.masonry-gallery {
    column-count: 3;
    column-gap: 20px;
}

@media (max-width: 992px) {
    .masonry-gallery {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .masonry-gallery {
        column-count: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transform: translateZ(0);
    transition: transform 0.3s ease;
}

.masonry-item:hover {
    transform: translateY(-5px);
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.5s ease;
}

.masonry-item:hover img {
    transform: scale(1.05);
}

/* Overlay */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.masonry-item:hover .overlay {
    opacity: 1;
    transform: translateY(0);
}

.overlay h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.overlay p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Lightbox */
#gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    z-index: 1000;
    padding: 40px;
    box-sizing: border-box;
}

.lightbox-content {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.lightbox-caption {
    color: white;
    margin-top: 20px;
    text-align: center;
    font-size: 1.2rem;
}

.close-lightbox {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: all 0.3s ease;
}

.close-lightbox:hover {
    color: #4ca1af;
    transform: rotate(90deg);
}

/* Marquee Gallery */
.marquee-gallery {
    overflow: hidden;
    margin: 60px 0;
    position: relative;
    background: #f8f9fa;
    padding: 30px 0;
}

.marquee-gallery::before,
.marquee-gallery::after {
    content: '';
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 2;
}

.marquee-gallery::before {
    left: 0;
    background: linear-gradient(to right, #f8f9fa, transparent);
}

.marquee-gallery::after {
    right: 0;
    background: linear-gradient(to left, #f8f9fa, transparent);
}

.marquee-container {
    display: flex;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.marquee-item {
    flex-shrink: 0;
    width: 250px;
    margin: 0 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.marquee-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.marquee-item:hover img {
    transform: scale(1.1);
}

/* Animation for gallery items */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.masonry-item {
    animation: fadeIn 0.5s ease forwards;
}

.masonry-item:nth-child(2) {
    animation-delay: 0.1s;
}

.masonry-item:nth-child(3) {
    animation-delay: 0.2s;
}

.masonry-item:nth-child(4) {
    animation-delay: 0.3s;
}

.masonry-item:nth-child(5) {
    animation-delay: 0.4s;
}

.masonry-item:nth-child(6) {
    animation-delay: 0.5s;
}

/* Loading States */
.photo-gallery-container.loading {
    opacity: 0.7;
}

.photo-gallery-container.loading .masonry-item {
    opacity: 0.5;
    transform: scale(0.95);
}

.photo-gallery-container.loaded .masonry-item {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .gallery-header h1 {
        font-size: 2.5rem;
    }
    
    .gallery-search-box {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .category-list {
        padding: 0 10px;
    }
    
    .category-list a {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    
    .marquee-item {
        width: 200px;
    }
    
    #gallery-lightbox {
        padding: 20px;
    }
    
    .close-lightbox {
        top: -30px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .photo-gallery-container {
        padding: 20px 10px;
    }
    
    .gallery-header h1 {
        font-size: 2rem;
    }
    
    .gallery-header p {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .category-list {
        gap: 10px;
    }
    
    .category-list a {
        padding: 6px 15px;
        font-size: 0.8rem;
    }
    
    .marquee-item {
        width: 150px;
        margin: 0 10px;
    }
    
    .marquee-item img {
        height: 120px;
    }
}

/* Hover Effects Enhancement */
.masonry-item {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-8px) scale(1.02);
}

/* Gallery Section Transitions */
.gallery-section {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-section.active {
    opacity: 1;
    pointer-events: auto;
}

/* Search Enhancement */
.gallery-search-box:focus-within {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Marquee Pause Indicator */
.marquee-gallery:hover::before {
    background: linear-gradient(to right, rgba(248, 249, 250, 0.9), transparent);
}

.marquee-gallery:hover::after {
    background: linear-gradient(to left, rgba(248, 249, 250, 0.9), transparent);
}

/* Accessibility Improvements */
.category-list a:focus,
#search-btn:focus,
#gallery-search:focus {
    outline: 2px solid #4ca1af;
    outline-offset: 2px;
}

.masonry-item:focus {
    outline: 3px solid #4ca1af;
    outline-offset: 3px;
}

/* Print Styles */
@media print {
    .gallery-search-container,
    .category-navigation,
    .marquee-gallery,
    #gallery-lightbox {
        display: none;
    }
    
    .masonry-gallery {
        column-count: 2;
        column-gap: 10px;
    }
    
    .masonry-item {
        break-inside: avoid;
        margin-bottom: 10px;
    }
    
    .overlay {
        position: static;
        opacity: 1;
        background: #f8f9fa;
        color: #333;
        padding: 10px;
    }
}