*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

.image-generator {
    height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url("./img/pexels-steve-johnson-1266808.jpg");
    background-size:cover;
    background-position: center;
    position: relative;
}

.image-generator::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: black;
    opacity: .2;
}

.content {
    color: white;
    padding: 0 15px;
    max-width: 760px;
    text-align: center;
    position: relative;
}

.image-generator h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.image-generator p {
    font-size: 1.35rem;
    margin-top: 10px;
}

.generate-form {
    height: 56px;
    width: 100%;
    display: flex;
    padding: 6px;
    margin: 45px 0 15px;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-radius: 30px;
}

.prompt-input {
    width: 100%;
    height: 100%;
    font-size: 1rem;
    outline: none;
    border: none;
    background: none;
    padding: 0 17px;
}

.controls {
    display: flex;
    height: 100%;
    gap: 15px;
}

.img-quantity {
    outline: none;
    border: none;
    background: none;
    font-size: 1rem;
}

.generate-btn {
    font-size: 1rem;
    outline: none;
    border: none;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 30px;
    background: rgb(57, 145, 185);
}

/* galeria de imgs */
.image-gallery {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding: 0 15px;
    max-width: 1250px;
    margin: 50px auto;
    justify-content: center;
}

.image-gallery .img-card {
    width: 285px;
    aspect-ratio: 1 / 1;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f2;
}

.image-gallery .img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-gallery .img-card.loading img {
    width: 80px;
    height: 80px;
}

.image-gallery .img-card .download-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #fff;
    height: 36px;
    width: 36px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-gallery .img-card:not(.loading):hover .download-btn{
    display: flex;
}

.image-gallery .img-card .download-btn img {
    width: 14px;
    height: 14px;
}


/* @media */
@media screen and (max-width: 760px){
    .image-generator h1 {
        font-size: 1.8rem;
    }

    .image-generator p {
        font-size: 1rem;
    }

    .image-generator .generate-form {
        margin-top: 30px;
        height: 52px;
        display: block;
    }

    .generate-form .controls {
        height: 40px;
        margin-top: 15px;
        align-items: center;
        justify-content: flex-end;
    }

    .generate-form .img-quantity {
        color: #fff;
    }

    .generate-form .img-quantity option {
        color: #000;
    }

    .generate-form .generate-btn {
        height: 100%;
    }

    .image-gallery {
        margin-top: 20px;
    }

    .image-gallery .img-card:not(.loading) .download-btn {
        display: flex;
    }
}

@media screen and (max-width: 550px) {
    .image-gallery .img-card {
        width: 100%;
    }
}