

/* Header & Navigation */
.gallery-header {
    background:#0f7bb8; /* Gradient background */
    color: white;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.header-content h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.header-content p {
    font-size: 1.1em;
    opacity: 0.9;
}

.filter-navigation {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px; /* Space between buttons */
}

.filter-btn {
    background-color: rgba(255, 255, 255, 0.2); /* Slightly transparent white */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 12px 25px;
    border-radius: 30px; /* More rounded buttons */
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-transform: uppercase;
    font-weight: bold;
}

.filter-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.filter-btn.active {
    background-color: white;
    color: #2575fc; /* Matching the gradient end color */
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

/* Gallery Container */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Auto-fit for better responsiveness */
    gap: 25px; /* Increased gap for better spacing */
    padding: 30px;
    max-width: 1300px; /* Wider container */
    margin: 30px auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Gallery Items */
.gallery-item {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease;
    display: flex; /* Use flex for content alignment */
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 220px; /* Slightly increased height */
    object-fit: cover;
    display: block;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

/* Hide items that don't match the filter */
.gallery-item.hidden {
    display: none;
    animation: fadeOut 0.3s forwards; /* Add fade out animation */
}

/* Animations for filtering */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}

/* Apply animation when showing items */
.gallery-item:not(.hidden) {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Lightbox Styles (Enhanced) */
.lightbox {
    display: none; /* Hidden by default, JS will change to flex when active */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95); /* Darker, more opaque background */
    align-items: center;
    justify-content: center;
    animation: fadeInBackground 0.3s ease-out;
}

@keyframes fadeInBackground {
    from { background-color: rgba(0,0,0,0); }
    to { background-color: rgba(0,0,0,0.95); }
}


.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255,255,255,0.2);
    animation: zoomIn 0.3s ease-out;
}

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

.close-btn {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 50px; /* Larger close button */
    font-weight: lighter; /* Thinner 'x' */
    transition: 0.3s;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    transform: rotate(90deg); /* Little animation on close */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2em;
    }
    .filter-navigation {
        flex-direction: column; /* Stack buttons on smaller screens */
    }
    .filter-btn {
        width: 80%; /* Make buttons wider */
        margin: 5px auto;
    }
    .gallery-container {
        grid-template-columns: 1fr; /* Single column on very small screens */
        padding: 15px;
    }
    .lightbox-content {
        max-width: 95%;
    }
    .close-btn {
        font-size: 40px;
        top: 10px;
        right: 20px;
    }
}