/* Reset */

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

/* Variáveis */

:root {
    --cor-primaria: #6c5fff;
    --cor-escura: #232323;
    --cor-branca: #ffffff;
    --sombra: 0 2px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
}

.navegacao {
    position: fixed;
    top: 0;
    width: 100%;

}

.navegacao div {
    height: auto;
    background-color: var(--cor-primaria);
    background: linear-gradient(135deg, var(--cor-primaria), var(--cor-escura));
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 2rem;

}

div ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

div ul a {
    color: var(--cor-branca);
    font-size: 1rem;
    text-decoration: none;
    transition: 0.5s;

}

div ul a:hover {
    cursor: pointer;
    color: var(--cor-escura);
}

main {
    margin-top: 5rem;
}

#form-cadastro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 2rem;
}

#descricao, #fotos, #mapa {
    grid-column: 1 / -1;
}

#form-cadastro label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

#form-cadastro input,
#form-cadastro textarea,
#form-cadastro select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

#form-cadastro button {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

button[type="submit"] {
    background-color: var(--cor-primaria);
    color: var(--cor-branca);
}

button[type="reset"] {
    background-color: var(--cor-escura);
    color: var(--cor-branca);
}

textarea {
    width: 100%;
    height: 120px;
    margin-left: 0;
    resize: vertical;
}

footer {
    text-align: center;
}

#listagem {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.card {
    border: solid 2px var(--cor-escura);
    width: 20rem;
    text-align: center;
    background-color: var(--cor-branca);
    border-radius: var(--border-radius);
    box-shadow: var(--sombra);
    overflow: hidden;
    transition: 0.5s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.551);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.descricao {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-venda {
    display: inline-block;
    background-color: #d4efdf;
    color: #1e8449;
    padding: 0.2rem 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.8rem;
    width: fit-content;
}

.tag-aluguel {
    display: inline-block;
    background-color: #d6eaf8;
    color: #2471a3;
    padding: 0.2rem 0.8rem;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.8rem;
    width: fit-content;
}

.card-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-info .valor {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cor-primaria);
}

.card-botoes {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    justify-content: center;
}

.card-botoes button {
    border: none;
    background-color: var(--cor-primaria);
    color: var(--cor-branca);
    transition: 0.5s;
    padding: 0.6rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.card-botoes button:hover {
    cursor: pointer;
    color: var(--cor-escura);

}

.card-botoes .btn-excluir {
    background-color: #e74c3c;
}

.card-botoes .btn-editar {
    background-color: var(--cor-escura); 
}

dialog {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--sombra);
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    margin: auto;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.btn-cancelar {
    background-color: #e74c3c;
    color: var(--cor-branca);
}

.btn-modal {
    padding: 0.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

/* Imovel.html */

#detalhe-imovel {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--cor-branca);
    border-radius: var(--border-radius);
    box-shadow: var(--sombra);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#detalhe-imovel img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

#detalhe-imovel h3 {
    font-size: 1.5rem;
    color: var(--cor-escura);
}

#detalhe-imovel .valor {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cor-primaria);
}

#detalhe-imovel .data-cadastro {
    font-size: 0.8rem;
    color: #888;
}

#detalhe-imovel iframe {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: var(--border-radius);
}

/* responsividade */

@media (max-width: 768px) {
    div ul {
        display: flex;
        flex-direction: column;
    }       

    #form-cadastro {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #detalhe-imovel {
        margin: 1rem;
        padding: 1rem;
    }

    #detalhe-imovel img {
        height: 250px;
    }
}