/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
}

/* Header Styles */
header {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: #fff;
}

/* Gallery Container */
.gallery-container {
    padding: 80px 20px 20px;
    max-width: 1200px;
    margin: auto;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.gallery-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}
.gallery-item .caption {
  position: absolute;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  width: 100%;
  padding: 6px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Caption */
.caption {
    text-align: center;
    font-size: 14px;
    color: #555;
    margin-top: 5px;
}
.caption:empty::before {
  content: "[No Caption]";
  color: #aaa;
  font-style: italic;
}


/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 95%;
    max-width: 500px;
    border: 5px solid #fff;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Filters Section */
.filter-toggle-container {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  padding: 10px 20px;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.filter-icon {
  width: 30px;
  height: auto;
  cursor: pointer;
  filter: invert(0.2);
}

#filter-panel {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px auto;
}

#filter-panel.visible {
  display: flex;
}
/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px;
}

.pagination button {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    outline: 2px solid #0056b3;
}

.pagination button:hover {
    background-color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-container {
        padding: 10px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .gallery-item {
        border-radius: 6px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .gallery-item img {
        transition: transform 0.2s ease;
    }

    .caption {
        font-size: 12px;
        margin-top: 3px;
    }

    .filters {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .filters button {
        width: 100%;
        max-width: 300px;
        padding: 10px;
        font-size: 14px;
    }

    .pagination {
        flex-direction: column;
        gap: 5px;
    }

    .pagination button {
        padding: 8px 15px;
        font-size: 14px;
    }

    .lightbox-content {
        width: 95%;
        max-width: 500px;
    }

    .close {
        font-size: 30px;
    }
}
