/* Gallery Section Styles */
.gallery-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #333;
    position: relative;
    padding-bottom: 1rem;
}

.gallery-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #0056b3;
}

/* Gallery Hero Section */
.gallery-hero {
    position: relative;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), var(--hero-image, url('../images/hero-bg.jpg'));
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    margin-bottom: 3rem;
}

.gallery-hero-content {
    max-width: 800px;
    color: #fff;
}

.gallery-hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.hero-description {
    font-size: 1.2rem;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

/* Filter Buttons */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    background: #f5f5f5;
    color: #333;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.filter-btn:hover,
.filter-btn.active {
    background: #007bff;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

/* Gallery Container */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.gallery-header {
    text-align: center;
    margin-bottom: 3rem;
}

.gallery-description {
    max-width: 800px;
    margin: 0 auto;
    color: #666;
    line-height: 1.6;
}

/* Gallery Grid */
.gallery-grid {
    margin: 0 -15px;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.gallery-item {
    width: calc(33.333% - 30px);
    margin: 15px;
    opacity: 0;
    transform: translateY(30px);
}

.gallery-item.in-view {
    animation: fadeInUp 0.6s ease forwards;
}

.gallery-item-inner {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery-item-inner:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.gallery-link {
    display: block;
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

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

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

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.gallery-title {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.gallery-overlay.hover .gallery-title {
    transform: translateY(0);
}

.gallery-zoom {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    transform: translate(20px, -20px);
    opacity: 0;
    transition: all 0.4s ease;
}

.gallery-overlay.hover .gallery-zoom {
    transform: translate(0, 0);
    opacity: 1;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .gallery-item {
        width: calc(50% - 30px);
    }
}

@media screen and (max-width: 768px) {
    .gallery-hero-content h1 {
        font-size: 2.5rem;
    }

    .gallery-item {
        width: calc(100% - 30px);
    }

    .gallery-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Loading Animation */
.gallery-item.loading {
    opacity: 0;
    transform: translateY(20px);
}

/* Fancybox Custom Styles */
.fancybox__container {
    --fancybox-bg: rgba(0, 0, 0, 0.95);
}

.fancybox__caption {
    font-size: 1.1rem;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

/* Modern Content Overlay */
.gallery-item-content {
    position: absolute;
    inset: 0;
    padding: 2rem;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(0, 0, 0, 0.2) 30%,
            rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-item-content {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item-content h3 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-item-content h3,
.gallery-item:hover .gallery-item-content p {
    transform: translateY(0);
}

/* Modern Zoom Button */
.gallery-zoom-link {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-size: 1.2rem;
    opacity: 0;
    transform: translate(20px, -20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover .gallery-zoom-link {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

.gallery-zoom-link:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Category Badge */
.gallery-item::before {
    content: attr(data-category);
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1a1a1a;
    text-transform: capitalize;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover::before {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Gradient Effect */
.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg,
            rgba(var(--primary-rgb, 0, 86, 179), 0.2) 0%,
            rgba(var(--primary-rgb, 0, 86, 179), 0) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

/* Custom Fancybox Styles */
.fancybox__container {
    --fancybox-bg: rgba(17, 17, 17, 0.95);
    --fancybox-color: #fff;
}

.fancybox__toolbar {
    --fg1: #fff;
    --fg2: rgba(255, 255, 255, 0.8);
    --bg1: rgba(24, 24, 27, 0.5);
    --bg2: rgba(24, 24, 27, 0.8);
    backdrop-filter: blur(10px);
}

.fancybox__caption {
    font-size: 1.1rem;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

/* Custom Animations */
.fancybox-zoomIn {
    animation: fancyboxZoomIn 0.4s ease-out;
}

.fancybox-zoomOut {
    animation: fancyboxZoomOut 0.4s ease-out;
}

@keyframes fancyboxZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fancyboxZoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}