@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: #fdfdfd;
}

header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 600;
    color: #e60023;
}

.search-bar {
    display: flex;
    width: 50%;
}

.search-bar input {
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 0.8rem 1.5rem;
    width: 100%;
    font-size: 1rem;
}

.search-bar button {
    display: none;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    gap: 1rem;
}

.filter-btn {
    border: none;
    background-color: #eee;
    color: #333;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.filter-btn.active, .filter-btn:hover {
    background-color: #e60023;
    color: #fff;
}

.filter-btn[data-category="trending"] {
    background-color: #ffc107;
    color: #000;
}

.filter-btn[data-category="trending"].active, .filter-btn[data-category="trending"]:hover {
    background-color: #e60023;
    color: #fff;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 16px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.text {
    text-align: center;
}

.text h3 {
    margin-bottom: 0.5rem;
}

.item-1 {
    grid-column: span 2;
    grid-row: span 2;
}

.item-5 {
    grid-column: span 2;
    grid-row: span 1;
}

.item-9 {
    grid-column: span 2;
    grid-row: span 1;
}

.item-14 {
    grid-column: span 2;
    grid-row: span 2;
}


.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lightbox.show {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 70%;
    max-height: 60%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-caption {
    position: absolute;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    text-align: center;
    width: 80%;
}

.lightbox-title {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.lightbox-description {
    font-size: 1rem;
}

.more-like-this {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    text-align: center;
    color: #fff;
    background-color: rgba(0,0,0,0.3);
    padding: 1rem;
    border-radius: 8px;
}

.more-like-this h3 {
    margin-bottom: 1rem;
}

.more-like-this-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.more-like-this-item {
    width: 120px;
    height: 90px;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.more-like-this-item:hover {
    transform: scale(1.1);
}

.more-like-this-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.close-btn:hover {
    color: #ccc;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: white;
    cursor: pointer;
    padding: 10px 15px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 5px;
    user-select: none;
    transition: background-color 0.3s ease;
}

.nav-btn:hover {
    background-color: rgba(0,0,0,0.8);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -30px;
    margin-left: -30px;
    z-index: 2000;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.load-more-btn {
    display: block;
    margin: 2rem auto;
    padding: 1rem 2rem;
    font-size: 1rem;
    background-color: #e60023;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.load-more-btn:hover {
    background-color: #d4001f;
}


@media (max-width: 1024px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-auto-rows: 200px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }

    .search-bar {
        width: 90%;
    }

    .filter-buttons {
        flex-wrap: wrap;
        padding: 1.5rem 1rem;
    }

    .gallery-container {
        padding: 1rem;
        gap: 1rem;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        grid-auto-rows: 150px;
    }

    .lightbox img {
        max-width: 90%;
        max-height: 50%;
    }

    .lightbox-caption {
        bottom: 150px;
        width: 90%;
    }

    .more-like-this {
        bottom: 10px;
        width: 90%;
    }

    .more-like-this-container {
        flex-wrap: wrap;
    }

    .more-like-this-item {
        width: 100px;
        height: 75px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }

    .search-bar input {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

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

    .gallery-container {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        grid-auto-rows: 120px;
    }

    .lightbox img {
        max-height: 40%;
    }

    .lightbox-caption {
        bottom: 100px;
    }

    .more-like-this-item {
        width: 80px;
        height: 60px;
    }

    .nav-btn {
        font-size: 24px;
        padding: 8px 12px;
    }

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