/* Gallery Page Styles */

/* Filter Buttons */
.gallery-filter-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid var(--primary-color, #0056b3);
    border-radius: 50px;
    background: transparent;
    color: var(--primary-color, #0056b3);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color, #0056b3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.3);
}

/* Gallery Masonry Layout */
.gallery-layout {
    column-count: 4;
    column-gap: 20px;
    padding: 10px;
}

@media (max-width: 1200px) {
    .gallery-layout {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .gallery-layout {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .gallery-layout {
        column-count: 1;
    }
}

/* Gallery Item */
.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateZ(0);
    /* Fix for webkit flickering */
    background: #000;
}

.gallery-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.gallery-item img,
.gallery-item video {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.gallery-item video {
    min-height: 200px;
    background: #000;
    object-fit: contain;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.05);
    opacity: 0.8;
}

/* Overlay */
.gallery-item .overlay,
.gallery-item .icon-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.icon-overlay {
    opacity: 0.7;
    /* Always visible for video to show it is a video */
    background: transparent;
    cursor: pointer;
}

.gallery-item:hover .icon-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.2);
}

.gallery-item .overlay i,
.gallery-item .icon-overlay i {
    color: white;
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s;
}

.close-lightbox:hover {
    color: #ccc;
}