* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #9a45f4, #5d13f2, #34c2ff);
    padding: 50px 8%;
}

.container {
    max-width: 1300px;
    margin: auto;
}

/* Heading */
h1 {
    text-align: center;
    color: #fff;
    font-size: 3rem;
    margin-bottom: 35px;
    text-shadow: 0 10px 25px rgba(0, 0, 0, .4);
}

/* ===========================
Search and upload Box
=========================== */
.top-controls{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:20px;
    flex-wrap:wrap;
    margin-bottom:35px;
}

.search-box{
    width:100%;
    max-width:450px;
    display:flex;
    align-items:center;
    background:white;
    border-radius:50px;
    padding:14px 22px;
    box-shadow:0 12px 30px rgba(0,0,0,.25);
}

.upload-btn{
    border:none;
    outline:none;
    background:#fff;
    color:#5d13f2;
    padding:14px 24px;
    border-radius:50px;
    cursor:pointer;
    font-size:16px;
    font-weight:600;
    display:flex;
    align-items:center;
    gap:10px;
    transition:.3s;
    box-shadow:0 12px 30px rgba(0,0,0,.25);
}

.upload-btn:hover{
    transform:translateY(-3px);
    background:#5d13f2;
    color:white;
}

.search-box i {
    color: #666;
    font-size: 18px;
    margin-right: 12px;
}

.search-box input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
}

.search-box input::placeholder {
    color: #888;
}

/* ===========================
Filter Buttons
=========================== */

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-buttons button {

    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: .35s;
}

.filter-buttons button:hover {
    background: white;
    color: #333;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, .25);
}

.filter-buttons .active {
    background: white;
    color: #333;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .25);
}

/* ===========================
Loader
=========================== */

.loader {
      position: fixed;
    inset: 0;
    background: linear-gradient(135deg,#9a45f4,#5d13f2,#34c2ff);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 99999;
    transition: .1s;
}


.spinner {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 8px solid #ddd;
    border-top: 8px solid #6c3df5;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* ===========================
Gallery
=========================== */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.gallery-info {
    margin-bottom: 10px;
}

.gallery-info span {
    color: white;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    cursor: pointer;
    transition: .4s;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .25);
}

.card-icons{
    position:absolute;
    top:10px;
    right:10px;
    display:flex;
    gap:8px;
    z-index:5;
}

.card-icons i{
    width:36px;
    height:36px;
    background:rgba(255,255,255,.95);
    border-radius:50%;
    display:flex;
    justify-content:center;
    align-items:center;
    cursor:pointer;
    transition:.3s;
    font-size:16px;
}

.card-icons i:hover{
    transform:scale(1.1);
}

.favorite-icon.active{
    color:#ff1744;
}

.restore-icon{
    color:#2ecc71;
    cursor:pointer;
}

.delete-icon{
    color:#e53935;
    cursor:pointer;
}

.restore-icon:hover,
.delete-icon:hover{
    transform:scale(1.15);
}

.trash-icon{
    color:#444;
}


.trash-icon:hover{
    color:#ff3d3d;
}

.gallery-item img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transition: .45s;
}

.gallery-item:hover {
    transform: translateY(-8px);
}

.gallery-item:hover img {
    transform: scale(1.12);
}

/* show hide animation */

.gallery-item.show {
    opacity: 1;
    transform: scale(1);
}

.gallery-item.hide {
    opacity: 0;
    transform: scale(.8);
    pointer-events: none;
}

/* ===========================
Overlay
=========================== */

.overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 18px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .85));
    transform: translateY(100%);
    transition: .4s;
}

.gallery-item:hover .overlay {
    transform: translateY(0);
}

.overlay h3 {
    color: white;
    font-size: 21px;
}

/* ===========================
Modal
=========================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .95);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 999;
}

.modal-image {
    width: 80%;
    max-width: 1000px;
    max-height: 80vh;
    border-radius: 15px;
    object-fit: contain;
    animation: zoom .35s;
}

@keyframes zoom {

    from {
        transform: scale(.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }

}

/* ===========================
Close Button
=========================== */

.close-btn {
    position: absolute;
    right: 35px;
    top: 20px;
    color: white;
    font-size: 36px;
    cursor: pointer;
    transition: .3s;
}

.close-btn:hover {
    color: #ff5b5b;
    transform: rotate(90deg);
}

/* ===========================
Download Button
=========================== */

#downloadBtn {
    position: absolute;
    top: 20px;
    left: 35px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    font-size: 20px;
    transition: .3s;
}

#downloadBtn:hover {
    transform: scale(1.1);
    background: #00d084;
    color: white;
}

/* ===========================
Navigation Buttons
=========================== */

.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, .2);
    color: white;
    font-size: 25px;
    transition: .3s;
}

.prev {
    left: 35px;
}

.next {
    right: 35px;
}

.prev:hover,
.next:hover {
    background: white;
    color: #333;
}

/* ===========================
Caption
=========================== */

.modal-bottom {
    width: 80%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    color: white;
    font-size: 20px;
}

.caption {
    font-weight: 600;
}

.counter {
    opacity: .8;
}

/* ===========================
Responsive
=========================== */

@media(max-width:900px) {
    .modal-image {
        width: 92%;
    }
}

@media(max-width:768px) {
    body {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .search-box {
        max-width: 100%;
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .prev,
    .next {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }

    #downloadBtn {
        left: 15px;
        width: 42px;
        height: 42px;
    }

    .close-btn {
        right: 15px;
    }

    .modal-bottom {
        width: 95%;
        font-size: 16px;
        padding: 0 10px;
    }

}

@media(max-width:500px) {

    .filter-buttons {
        gap: 10px;
    }

    .filter-buttons button {
        padding: 10px 18px;
        font-size: 14px;
    }

    .gallery-item img {
        height: 220px;
    }

}