/* --------- General Styles --------- */
body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

h2 {
    margin-top: 20px;
    font-size: 28px;
    color: #333;
}

/* --------- Gallery Grid --------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    max-width: 1200px;
    margin: auto;
}

.image-card {
    position: relative;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background: #fff;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.image-card:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.image-card img {
    width: 100%;
    height: auto;
    display: block;
}

/* --------- Download Button --------- */
.download-btn {
    display: block;
    background: #28a745;
    color: #fff;
    padding: 10px;
    text-decoration: none;
    font-size: 14px;
    margin: 10px;
    border-radius: 5px;
    text-align: center;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #218838;
}

/* --------- Pagination --------- */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    text-decoration: none;
    background: #007bff;
    color: white;
    padding: 10px 16px;
    border-radius: 5px;
    margin: 5px;
    transition: background 0.3s, transform 0.2s;
}

.pagination a:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.pagination span {
    padding: 10px 16px;
    font-weight: bold;
    color: #333;
}

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

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    transition: transform 0.3s ease-in-out;
}

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox .close:hover {
    color: #ff4444;
}

/* --------- Lightbox Navigation --------- */
.nav {
    display: flex;
    justify-content: space-between;
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: white;
    user-select: none;
}

.nav span {
    cursor: pointer;
    padding: 20px;
    transition: background 0.3s, transform 0.2s;
}

.nav span:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* --------- Responsive Adjustments --------- */
@media screen and (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .image-card {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .pagination {
        flex-direction: column;
    }

    .pagination a {
        padding: 8px 12px;
    }
}
